Base solution for your next web application
Open Closed

Build Project in Release Mode #5936


User avatar
0
avanekar02 created

Hello

i am building a mobile app, everything works fine in debug mode, when i set the mode to release shows no error but app does not load.

i have added code to send test email. this when tested in release mode from MVC project as startup it runs and send email, when DROID is set as the startup project and start-hostm1 is run the app shows error. please see attached image.

regards

Anwar


10 Answer(s)
  • User Avatar
    0
    alper created
    Support Team

    delete all bin&obj folders and try again.

  • User Avatar
    0
    avanekar02 created

    Tried that but still the problem persists,

    thanks

  • User Avatar
    0
    alper created
    Support Team

    I see that your host runs on development mode. If you want to test your application against release compilation, you can publish an APK. See this document to understand how to release your application. Note that, if you want to check your new feature, use DEBUG mode.

  • User Avatar
    0
    avanekar02 created

    Hi,

    i am still running under vs 2017, it compiles and debugs without error and i can successfully publish it to iis, but the moment it has been set to releasemode. but the error classmate has stopped still occurs.

  • User Avatar
    0
    alper created
    Support Team

    show the exception logs

  • User Avatar
    0
    alper created
    Support Team

    https://docs.microsoft.com/en-us/xamarin/android/deploy-test/debugging/android-debug-log?tabs=windows https://blog.xamarin.com/enhanced-device-logging-in-visual-studio/

  • User Avatar
    0
    alper created
    Support Team

    this seems to be the host log. we need application logs. you can get it from device logs window in Visual Studio.

  • User Avatar
    0
    avanekar02 created

    Error from device log

    Time Device Name Type PID Tag Message 11-14 17:23:06.579 5" KitKat (4.4) XXHDPI Phone Warning 465 ActivityManager Activity destroy timeout for ActivityRecord{a8fba6e8 u0 com.NOOR.Sched.Mobile/md5b1fbf151df79157c2b8e8322a07616d6.SplashActivity t47 f} 11-14 17:23:05.479 5" KitKat (4.4) XXHDPI Phone Error 465 WindowManager Starting window AppWindowToken{a98d7c80 token=Token{a924e7c8 ActivityRecord{a8fba6e8 u0 com.NOOR.Sched.Mobile/md5b1fbf151df79157c2b8e8322a07616d6.SplashActivity t47}}} timed out 11-14 17:22:56.331 5" KitKat (4.4) XXHDPI Phone Warning 687 EGL_emulation eglSurfaceAttrib not implemented 11-14 17:22:55.971 5" KitKat (4.4) XXHDPI Phone Warning 465 ActivityManager Activity pause timeout for ActivityRecord{a8fba6e8 u0 com.NOOR.Sched.Mobile/md5b1fbf151df79157c2b8e8322a07616d6.SplashActivity t47 f} 11-14 17:22:55.467 5" KitKat (4.4) XXHDPI Phone Error 8794 AndroidRuntime java.lang.UnsatisfiedLinkError: Couldn't load monodroid from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.NOOR.Sched.Mobile-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.NOOR.Sched.Mobile-1, /system/lib]]]: findLibrary returned null at java.lang.Runtime.loadLibrary(Runtime.java:358) at java.lang.System.loadLibrary(System.java:526) at mono.MonoPackageManager.LoadApplication(MonoPackageManager.java:34) at mono.MonoRuntimeProvider.attachInfo(MonoRuntimeProvider.java:22) at android.app.ActivityThread.installProvider(ActivityThread.java:4774) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4369) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4309) at android.app.ActivityThread.access$1500(ActivityThread.java:135) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5001) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) at dalvik.system.NativeStart.main(Native Method) Force finishing activity com.NOOR.Sched.Mobile/md5b1fbf151df79157c2b8e8322a07616d6.SplashActivity 11-14 17:22:55.467 5" KitKat (4.4) XXHDPI Phone Error 8794 AndroidRuntime Process: com.NOOR.Sched.Mobile, PID: 8794 11-14 17:22:55.467 5" KitKat (4.4) XXHDPI Phone Error 8794 AndroidRuntime FATAL EXCEPTION: main 11-14 17:22:55.459 5" KitKat (4.4) XXHDPI Phone Warning 8794 dalvikvm threadid=1: thread exiting with uncaught exception (group=0xa8cafb20) 11-14 17:22:55.459 5" KitKat (4.4) XXHDPI Phone Debug 8794 AndroidRuntime Shutting down VM 11-14 17:22:55.451 5" KitKat (4.4) XXHDPI Phone Debug 8775 dalvikvm GC_CONCURRENT freed 96K, 15% free 578K/676K, paused 1ms+0ms, total 1ms 11-14 17:22:55.447 5" KitKat (4.4) XXHDPI Phone Debug 8775 AndroidRuntime Shutting down VM 11-14 17:22:55.435 5" KitKat (4.4) XXHDPI Phone Debug 465 dalvikvm WAIT_FOR_CONCURRENT_GC blocked 6ms 11-14 17:22:55.435 5" KitKat (4.4) XXHDPI Phone Debug 465 dalvikvm WAIT_FOR_CONCURRENT_GC blocked 5ms 11-14 17:22:55.435 5" KitKat (4.4) XXHDPI Phone Debug 465 dalvikvm WAIT_FOR_CONCURRENT_GC blocked 5ms 11-14 17:22:55.435 5" KitKat (4.4) XXHDPI Phone Debug 465 dalvikvm WAIT_FOR_CONCURRENT_GC blocked 9ms 11-14 17:22:55.435 5" KitKat (4.4) XXHDPI Phone Debug 465 dalvikvm GC_CONCURRENT freed <1K, 34% free 18558K/27844K, paused 1ms+1ms, total 12ms 11-14 17:22:55.423 5" KitKat (4.4) XXHDPI Phone Info 465 dalvikvm-heap Grow heap (frag case) to 18.264MB for 8320512-byte allocation 11-14 17:22:55.419 5" KitKat (4.4) XXHDPI Phone Debug 465 dalvikvm GC_FOR_ALLOC freed 8343K, 63% free 10433K/27844K, paused 31ms, total 31ms 11-14 17:22:55.387 5" KitKat (4.4) XXHDPI Phone Debug 8768 dalvikvm GC_CONCURRENT freed 95K, 15% free 576K/676K, paused 0ms+0ms, total 0ms 11-14 17:22:55.383 5" KitKat (4.4) XXHDPI Phone Info 465 ActivityManager Start proc com.NOOR.Sched.Mobile for activity com.NOOR.Sched.Mobile/md5b1fbf151df79157c2b8e8322a07616d6.SplashActivity: pid=8794 uid=10748 gids={50748, 3003, 1028, 1015} 11-14 17:22:55.379 5" KitKat (4.4) XXHDPI Phone Debug 8768 AndroidRuntime Shutting down VM 11-14 17:22:55.355 5" KitKat (4.4) XXHDPI Phone Debug 8775 AndroidRuntime Calling main entry com.android.commands.am.Am 11-14 17:22:55.343 5" KitKat (4.4) XXHDPI Phone Info 465 ActivityManager START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.NOOR.Sched.Mobile/md5b1fbf151df79157c2b8e8322a07616d6.SplashActivity} from pid 8768 11-14 17:22:55.319 5" KitKat (4.4) XXHDPI Phone Debug 8768 AndroidRuntime Calling main entry com.android.commands.am.Am 11-14 17:22:55.315 5" KitKat (4.4) XXHDPI Phone Error 8775 android.os.Debug failed to load memtrack module: -2 11-14 17:22:55.315 5" KitKat (4.4) XXHDPI Phone Error 8775 memtrack Couldn't load memtrack module (No such file or directory) 11-14 17:22:55.279 5" KitKat (4.4) XXHDPI Phone Error 8768 android.os.Debug failed to load memtrack module: -2 11-14 17:22:55.279 5" KitKat (4.4) XXHDPI Phone Error 8768 memtrack Couldn't load memtrack module (No such file or directory) 11-14 17:22:55.243 5" KitKat (4.4) XXHDPI Phone Error 8775 cutils-trace Error opening trace file: No such file or directory (2) 11-14 17:22:55.239 5" KitKat (4.4) XXHDPI Phone Debug 8775 dalvikvm Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods 11-14 17:22:55.223 5" KitKat (4.4) XXHDPI Phone Debug 8775 dalvikvm No JNI_OnLoad found in libnativehelper.so 0x0, skipping init 11-14 17:22:55.223 5" KitKat (4.4) XXHDPI Phone Debug 8775 dalvikvm Added shared lib libnativehelper.so 0x0 11-14 17:22:55.223 5" KitKat (4.4) XXHDPI Phone Debug 8775 dalvikvm Trying to load lib libnativehelper.so 0x0 11-14 17:22:55.223 5" KitKat (4.4) XXHDPI Phone Debug 8775 dalvikvm Added shared lib libjavacore.so 0x0 11-14 17:22:55.211 5" KitKat (4.4) XXHDPI Phone Debug 8775 dalvikvm Trying to load lib libjavacore.so 0x0 11-14 17:22:55.211 5" KitKat (4.4) XXHDPI Phone Debug 8775 AndroidRuntime CheckJNI is OFF 11-14 17:22:55.207 5" KitKat (4.4) XXHDPI Phone Warning 8775 linker libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix. 11-14 17:22:55.207 5" KitKat (4.4) XXHDPI Phone Debug 8775 AndroidRuntime >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<< 11-14 17:22:55.207 5" KitKat (4.4) XXHDPI Phone Debug 8775 AndroidRuntime 11-14 17:22:55.203 5" KitKat (4.4) XXHDPI Phone Debug 8768 dalvikvm Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods 11-14 17:22:55.199 5" KitKat (4.4) XXHDPI Phone Error 8768 cutils-trace Error opening trace file: No such file or directory (2) 11-14 17:22:55.183 5" KitKat (4.4) XXHDPI Phone Debug 8768 dalvikvm No JNI_OnLoad found in libnativehelper.so 0x0, skipping init 11-14 17:22:55.183 5" KitKat (4.4) XXHDPI Phone Debug 8768 dalvikvm Added shared lib libnativehelper.so 0x0 11-14 17:22:55.183 5" KitKat (4.4) XXHDPI Phone Debug 8768 dalvikvm Trying to load lib libnativehelper.so 0x0 11-14 17:22:55.175 5" KitKat (4.4) XXHDPI Phone Debug 8768 dalvikvm Added shared lib libjavacore.so 0x0 11-14 17:22:55.175 5" KitKat (4.4) XXHDPI Phone Debug 8768 dalvikvm Trying to load lib libjavacore.so 0x0 11-14 17:22:55.171 5" KitKat (4.4) XXHDPI Phone Debug 8768 AndroidRuntime CheckJNI is OFF 11-14 17:22:55.163 5" KitKat (4.4) XXHDPI Phone Warning 8768 linker libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix. 11-14 17:22:55.163 5" KitKat (4.4) XXHDPI Phone Debug 8768 AndroidRuntime >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<< 11-14 17:22:55.163 5" KitKat (4.4) XXHDPI Phone Debug 8768 AndroidRuntime 11-14 17:22:54.547 5" KitKat (4.4) XXHDPI Phone Debug 8752 dalvikvm GC_CONCURRENT freed 93K, 15% free 557K/652K, paused 0ms+0ms, total 2ms 11-14 17:22:54.547 5" KitKat (4.4) XXHDPI Phone Info 8752 AndroidRuntime NOTE: attach of thread 'Binder_1' failed 11-14 17:22:54.547 5" KitKat (4.4) XXHDPI Phone Debug 8752 AndroidRuntime Shutting down VM 11-14 17:22:54.543 5" KitKat (4.4) XXHDPI Phone Debug 8752 AndroidRuntime Calling main entry com.android.commands.pm.Pm 11-14 17:22:54.527 5" KitKat (4.4) XXHDPI Phone Error 8752 android.os.Debug failed to load memtrack module: -2 11-14 17:22:54.527 5" KitKat (4.4) XXHDPI Phone Error 8752 memtrack Couldn't load memtrack module (No such file or directory) 11-14 17:22:54.487 5" KitKat (4.4) XXHDPI Phone Debug 8752 dalvikvm Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods 11-14 17:22:54.487 5" KitKat (4.4) XXHDPI Phone Error 8752 cutils-trace Error opening trace file: No such file or directory (2) 11-14 17:22:54.475 5" KitKat (4.4) XXHDPI Phone Debug 8752 dalvikvm No JNI_OnLoad found in libnativehelper.so 0x0, skipping init 11-14 17:22:54.475 5" KitKat (4.4) XXHDPI Phone Debug 8752 dalvikvm Added shared lib libnativehelper.so 0x0 11-14 17:22:54.475 5" KitKat (4.4) XXHDPI Phone Debug 8752 dalvikvm Trying to load lib libnativehelper.so 0x0 11-14 17:22:54.475 5" KitKat (4.4) XXHDPI Phone Debug 8752 dalvikvm Added shared lib libjavacore.so 0x0 11-14 17:22:54.475 5" KitKat (4.4) XXHDPI Phone Debug 8752 dalvikvm Trying to load lib libjavacore.so 0x0 11-14 17:22:54.471 5" KitKat (4.4) XXHDPI Phone Debug 8752 AndroidRuntime CheckJNI is OFF 11-14 17:22:54.467 5" KitKat (4.4) XXHDPI Phone Warning 8752 linker libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix. 11-14 17:22:54.467 5" KitKat (4.4) XXHDPI Phone Debug 8752 AndroidRuntime >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<< 11-14 17:22:54.467 5" KitKat (4.4) XXHDPI Phone Debug 8752 AndroidRuntime

  • User Avatar
    0
    alper created
    Support Team

    it seems to be Xamarin issue. did you configure the linker? https://developer.xamarin.com/de-de/guides/android/deployment,_testing,_and_metrics/publishing/preparing-an-app-for-release/#Configure_the_Linker

    read the doc I sent... and if you are not obliged to run on release mode (apart from AspNet Zero, this is a Xamarin requirement), run your project on Debug. If you want to test your application on release mode. Then publish your application as APK and install to your device.

  • User Avatar
    0
    avanekar02 created

    Thanks

    i resolved it by setting the Use Shared Runtime properties to true in the droid project properties and it worked.

    i found another issue that i added a menu and an icon png in the

    new NavigationMenuItem { Title = L.Localize("Friends"), Icon = "baseline_person_pin_circle_black_24dp.png", ViewType = typeof(FriendsView), RequiredPermissionName = PermissionKey.Friends, }

                        i have added the icon in the shared project/services/ui/assets/baseline_person_pin_circle_black_24dp.png
                        
                        the title is display but the icon does not show, i delete the bin an obj folder and recompiled the project but still does not show.
                        
                        
    

    Thanks Anwar