-
Notifications
You must be signed in to change notification settings - Fork 564
Fix bundling of assemblies in NDK with unified headers #1105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
What would be helpful is a test. :-) A simple test would be to update the NDK used for our build -- in (Which actually shows a pre-existing oversight: we have that project, but we don't appear to be using that project. That in turn should be possible by updating |
ec039f6 to
d613081
Compare
Context: https://developer.xamarin.com/releases/android/xamarin.android_7/xamarin.android_7.4/#API-10_is_Obsolete Context: dotnet#1105 Context: dotnet#1032 In Xamarin.Android 7.4, we announced that API-10 was obsolete and would be removed in a future release. PR dotnet#1032 attempted to do so, but does not yet work, so until now we have continued shipping API-10 assemblies, even though Xamarin.Android 7.4 hit stable on 2017-Aug-11. Meanwhile, PR dotnet#1105 includes an NDK bump, which in turn means that the lowest API level we can compile for will be *API-14*. Attempt to split the difference, assuming PR dotnet#1105 lands before PR dotnet#1032: Keep the supporting files for API-10, but don't build them, and explicitly remove `v2.3` from the `.vsix` file.
Context: https://developercommunity.visualstudio.com/content/problem/166029/building-xamarinandroid-application-with-bundleass.html NDK 14 introduced experimental support for so-called "unified headers" which replace the per-platform C header files, NDK 15 deprecated the old headers and NDK 16 removed them completely. Xamarin.Android has been building itself with NDK configured to use unified headers for a while now, but we missed one piece of code which is affected by the change - mkbundle. This commit adds code to MakeBundleNativeCodeExternal task to make it possible to build code generated by mkbundle on systems with NDK that lacks the per-platform header files. This is done in a backward-compatible way but if your NDK has both the old and the new headers, the latter will be used. Additionally, minimum API versions to 14 for 32-bit targets (forward compatibility with NDK r16)
d613081 to
60eee32
Compare
Context: https://developer.xamarin.com/releases/android/xamarin.android_7/xamarin.android_7.4/#API-10_is_Obsolete Context: #1105 Context: #1032 In Xamarin.Android 7.4, we announced that API-10 was obsolete and would be removed in a future release. PR #1032 attempted to do so, but does not yet work, so until now we have continued shipping API-10 assemblies, even though Xamarin.Android 7.4 hit stable on 2017-Aug-11. Meanwhile, PR #1105 changes NDK use semantics such that *API-14* is now the lowest supported API level for NDK use. There is thus no point in shipping API-10 bindings. Attempt to split the difference, assuming PR #1105 lands before PR #1032: Keep the supporting files for API-10, but don't build them, and explicitly remove `v2.3` from the `.vsix` file.
|
Any workaround ? downgrade NDK ? |
|
@softlion: Yes, the workaround is to downgrade to an NDK which provides the original per-API-level headers, not just the unified headers. NDK r14b qualifies. |
|
@softlion I can confirm that downgrading to NDK v15 also works. The breaking change was in v16 of Android NDK - https://github.com/android-ndk/ndk/wiki/Changelog-r16 |
|
What is the milestone for this merge ? |
|
2018/02/19 Still no milestone ? You have to be faster in releases. |
|
@softlion: We generally don't set milestones on PRs. We set them on issues, and not always then. In this case, the fix is in the d15-6 branch, as d15-6 was branched after this was merged to master. It is thus in the Xamarin.Android 8.2 betas, and has been since Visual Studio 2017 15.6 Preview 2 (early January). |
Context: xamarin/android-sdk-installer@2b4d1a6 Changes: xamarin/monodroid@5784a74...b12a3e8 * xamarin/monodroid@b12a3e8d5: Bump to xamarin/android-sdk-installer@2b4d1a6 & xamarin/xamarin-android/master@d583b7c (#1107) * xamarin/monodroid@3d84feddd: Bump to xamarin/xamarin-android/master@f0d565fe (#1106) * xamarin/monodroid@ec2931825: Bump to xamarin/android-sdk-installer@c6c12db0 (#1105) Sometimes, `<InstallAndroidDependencies/>` would fail when running on Windows, a'la: …\Xamarin\Android\Xamarin.Installer.Common.targets(12,3): Cannot access a disposed object. Object name: 'SslStream'. A fix for the `ObjectDisposedException` has been brought in via the `android-sdk-installer` bump in xamarin/monodroid@b12a3e8d. The `<InstallAndroidDependencies/>` test previously had issues due to clean up logic in the test framework that partially deleted the newly provisioned Android SDK on a subsequent build. I believe that we've been seeing successful results for this test because the subsequent build in the test would fall back to a different Android SDK that was already on disk. The test has been improved by asserting that the newly installed Android SDK is used during the subsequent build.
Context: https://developercommunity.visualstudio.com/content/problem/166029/building-xamarinandroid-application-with-bundleass.html
NDK 14r introduced experimental support for so-called "unified headers" which
replace the per-platform C header files, NDK 15 deprecated the old headers and
NDK 16 removed them completely. Xamarin.Android has been building itself with
NDK configured to use unified headers for a while now, but we missed one piece
of code which is affected by the change - mkbundle.
This commit adds code to MakeBundleNativeCodeExternal task to make it possible
to build code generated by mkbundle on systems with NDK that lacks the
per-platform header files. This is done in a backward-compatible way but if your
NDK has both the old and the new headers, the latter will be used.
Additionally, minimum API versions to 14 for 32-bit targets (forward
compatibility with NDK r16)