Bug 47555 - Bundling assemblies into native code ALWAYS causes any application to crash on startup
Summary: Bundling assemblies into native code ALWAYS causes any application to crash o...
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 7.0 (C8)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: dean.ellis
Depends on:
Reported: 2016-11-21 01:47 UTC by Andrey Juk
Modified: 2017-10-13 18:14 UTC (History)
6 users (show)

Tags: XATriaged
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:

Description Andrey Juk 2016-11-21 01:47:13 UTC
Created android blank app. Select release configuration and set flag Bundle assembly into native code. Build and run

Logcat for emulator x86-64 (on real device armeabi-v7a the same logcat):
I/ActivityManager( 1496): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=App1.App1/md5579855c995bdb073d8182511e793544c.MainActivity (has extras)} from uid 10007 on display 0
V/WindowManager( 1496): addAppToken: AppWindowToken{1e2c551c token=Token{1f51ee8f ActivityRecord{251f09ee u0 App1.App1/md5579855c995bdb073d8182511e793544c.MainActivity t55}}} to stack=1 task=55 at 0
W/AudioTrack( 1496): AUDIO_OUTPUT_FLAG_FAST denied by client
V/WindowManager( 1496): Adding window Window{7ef2087 u0 Starting App1.App1} at 3 of 9 (after Window{13595120 u0 com.android.launcher/com.android.launcher2.Launcher})
I/ActivityManager( 1496): Start proc 11489:App1.App1/u0a56 for activity App1.App1/md5579855c995bdb073d8182511e793544c.MainActivity
W/linker  (11489): /data/app/App1.App1-1/lib/x86_64/libmonodroid.so: unused DT entry: type 0x6ffffffe arg 0x56a8
W/linker  (11489): /data/app/App1.App1-1/lib/x86_64/libmonodroid.so: unused DT entry: type 0x6fffffff arg 0x2
I/InputDispatcher( 1496): Dropping event because there is no touchable window at (718, 555).
W/monodroid(11489): Trying to load sgen from: /data/app/App1.App1-1/lib/x86_64/libmonosgen-2.0.so
W/linker  (11489): /data/app/App1.App1-1/lib/x86_64/libmonosgen-2.0.so: unused DT entry: type 0x6ffffffe arg 0x10ff4
W/linker  (11489): /data/app/App1.App1-1/lib/x86_64/libmonosgen-2.0.so: unused DT entry: type 0x6fffffff arg 0x3
F/monodroid(11489): No assemblies found in '(null)' or '<unavailable>'. Assuming this is part of Fast Deployment. Exiting...
I/ActivityManager( 1496): Process App1.App1 (pid 11489) has died


Windows 8.1 x64
Xamarin for VS
SDK Tools 25.2.3
SDK Platform-tools 25
SDK Build-tools 25
Compile using: Latest platform (Android 7.0)
Target version: Use Compile using SDK version
Comment 1 batmaci 2017-02-23 12:59:07 UTC
is there any solution for this please? I have same problem.
Comment 2 Andrey Juk 2017-02-23 14:08:50 UTC
Solution - it is necessary to disable all the x86, x86-64 options on the advanced options page
Comment 3 batmaci 2017-02-23 15:08:33 UTC
I believe that it is related to this problem https://bugzilla.xamarin.com/show_bug.cgi?id=48678

are you talking about supported achitectures? I am supporting only armeabi-v7a and i am still getting this error. If I disable this, what else option do I have? I thought this is a must option to support, is it not correct?
Comment 4 Andrey Juk 2017-02-24 12:41:00 UTC
I use NDK 13b release, work Ok. For SDK is desirable to create a symlink to prevent blanks. My xamarin options:

JDK: C:\Program Files\Java\jdk1.8.0_121
SDK: D:\NewProj\Android\AndroidSDK
NDK: C:\Program Files (x86)\Android\android-ndk-r13b

the JDK is x64;
for SDK used symlink, real path is C:\Program Files (x86)\Android\adt-bundle-windows-x86-20131030\

SDK up to date

Project options:
Compile: Use latest platform (Android 7.0)
Minimum: Android 4.0.3
Target: using SDK version

Note, linker properies: linking "Use SDK Assembly Only"

Is successfully building and archive release application with option "Bundle assembly into native code"
Comment 5 batmaci 2017-02-27 21:19:32 UTC
Hi Andrey,

it looks like that this only occurs using AndroidNDK64. I have already symlink but it doesnt solve the problem. Everything else same for me as you denote.
Comment 6 bbtajo 2017-03-07 11:47:58 UTC
Any update on this? I have same issue.
Comment 7 bbtajo 2017-03-07 13:30:29 UTC
Updating android NDK to 11b solved issue, But My apk size got increased to 33 mb. :(
Comment 8 batmaci 2017-03-07 13:33:37 UTC
why would you update to 11b? i am using 13 already. you find the fix on this link https://bugzilla.xamarin.com/show_bug.cgi?id=48678. For now, I publish it without using this bundle. Xamarin docs says that size will increase anyway but app will be faster. do you see any performance enhancement?
Comment 9 bbtajo 2017-03-07 13:43:07 UTC
downgrading NDK from 13b to 11b solved crash issue but increased apk size. Performance is improved with latest update.
Comment 10 batmaci 2017-03-07 13:46:46 UTC
latest update of Xamarin forms? which version do you use? I think that you can use 13b version but not 64 bit version. problem looks like only for 64bit version
Comment 11 bbtajo 2017-03-08 05:46:06 UTC
No I checked in 64 bit and 32 bit. Problem still exist.
Comment 12 Marco Rinaldi 2017-03-22 11:10:41 UTC
I confirm that there is a bug with the NDK version 13b.
Downgrading to 11c it works (64 bit in my case).
I will try with 14b.
Comment 13 Jon Douglas [MSFT] 2017-07-07 16:05:03 UTC
Based on the reproduction steps in https://bugzilla.xamarin.com/show_bug.cgi?id=47555#c0

Can I get some confirmation as to what exact architecture this is failing on for individuals CC'd on this bug? Please include the architecture that is included in your project's supported architectures, and also the architecture of the device/emulator you are using.

Secondly, please include the version of NDK you are using so we have some concrete information regarding what scenarios work and do not work. Make sure to update to the latest NDK offered via the payloads Xamarin provides.

Thus marking this issue as NEEDINFO until we have a reliable way to reproduce this issue.
Comment 14 Jon Douglas [MSFT] 2017-10-13 18:14:46 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!