Bug 55195 - [AOT] Enabled hybrid mode several projects fail with "condition `bzero_method' not met"
Summary: [AOT] Enabled hybrid mode several projects fail with "condition `bzero_method...
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Android
Classification: Xamarin
Component: Linker ()
Version: 7.3 (15.2)
Hardware: PC Mac OS
: Normal normal
Target Milestone: 15.6
Assignee: Radek Doulik
URL:
Depends on:
Blocks:
 
Reported: 2017-04-13 20:11 UTC by Gonzalo Martin
Modified: 2017-11-16 17:35 UTC (History)
6 users (show)

Tags: bb ac
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description Gonzalo Martin 2017-04-13 20:11:51 UTC
I'm seeing a several projects failing when AndroidAotMode is set to 'Hybrid

> [aot-compiler stdout] * Assertion at /Users/builder/jenkins/workspace/xamarin-android/xamarin-android/external/mono/mono/mini/method-to-ir.c:3255, condition `bzero_method' not met

Also, some assemblies are not found:

> : error XA3001: Could not AOT the assembly: System.Core.dll
> : error XA3001: Could not AOT the assembly: Java.Interop.dll
> : error XA3001: Could not AOT the assembly: HelloWorld.dll
> : error XA3001: Could not AOT the assembly: Mono.Android.dll
> : error XA3001: Could not AOT the assembly: Mono.Android.dll
> : error XA3001: Could not AOT the assembly: mscorlib.dll
> : error XA3001: Could not AOT the assembly: System.dll

##### Steps to reproduce #####
1. Download https://github.com/xamarin/monodroid-samples/tree/master/HelloWorld
2. nuget restore HelloWorld.sln
3. xbuild /t:SignAndroidpackage HelloWorld.csproj /p:Configuration=release /p:AndroidAotMode=Hybrid

##### Supplemental Info #####
http://xqa.blob.core.windows.net/gist/log-434e481cb97b48d59b06615cae6f4899.txt

##### Environment #####
Mono 5.0.0.54 (2017-02/10fe0e8) (64-bit)
XA Version: 7.3.0.5

Full environment info: https://gist.github.com/gonzalonm/caa990ff96608fd65c35d10ee4c368fe
Comment 1 Zoltan Varga 2017-04-26 20:26:49 UTC
This seems to be a linker problem. The JIT is looking for String::bzero_aligned_1, which should be preserved by the following section in the mscorlib.xml:

		<type fullname="System.String" preserve="fields">
			<method name="CreateString" />
			<method name="InternalAllocateStr" />
			<method name="FastAllocateString" />
			<method name="memcpy" />
			<method name="memset" />
			<method name="bzero" />
			<method name="bzero_aligned_1" />
....

But the obj/release/android/assets/mscorlib.dll file no longer contains this method.
Comment 2 Mark McLemore 2017-06-23 16:35:30 UTC
I'm getting similar errors:

Build FAILED.
Errors:

/Users/mgm/Desktop/HelloWorld/HelloWorld.csproj (SignAndroidpackage) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets (_BuildApkEmbed target) ->

	: error XA3001: Could not AOT the assembly: System.Core.dll
	: error XA3001: Could not AOT the assembly: Java.Interop.dll
	: error XA3001: Could not AOT the assembly: Mono.Android.dll
	: error XA3001: Could not AOT the assembly: mscorlib.dll

	 0 Warning(s)
	 4 Error(s)
Comment 3 Namyslaw Szymaniuk 2017-07-13 19:14:29 UTC
Same issue for me *Could not AOT the assembly: Mono.Android.dll XA3001* at Android *Archiving for publishing*, while using *AOT* option with *Linker = NONE* option. With *Linker = Link SDK only* it works fine.
Comment 4 Peter Collins 2017-11-06 18:27:42 UTC
Adding to the 15.6 milestone for consideration.
Comment 5 Gonzalo Martin 2017-11-06 19:36:31 UTC
It seems be fixed in d15-5 (8.1.0.22)

Mono 5.4.0.212 (2017-06/fbc487ff424) (64-bit)
Comment 6 Peter Collins 2017-11-16 17:35:39 UTC
Marking as resolved per comment #5