Xamarin Android 修改 SdkBuildToolsVersion

原始连接: https://stackoverflow.com/questions/42576113/how-to-change-sdk-build-tools-path-in-vs2015-using-xamarin-adroid

Referring to Build Process of Xamarin.Android, you can find a setting named AndroidSdkBuildToolsVersion:

The Android SDK build-tools package provides the aapt and zipalign tools, among others. Multiple different versions of the build-tools package may be installed simultaneously. The build-tools package chosen for packaging is done by checking for and using a "preferred" build-tools version if it is present; if the "preferred" version is not present, then the highested versioned installed build-tools package is used.

The $(AndroidSdkBuildToolsVersion) MSBuild property contains the prefered build-tools version. The Xamarin.Android build system provides a default value in Xamarin.Android.Common.targets, and the default value may be overridden within youur project file to choose an alternate build-tools version, if (for example) the latest aapt is crashing out while a previous aapt version is known to work.

So, you can change the build-tool version by adding an AndroidSdkBuildToolsVersion tag under each PropertyGroup of YourProject.csproj file like below:

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>True</DebugSymbols>
    <DebugType>Full</DebugType>
    <Optimize>False</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
    <AndroidLinkMode>None</AndroidLinkMode>
    <EmbedAssembliesIntoApk>False</EmbedAssembliesIntoApk>
    <AndroidSdkBuildToolsVersion>24.0.3</AndroidSdkBuildToolsVersion>
  </PropertyGroup>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值