0

I'm building an application using Xamarin.Forms. It successfully runs on iOS, although, on Android crashes when I try to launch it.

According to the debugging:

  • Builds successfully
  • Deploys successfully
  • Fails when I try to launch

Here is the output from the application:

am start -n "com.xamarin.app/md53ed91cd16174c53d73a3021495ff3392.MainActivity"
Starting: Intent { cmp=com.xamarin.app/md53ed91cd16174c53d73a3021495ff3392.MainActivity }

[libprocessgroup] failed to make and chown /acct/uid_10065: Read-only file system
[Zygote] createProcessGroup failed, kernel missing CONFIG_CGROUP_CPUACCT?
[art] Not late-enabling -Xcheck:jni (already on)
[AndroidRuntime] Shutting down VM
[AndroidRuntime] FATAL EXCEPTION: main
[AndroidRuntime] Process: com.xamarin.app, PID: 3563
[AndroidRuntime] java.lang.RuntimeException: Unable to get provider mono.MonoRuntimeProvider: java.lang.RuntimeException: Unable to find application Mono.Android.Platform.ApiLevel_24 or Xamarin.Android.Platform!
[AndroidRuntime]    at android.app.ActivityThread.installProvider(ActivityThread.java:4967)
[AndroidRuntime]    at android.app.ActivityThread.installContentProviders(ActivityThread.java:4559)
[AndroidRuntime]    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4499)
[AndroidRuntime]    at android.app.ActivityThread.access$1500(ActivityThread.java:144)
[AndroidRuntime]    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339)
[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:5221)
[AndroidRuntime]    at java.lang.reflect.Method.invoke(Native Method)
[AndroidRuntime]    at java.lang.reflect.Method.invoke(Method.java:372)
[AndroidRuntime]    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
[AndroidRuntime]    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
[AndroidRuntime] Caused by: java.lang.RuntimeException: Unable to find application Mono.Android.Platform.ApiLevel_24 or Xamarin.Android.Platform!
[AndroidRuntime]    at mono.MonoRuntimeProvider.attachInfo(MonoRuntimeProvider.java:38)
[AndroidRuntime]    at android.app.ActivityThread.installProvider(ActivityThread.java:4964)
[AndroidRuntime]    ... 11 more
[AndroidRuntime] Caused by: android.content.pm.PackageManager$NameNotFoundException: Xamarin.Android.Platform
[AndroidRuntime]    at android.app.ApplicationPackageManager.getApplicationInfo(ApplicationPackageManager.java:281)
[AndroidRuntime]    at mono.MonoRuntimeProvider.attachInfo(MonoRuntimeProvider.java:32)
[AndroidRuntime]    ... 12 more
[Process] Sending signal. PID: 3563 SIG: 9

Any help would be appreciated!

edit: Here are my current Android configurations

Virtual Device: i.stack.imgur.com/HhY92.png

Manifest: i.stack.imgur.com/VVnuo.png

Target Framework: i.stack.imgur.com/GGePP.png

Ch4osCosmo
  • 13
  • 7
  • http://stackoverflow.com/questions/32470112/xamarin-studio-android-unable-to-create-helloworld-with-latest-and-greatest-pl – pinedax Feb 13 '17 at 00:28
  • I tried that, I changed the target from latest installed framework to Android 5.0 (my emulator is 5.0.1). Although I am now getting target framework is greater than the version for your project – Ch4osCosmo Feb 13 '17 at 00:42
  • Are you using VS or XS? – pinedax Feb 13 '17 at 00:46
  • And what do you have in the [Android Application] tab ? – pinedax Feb 13 '17 at 01:35
  • That's the second link, see 'Manifest' – Ch4osCosmo Feb 13 '17 at 01:39
  • Missed that one.. and the error is still as the beginning: `Unable to find application Mono.Android.Platform.ApiLevel_24` or is `target framework is greater than the version for your project` ? – pinedax Feb 13 '17 at 01:49
  • Yeah, these were the settings that I used from the beginning. I am going to install API 24 to see if that works for some reason... – Ch4osCosmo Feb 13 '17 at 01:57
  • I get the same error unfortunately :( – Ch4osCosmo Feb 13 '17 at 02:09
  • Delete the content of your bin folder on your Android Project. Clean then rebuild. – pinedax Feb 13 '17 at 02:11
  • I get the same problem. Could it be a general setting that I have missed? I.e. not in the Android specific settings? If this helps, I used to get the FastDev directory creation failed error. Although I fixed that this morning. I have never been able to get this to run on Android, only iOS – Ch4osCosmo Feb 13 '17 at 02:18
  • Jus to be clear, when you say "get the same problem" you mean the same from the very beginning? Could you paste the error you are still receiving? – pinedax Feb 13 '17 at 02:23
  • It's exactly the same issue as originally posted. Sorry for not being more specific – Ch4osCosmo Feb 13 '17 at 03:12
  • I just changed the settings in the Android manifest. I changed the Target Android Version from Automatic - Use Target Framework API 24 to Override - Android 5.0 (API 21). This is the same target framework that I had it on to begin with although it is overriding it this time. I am not sure why it works now but it does. Thanks for all your assistance – Ch4osCosmo Feb 13 '17 at 03:27

1 Answers1

0

You can continue compiling your App targeting the latest version but to be able to run it on oldest version you need to set your minimum SDK version.

On Xamarin Studio this can be done from the Android project options going into the Application session.

Xamarin Android Project Settings

This settings says that I am compiling using my latest installed SDK (24) but this app is supported down to version 19 (Android 4.4) which is called KitKat if I am not wrong.

Be aware that if you change the Target Android Version in this session you must also change the target framework in the General and viceversa.

General Settings Xamarin.Android Project

pinedax
  • 9,246
  • 2
  • 23
  • 30
  • Thanks for the help but unfortunately I don't think this solves my issue(s). I edited my original post to include pictures of my manifest. (I have low rep so I couldn't post them as 'links' – Ch4osCosmo Feb 13 '17 at 01:31