Forum Xamarin.Android

Can no longer run Android applications using Xamarin 4.2 and Xamarin.Android 4.10.1

davidbarrettdavidbarrett USUniversity ✭✭
edited January 2014 in Xamarin.Android

I can no longer run Xamarin Android applications after recent update(s). The app fails to deploy or crashes immediately upon start. I've tried on multiple emulators (Android SDK emulator and GenyMotion) and existing and brand-new empty projects.

When deploying using fast assembly deployment, I get the following:

Detecting installed packages
Installing application on device
Synchronizing assemblies
Deployment failed because the FastDev assembly directory could not be created.
**Deployment failed. FastDev directory creation failed.

When disabling FastDev, I instead get the following application output (along with a 'XXX has crashed' in the emulator):

[AndroidRuntime] Shutting down VM
[AndroidRuntime] FATAL EXCEPTION: main
[AndroidRuntime] java.lang.RuntimeException: Unable to get provider mono.MonoRuntimeProvider: java.lang.RuntimeException: Unable to find application Mono.Android.DebugRuntime or Mono.Android.Platform.ApiLevel_19!
[AndroidRuntime] at android.app.ActivityThread.installProvider(ActivityThread.java:4882)
[AndroidRuntime] at android.app.ActivityThread.installContentProviders(ActivityThread.java:4485)
[AndroidRuntime] at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4425)
[AndroidRuntime] at android.app.ActivityThread.access$1300(ActivityThread.java:141)
[AndroidRuntime] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
[AndroidRuntime] at android.os.Handler.dispatchMessage(Handler.java:99)
[AndroidRuntime] at android.os.Looper.loop(Looper.java:137)
[AndroidRuntime] at android.app.ActivityThread.main(ActivityThread.java:5103)
[AndroidRuntime] at java.lang.reflect.Method.invokeNative(Native Method)
[AndroidRuntime] at java.lang.reflect.Method.invoke(Method.java:525)
[AndroidRuntime] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
[AndroidRuntime] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
[AndroidRuntime] at dalvik.system.NativeStart.main(Native Method)
[AndroidRuntime] Caused by: java.lang.RuntimeException: Unable to find application Mono.Android.DebugRuntime or Mono.Android.Platform.ApiLevel_19!
[AndroidRuntime] at mono.MonoRuntimeProvider.attachInfo(MonoRuntimeProvider.java:30)
[AndroidRuntime] at android.app.ActivityThread.installProvider(ActivityThread.java:4879)
[AndroidRuntime] ... 12 more
**[AndroidRuntime] Caused by: android.content.pm.PackageManager$NameNotFoundException: Mono.Android.Platform.ApiLevel_19
[AndroidRuntime] at android.app.ApplicationPackageManager.getApplicationInfo(ApplicationPackageManager.java:226)
[AndroidRuntime] at mono.MonoRuntimeProvider.attachInfo(MonoRuntimeProvider.java:22)
[AndroidRuntime] ... 13 more

The project minimum API level is 14 and the target API level is the target framework version, which is listed as 4.3. Interestingly, I do have 4.4 (API 19) SDK installed, and it appears from the stack above that level 19 is being targeted.

What gives?

Posts

  • MamathaKMamathaK USMember ✭✭

    Same Here!!!

  • WhiterockerWhiterocker USMember

    Have you tried to recreate the project as an Android Ice Cream Sandwich project?

  • john82john82 ITMember ✭✭✭

    Same here

  • davidbarrettdavidbarrett USUniversity ✭✭

    I seem to have resolved my problem by downgrading Xamarin.Android to 4.8.3. Follow the instructions at forums.xamarin.com/discussion/10132/howto-install-older-versions-of-xamarin-software#latest.

    For the record, I've only downgraded Xamarin.Android. I'm still running Xamarin Studio 4.2 (I tried with both versions and got the same results -- only Xamarin.Android version mattered).

  • davidbarrettdavidbarrett USUniversity ✭✭

    @Whiterocker, not sure exactly what you mean -- but I did create a new project that had minimum API level 14 and targeted API level 14 (both ICS) and got the same result.

  • JonathanPryorJonathanPryor USXamarin Team Xamurai
    Unable to find application Mono.Android.DebugRuntime or Mono.Android.Platform.ApiLevel_19! 
    

    That's...very strange.

    If you edit your .csproj, is $(AndroidUseLatestPlatformSdk) set, e.g.:

    <AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
    

    If so, please set it to False (or remove it), clean everything (and nuke bin and obj for good measure), and rebuild and reinstall the app. Does that fix things?

    If that fixes things, can you please file a bug at bugzilla.xamarin.com?

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai

    @davidbarrett : that sounds....odd. Could I ask you to log that as a bug at bugzilla.xamarin.com?

  • DaleKingDaleKing USMember

    I reported it to support over the weekend and got no help at all. All support could tell me was what API level 19 meant.

    I was dead in the water for a day and have been limping all week with a version of the tools where the Android layout editor was troublesome and I regularly had to restart Xamarin several times per hour.

  • davidbarrettdavidbarrett USUniversity ✭✭

    @JonathanPryor, I'll give it a whirl. I've already downgraded and have a deadline in a couple more days I need to drive towards, so I'm hesitant to start mucking around beforehand. :)

    In any case, I'll file a bug report.

    Thanks, guys!

  • PaulDawkinsPaulDawkins GBMember ✭✭

    Any idea why with the latest I get

    mandroiderror XA0000: Invalid create-package command:

    No way to test or create package

  • PaulDawkinsPaulDawkins GBMember ✭✭

    Seems it is when you include International codesets

  • DaleKingDaleKing USMember

    I for one can report that setting AndroidUseLatestPlatformSdk to False fixes it.

  • DaleKingDaleKing USMember

    The other way to change the setting without hand editing the .csproj is by opening the options for the project, select build under general, and make sure to pick a specific target framework and not have it set to use latest.

  • davidbarrettdavidbarrett USUniversity ✭✭

    Actually, I tried that, too, and it didn't work (I set the Build Target as 4.0 under the General tab). /shrug

  • JonathanPryorJonathanPryor USXamarin Team Xamurai

    @PaulDawkins: Could you please file a bug and attach a project which reproduces the Invalid create-package command failure? That shouldn't happen.

  • PaulDawkinsPaulDawkins GBMember ✭✭
    edited November 2013

    <MandroidI18n>rare;west</MandroidI18n>

    Mandroid does not like the ; ... when replaced with , it completes correctly?

  • XymeneGamesXymeneGames USMember

    Xamarin.Android 4.10 is simply awful :( Almost all my layouts are seriously destroyed (under VS2010), there is no way to switch to other resolution, strange "Mode" button that does nothing... Thanks for the downgrading instruction.

  • AdamPatridge.4029AdamPatridge.4029 USMember, Beta, University

    I just ran into the same issue after installing KitKat through the SDK manager. It was solved by keeping it from using that SDK with the suggested csproj edit (AndroidUseLatestPlatformSdk and setting target below 4.3). Did a bug ever get filed? I can't seem to find one.

  • davidbarrettdavidbarrett USUniversity ✭✭

    I never did file one. I didn't have the time when it happened as I was trying to get some code out the door. A week or so later (last Thursday?), I downloaded the latest updates (both Android and Xamarin Studio) and it didn't happen again, so I just assumed it was fixed in those builds.

  • JoseAraujoJoseAraujo USMember
    edited November 2013

    I also get the "Unable to find application Mono.Android.DebugRuntime or Mono.Android.Platform.ApiLevel_19!".

    I am in the alpha channel. The funny thing is that if I change my build settings from Target Framework = Use Latest Installed Platform (4.3), to Android 4.3 (Jelly Bean), it works (and it uses API 18, which is the level corresponding to 4.3)... it works.

  • JoseAraujoJoseAraujo USMember

    BTW: this was also causing the Fast Deployment to fail.

  • SteveLarsenSteveLarsen USMember

    Has anybody found a solution to this? All I'm trying to do is run the Hello_World app on my device. Fast deployment off, AndroidUseLatestPlatformSdk false, the app installs and runs on the emulator. FWIW I'm hitting Gingerbread and have everything set to API 10.

  • Did they manage to fix this yet?

  • I think I solved the issue. Open the csproj file and edit the value of from true to false. It worked for me.

  • Omer_TamirOmer_Tamir AUMember, Beta ✭✭

    I found out that running the project using the xamarin studio fix this issue I am doing that every time the error occurs than go back to the VS

  • Update AndroidUseLatestPlatformSdk to False worked for me.

  • Le-royStaines.7824Le-royStaines.7824 NZMember ✭✭✭

    Same problem here. All I did was create a new project and it wouldn't build. Hadn't even touched the new project yet!

    As with others, setting to False worked for me.

  • Hi,

    The problem seems to appear again now.
    I did exactly the same like always to build an apk, but changed the target Android version to 21.
    On some devices it instantly crashes for me with:

    java.lang.RuntimeException: Unable to get provider mono.MonoRuntimeProvider: java.lang.RuntimeException: Unable to find application Mono.Android.Platform.ApiLevel_21 or Xamarin.Android.Platform!
    at android.app.ActivityThread.installProvider(ActivityThread.java:4967)
    at android.app.ActivityThread.installContentProviders(ActivityThread.java:4559)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4499)
    at android.app.ActivityThread.access$1500(ActivityThread.java:144)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5221)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
    Caused by: java.lang.RuntimeException: Unable to find application Mono.Android.Platform.ApiLevel_21 or Xamarin.Android.Platform!
    at mono.MonoRuntimeProvider.attachInfo(MonoRuntimeProvider.java:38)
    at android.app.ActivityThread.installProvider(ActivityThread.java:4964)
    ... 11 more
    Caused by: android.content.pm.PackageManager$NameNotFoundException: Xamarin.Android.Platform
    at android.app.ApplicationPackageManager.getApplicationInfo(ApplicationPackageManager.java:281)
    at mono.MonoRuntimeProvider.attachInfo(MonoRuntimeProvider.java:32)
    ... 12 more
    

    I will now try to set this to FALSE too. Thanks so far!

  • For me, setting it to FALSE was no success :(

  • Hi. Anybody find solution? I've create project and try to compile but it won't. Setting AndroidUseLatestPlatformSdk to false was no success too. Sorry for my bad English :smile:

  • BradGrayBradGray USMember
    edited October 2015

    Started seeing the same error after updating Android SDK. Setting AndroidUseLatestPlatformSdk to False fixed it for me as well.

  • gilbertomacedogilbertomacedo BRMember ✭✭

    @JonathanPryor: man you are the best, thank you for your help!!!!! Your tip fixed my problem (spend 3 hours to find your steps...). Just remove the keys as Jonathan said and it will works like a charm!!!

  • EkoBudiPrasojoEkoBudiPrasojo USMember

    Setting AndroidUseLatestPlatformSdk to False is not work for me.
    it's still cannot build app package :(

  • MMA71MMA71 DKMember, University

    I got the same error (se blow) and the application crashed in the the vm.

    Changing true to false in the project .csproj file lets me run the application in the vm.

    Forwarding debugger port 8842
    Detecting existing process
    [art] Late-enabling -Xcheck:jni
    [AndroidRuntime] Shutting down VM
    [AndroidRuntime] FATAL EXCEPTION: main
    [AndroidRuntime] Process: com.companyname.tipcalculator, PID: 1775
    [AndroidRuntime] java.lang.RuntimeException: Unable to get provider mono.MonoRuntimeProvider: java.lang.RuntimeException: Unable to find application Mono.Android.Platform.ApiLevel_23 or Xamarin.Android.Platform!
    [AndroidRuntime] at android.app.ActivityThread.installProvider(ActivityThread.java:5049)
    [AndroidRuntime] at android.app.ActivityThread.installContentProviders(ActivityThread.java:4641)
    [AndroidRuntime] at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4581)
    [AndroidRuntime] at android.app.ActivityThread.access$1600(ActivityThread.java:152)
    [AndroidRuntime] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1389)
    [AndroidRuntime] at android.os.Handler.dispatchMessage(Handler.java:102)
    [AndroidRuntime] at android.os.Looper.loop(Looper.java:135)
    [AndroidRuntime] at android.app.ActivityThread.main(ActivityThread.java:5301)
    [AndroidRuntime] at java.lang.reflect.Method.invoke(Native Method)
    [AndroidRuntime] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:723)
    [AndroidRuntime] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:613)
    [AndroidRuntime] Caused by: java.lang.RuntimeException: Unable to find application Mono.Android.Platform.ApiLevel_23 or Xamarin.Android.Platform!
    [AndroidRuntime] at mono.MonoRuntimeProvider.attachInfo(MonoRuntimeProvider.java:38)
    [AndroidRuntime] at android.app.ActivityThread.installProvider(ActivityThread.java:5046)
    [AndroidRuntime] ... 10 more
    [AndroidRuntime] Caused by: android.content.pm.PackageManager$NameNotFoundException: Xamarin.Android.Platform
    [AndroidRuntime] at android.app.ApplicationPackageManager.getApplicationInfo(ApplicationPackageManager.java:282)
    [AndroidRuntime] at mono.MonoRuntimeProvider.attachInfo(MonoRuntimeProvider.java:32)
    [AndroidRuntime] ... 11 more
    [Process] Sending signal. PID: 1775 SIG: 9

  • itevitev USMember ✭✭

    I resolved it by disabling "Use Shared Runtime" under project properties -> Android Options

  • MuhsinFatihMuhsinFatih USMember
    edited December 2016

    I had this same issue and fixed it. Also I was unable to use Material UI for the same error and this solution fixed that as well!
    Solution:

  • DipenHansawalaDipenHansawala USMember ✭✭
    edited January 2017

    i am not able to start my developed application on my Samsung SM-T231 (API 19)
    can any one help me on this ?

    (mulidex, proguard, shared run time option enable/disable all not working)
    (i am able to build in other device like one plus, Moto-G. but not in tab(kitkat))

    Forwarding debugger port 8867
    Detecting existing process

    am start -n "com.helsedesign.app/md55c88770d29dee1101249357c798bbb35.SpashScreenActivity"
    Starting: Intent { cmp=com.helsedesign.app/md55c88770d29dee1101249357c798bbb35.SpashScreenActivity }

    [AndroidRuntime] Shutting down VM
    [AndroidRuntime] FATAL EXCEPTION: main
    [AndroidRuntime] Process: com.helsedesign.app, PID: 11200
    [AndroidRuntime] java.lang.RuntimeException: Unable to instantiate application android.support.multidex.MultiDexApplication: java.lang.ClassNotFoundException: Didn't find class "android.support.multidex.MultiDexApplication" on path: DexPathList[[zip file "/data/app/com.helsedesign.app-4.apk"],nativeLibraryDirectories=[/data/app-lib/com.helsedesign.app-4, /vendor/lib, /system/lib]]
    [AndroidRuntime] at android.app.LoadedApk.makeApplication(LoadedApk.java:516)
    [AndroidRuntime] at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4703)
    [AndroidRuntime] at android.app.ActivityThread.access$1600(ActivityThread.java:175)
    [AndroidRuntime] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1368)
    [AndroidRuntime] at android.os.Handler.dispatchMessage(Handler.java:102)
    [AndroidRuntime] at android.os.Looper.loop(Looper.java:146)
    [AndroidRuntime] at android.app.ActivityThread.main(ActivityThread.java:5602)
    [AndroidRuntime] at java.lang.reflect.Method.invokeNative(Native Method)
    [AndroidRuntime] at java.lang.reflect.Method.invoke(Method.java:515)
    [AndroidRuntime] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
    [AndroidRuntime] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
    [AndroidRuntime] at dalvik.system.NativeStart.main(Native Method)
    [AndroidRuntime] Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.multidex.MultiDexApplication" on path: DexPathList[[zip file "/data/app/com.helsedesign.app-4.apk"],nativeLibraryDirectories=[/data/app-lib/com.helsedesign.app-4, /vendor/lib, /system/lib]]
    [AndroidRuntime] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    [AndroidRuntime] at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
    [AndroidRuntime] at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
    [AndroidRuntime] at android.app.Instrumentation.newApplication(Instrumentation.java:981)
    [AndroidRuntime] at android.app.LoadedApk.makeApplication(LoadedApk.java:511)
    [AndroidRuntime] ... 11 more

  • 15mgm1515mgm15 USMember ✭✭✭✭

    @JonathanPryor said:

    Unable to find application Mono.Android.DebugRuntime or Mono.Android.Platform.ApiLevel_19! 
    

    That's...very strange.

    If you edit your .csproj, is $(AndroidUseLatestPlatformSdk) set, e.g.:

    <AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
    

    If so, please set it to False (or remove it), clean everything (and nuke bin and obj for good measure), and rebuild and reinstall the app. Does that fix things?

    If that fixes things, can you please file a bug at bugzilla.xamarin.com?

    Using this helped me, Thanks @JonathanPryor

  • JassimRahmaJassimRahma USMember ✭✭✭✭

    i have the same problem and tried all with no luck..

    Release is working but not Debug

Sign In or Register to comment.