Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[xabuild] *Properly* package the .apk.
Commit e20863e adds an `xabuild` script, which allows us to build Android .apk application packages. And lo, it was good! *Unfortunately*, while a .apk was *generated*, the app on-device would immediately crash with a bizarre error. Further investigation pointed to the actual problem: While xamarin-android was generating the .apk, the framework assemblies that were bundled into the app were coming from the local system Xamarin.Android install. (Oops.) Two things are required in order to cause the correct assemblies to be bundled into the app.apk: 1. MSBuild/xbuild require that the bin/$(Configuration)/lib/xbuild-frameworks/MonoAndroid/v* directories contain a `RedistList/FrameworkList.xml` file, otherwise the directory isn't recognized as a valid location for MSBuild frameworks. Since these files were missing, the built assemblies weren't considered for use when compiling the app. Update the build system to generate these files. 2. Xamarin.Android.Common.targets was overriding the $(CscToolExe) and $(CscToolPath) MSBuild properties when running on OS X to refer to an `smcs` script, which (i) doesn't exist in the xamarin-android repo, so (ii) the system-installed smcs script was used instead. The smcs script is no longer necessary, and hasn't actually been required for *years* (behold! laziness!), so just remove these property overrides. With these two changes, `xabuild` is not only able to generate an Android .apk file, but the resulting .apk will actually run on-device! Woo-hoo!
- Loading branch information