Several of our xamarin apps would not build this morning with the same error below. I will update this with more details as I have them.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets (_BuildApkEmbed target) ->
: error XA5103: NDK C compiler resulted in an error. Exit code 0
Environment:
Where did the issue happen?
Xamarin Stable, beta, alpha
Which build Step causes the issue and which version of the step?
Xamarin archive
Reproducibility
Does a “Rebuild” help? : NO
If you have multiple different build configurations (workflows), does the issue affect all/more than one? : YES
Does upgrading the build Step to the latest version help? : NO
When did the issue start? : 29/05
Other stacks
Can it be reproduced by running the build locally with our CLI ( https://www.bitrise.io/cli ), after doing a new git clone of the repository into the /tmp directory and running the build from there with the Bitrise CLI ( https://www.bitrise.io/cli )? YES
Build log
Please attach the build log or if you can’t attach the whole log then send the full log through a private channel (e.g. email - https://www.bitrise.io/contact ). Sent via email
Target _BuildApkEmbed:
[mkbundle stderr]
[cc stderr] obj/Release/bundles/armeabi-v7a/temp.c:1:39: fatal error: mono/metadata/mono-config.h: No such file or directory
[cc stderr] #include <mono/metadata/mono-config.h>
[cc stderr] ^
[cc stderr] compilation terminated.
[cc stderr]
: error XA5103: NDK C compiler resulted in an error. Exit code 0
So it seems the issue is with some kind of mono config header is missing. Most likely this is related to the recent Mono version upgrade in Xamarin; Xamarin now comes with Mono 5 instead of Mono 4.
Did you try to upgrade the relevant packages in your project? Also, did you try to build the project in the latest Xamarin Studio?
Originally I was on mono 5.0.0.100 and the project built successfully through xamarin studio but not the bitrise cli.
I upgraded to latest xamarin studio stable with mono 5.0.1.1 to match what is on bitrise. Now I’m getting the app building through both xamarin studio and the bitrise cli.
Does that suggests something is missing from the stack?
This is related to commit tamarin-android/master/b6d2360
The problem came from the tamarin-android repo switching over to use the system mono mkbundle rather than compiling its own. The problem being that the mono-config.h files are not present. This has now been fixed in the commit above.
The new system allows us to pass an additional flag to tell mkbundle NOT to use the headers. however this does require a new version of mkbundle (see mono/master/59737b2a).
Currently the only work around is to disable bundling of assemblies into native code.
Yes it needs an option - just to confirm, our project builds with msbuild on 15.2.2 but fails with xbuild, so we urgently need that build step updating please
Does the bitrise stack currently include the 15.2.2 hotfix released on friday? I can’t tell from the system report as the xamarin android version reported isn’t specific enough, it doesn’t have the fourth point version number. I suspect the hotfix isn’t deploy as this would explain why I can build the apps without issue using cli locally as I will have the fix.
If the hotfix isn’t deployed is it possible you might deploy this sooner than the weekend? Several of our production apps are failing on bitrise and none of the workarounds to config get them building.
So it does work with the same version and with xbuild locally?
It’s possible that fix was not included, as the stacks are auto provisioned during the early hours on Friday, and tested during the day.
If you confirm that it works locally with xbuild I can schedule an early patch deploy for it, which can be deployed into production in about 12 hours, maybe less.
Thanks for confirming and for the xamarin releases link - we already started to prepare the stack update as indeed it seems that hotfix was released after the VMs were provisioned, and the issue should be fixed by that hotfix update.
We’ll try to push the updated stack into production ASAP.
Note: we’ll try to push the update into production ASAP, so for now we’ll only update the Stable stack, Beta and Alpha will be updated this weekend, following the usual schedule.
In the meantime all the tests did pass and the deploy was started; new Xamarin Stable VMs will now use the new updated VM image which includes the Xamarin.Android 7.3.1.2 hotfix update!
Note: Any build started on an Elite stack will now start with the new build image, but on the Standard stacks it might take a bit more time to refresh all the build VMs as the Standard stacks have prebooted build VMs, which will only use the new image when the VM is rebuilt. In practice this should mean that if you start a build right now and you still have the issue please try to do a rebuild, that will most likely start with the new updated image.
P.S.: due to caching on bitrise.io it might take some time for the new version to show up. If you use the local workflow editor or set the version in bitrise.yml directly, 1.4.1 is available now. On the website it should be available in ~10-30 mins; if you’d still not see it after that, please reload the page/editor a couple of times to refresh the browser’s cache.