Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
# Steps to reproduce
Build a Xamarin.Forms Android project via
%msbuildpath% %projectfilepath% /p:Configuration=Release /t:PackageForAndroid /p:AndroidSupportedAbis=armeabi
Visual Studio 2015 is used here so %msbuildpath% is usually C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe.
# Expected behavior
Build is successfull like in Xamarin.VisualStudio_188.8.131.523 (double checked by reinstalling old version and then reinstalling new version (Xamarin.VisualStudio_184.108.40.2065.msi) where it fails).
# Actual behavior
Build fails with error message:
[cc stderr] obj\Release\bundles\armeabi\temp.c:1:39: fatal error: mono/metadata/mono-config.h: No such file or direct
[cc stderr] #include <mono/metadata/mono-config.h>
[cc stderr] ^
[cc stderr] compilation terminated.
# Supplemental info (logs, images, videos)
# Test environment (full version information)
Can confirm that the issue exists. Used the same steps to reproduce as in description
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.
Building with deactivating bundling of assemblies into native code works. However the app crashes after a few seconds after showing the splash screen on the device. I don't know if this is connected.
> the app crashes after a few seconds after showing the splash screen on
> the device
For a quick cross-reference possibility, that top-level symptom sounds like it might be Bug 56787. You can check if the device log (`adb logcat`)  from when the app crashes matches the information on Bug 56787 to see if it's the same scenario you're hitting.
## Bookkeeping note
To help tidy up the autocorrect spelling change in Comment 2, tamarin-android/master/b6d2360 refers to:
Thanks for the info but it seems to be a linking error. Logcat produces:
E/AndroidRuntime( 2899): java.lang.UnsatisfiedLinkError: Couldn't load monodroid from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/myapk.apk"],nativeLibraryDirectories=[/data/app-lib/myapk, /system/lib]]]: findLibrary returned null
It even happens when I set linking to "None".
> Couldn't load monodroid from loader
As a preliminary troubleshooting and sanity-check for that issue, you can try manually uninstalling the app from the device, fully cleaning the project (perhaps also manually clearing the bin and obj folders to be extra thorough), and then rebuilding and redeploying the app.
Cleaning the bin/obj did really help, thanks.
As to the original issue reported here:
> [cc stderr] obj\Release\bundles\armeabi\temp.c:1:39: fatal error: mono/metadata/mono-config.h: No such file or direct
The BundleAssemblies project option should no longer result in a build error and again be working as expected in monodroid/d15-2/9dbc4c53.