Xamarin.Android 7.2: Yay, fixes!
Xamarin.Android 7.0 is the first release to use the open-source repositories:
- Core JNI interaction logic is in the Java.Interop repo
- Android bindings and MSBuild tooling are in the xamarin-android repo.
- Chat is in the
Xamarin.Android 7.1 requires JDK 1.8 to use the Android Nougat (API 24) APIs. Using the Android build-tools r24+ package may also require using JDK 1.8. You can continue to use earlier versions of the JDK when using earlier build-tools packages and when targeting earlier Android API levels:
Additionally, a 64-bit version of the JDK is required to use custom controls in the Android designer.
The simplest option is to install the 64-bit version of JDK 1.8 since it is backwards compatible with all of the previous API levels and supports the new Android designer features.
(One unfortunate complication with JDK 1.8 is that is not compatible with the outdated version of Proguard that is included in the Android SDK. Currently this will cause an error "Unsupported class version number [52.0]" when attempting to use the Proguard or Multidex features in Xamarin.Android. See 44187.)
Android v7.0 Nougat adds support for the Vulkan API. Vulkan support will not be distributed as part of the core Xamarin.Android binding. Instead, please use the VulkanSharp NuGet package, and the XLogo sample app.
Native Library Use
Due to a change by Google,
Android N will now only permit linking to NDK-provided native libraries.
libsqlite.so is not an NDK-provided native library. Consequently,
existing apps using e.g.
Mono.Data.Sqlite.dll will crash when
running on Android N. This may include other SQLite-using assemblies,
not distributed with Xamarin.Android.
Xamarin.Android 7.0, which is part of Cycle 8,
Mono.Data.Sqlite.dll to include
a custom built version of
All Developers need to audit their code for P/Invoke and ensure that referenced
native libraries are either included in the Android NDK, or are included within
app.apk itself. The only Xamarin.Android-provided assembly impacted by
this change is
Xamarin.Android changed the default GC Bridge from
Unfortunately, a few bugs have been reported which suggest a bug within the Tarjan GC bridge.
If this happens, create an
and add the following line:
This will cause the app to use the previous GC bridge.
The Xamarin.Android 7.2 release primarily includes bug fixes.
Xamarin.Android 7.0 introduces several experimental features, which are still experimental:
TLS 1.2 support in
Xamarin.Android 7.1 added
which uses the native Java APIs to provide TLS 1.2 support. However, there are
two problems with
- It can only be used with
- It requires Android 5.0 and later to operate. (Prior Android versions might
not support TLS 1.2, and since
AndroidClientHandleruses the native Java TLS stack...)
To solve these problems, Boring SSL can be used as the
lowest-level TLS implementation. Originally announced
last September, Boring SSL can be embedded within
a Xamarin.Android application, allowing
to communicate with TLS 1.2 endpoints. When enabled, the normal
HttpClient stack also uses Boring SSL.
To enable use of BoringSSL, add the
$(AndroidTlsProvider) MSBuild property
to the application project, with a value of
<PropertyGroup> <AndroidTlsProvider>btls</AndroidTlsProvider> </PropertyGroup>
When enabled, a new
libmono-btls-shared.so shared library will be present
The default value of the
$(AndroidTlsProvider) MSBuild property is the empty
string, i.e. not set, which will use the managed TLS implementation, which
does not support TLS 1.2.
The default value may change in a future release.
Concurrent GC Support
$(AndroidEnableSGenConcurrent) MSBuild property which controls
whether or not the concurrent GC is enabled.
$(AndroidEnableSGenConcurrent) is a boolean value. When
Mono's GC is set to
Mono's GC is set to
The default value is
Improved Fast Deployment
is a way to avoid rebuilding and redeploying Android Packages (
when assemblies have changed in a way that doesn’t require changing the generated
Android Callable Wrappers
or altered any included Android Assets and Resources.
Xamarin.Android 7.0 will optionally allow Android Assets, Resources, and
compiled Java libraries to particpate in fast deployment as well, further
reducing the number of situations in which a possibly slow
and redeploy will be required.
This new behavior is disabled by default. It will be enabled by default in the Xamarin.Android 7.1 series.
To enable this new functionality, set the
MSBuild property to
Adding Resources to the Default Project
For example, assume a new (default) Application project which has already been deployed to a target device.
Resources\layout\Another.axml, and add
Resources\layout\Another.axmlto the project.
- Run the project.
(2) will require that the
.apk be rebuilt and re-deployed to the target.
In previous versions, (2) could take 16 seconds.
With the new system
Add some small benchmarks about what happens during dev when code changes, or a resource changes, numbers before/after
mcw-gen.exe utility is deprecated and will not be provided
in future releases.
We believe that this won't actually break anybody, because as far as we can tell nobody was ever actually using that utility.
- 5979: List support in generic method instantiation in binding got broken by JavaObjectExtensions.JavaCast()
- 43513: Android Binding Adding Generic Arg where one does not exist
- 44673: AndroidClientHandler ignores Timeout value and CancellationToken
- 46397: Xamarin.Forms build failed with "Error executing task ResolveAssemblies: Out of memory"
- 46454: need to escape C# keywords in some parameter reference
- 46931: 'Error: no package specified' message with 126.96.36.199
- 48016: System.Net.NetworkInformation.DnsAddresses is always empty. Fix included.
- 48508: Archiving Android application is archiving old builds
- 48678: NDK r12b+ is not supported
- 51356: Unable to run Multi-Dex
- 51480: Improved fast deployment doesn't build my app
- 51774: AndroidClientHandler throws NetworkOnMainThreadException on Cancelation via cancelation delegate call
- 51175: Fallback to portable pdb with roslyn doesn't work if csproj is missing <DebugType>
- 52259: XA depends on random source file from the mono tree that is gone on master
Integrated Mono Features/Fixes
- 46929: Datetime error on Mono.data.Sqlite
- 52437: Random NullReferenceExceptions in StringBuilder.ThreadSafeCopy
- 52590: Cannot compile for iOS, TypeBuilder exists in two places.
- 52845: [Cycle 9] Satellite assemblies not bundled when using "Bundle assemblies into native code" due to "unknown escape sequence" error from gcc during mkbundle step
- 53066: Can't Build Project in Debug with "Could not AOT the assembly"
- API Level 10: Mono.Android.dll, OpenTK.dll, OpenTK-1.0.dll
- API Level 15: Mono.Android.dll
- API Level 16: Mono.Android.dll
- API Level 17: Mono.Android.dll
- API Level 18: Mono.Android.dll
- API Level 19: Mono.Android.dll
- API Level 20: Mono.Android.dll
- API Level 21: Mono.Android.dll
- API Level 22: Mono.Android.dll
- API Level 23: Mono.Android.dll
- API Level 24: Mono.Android.dll
- API Level 25 (vs. API Level 24): Mono.Android.dll