Version “24” of the Android SDK Build-tools package contains an upstream bug in aapt that can cause at least 2 errors:
- ””aapt.exe” exited with code -1073741819″ (This error can also appear if the Android SDK Build-tools version is not compatible with the installed version of Xamarin.Android. But in this particular case the error is due to the upstream bug.)
- “The file “obj\Debug\android\bin\packaged_resources” does not exist.”
This bug has been fixed in Android SDK Build-tools 24.0.1.
Recommended fix: Uninstall Android SDK Build-tools version 24 using the Android SDK Manager.
Another separate issue is that versions 24 and higher of the Android SDK Build-tools package require Java JDK 8 or higher. This can cause at least 1 error:
- “java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0”
Possible ways to fix:
- Update to Java JDK 8, and then make sure that JDK 8 is selected in the Xamarin preferences:
- Visual Studio: Tools > Options > Xamarin > Android Settings > Java Development Kit Location.
- Xamarin Studio (on Mac): Xamarin Studio > Preferences > Projects > SDK Locations > Android > Java SDK (JDK).
- Or uninstall all Android SDK Build-tools versions 24 and higher via the Android SDK manager.
- Or set the
AndroidSdkBuildToolsVersion
MSBuild property to an earlier version. For example, if you also have version 23.0.3 installed, you could add the following line within the top<PropertyGroup>
element in the Android project.csproj
file:<AndroidSdkBuildToolsVersion>23.0.3</AndroidSdkBuildToolsVersion>
(Edited on July 14, 2016: Simplify the recommendations and provide a link to the upstream bug.)
(Edited on July 25, 2016: Mention the new version Android SDK Build-tools 24.0.1.)
(Edited on August 11, 2016: Add a note about checking the JDK version in the Xamarin preferences.)
转载:https://releases.xamarin.com/technical-bulletin-android-sdk-build-tools-24/