2016-11-19 4 views
0

Ich habe gerade das neue Visual Studio für Mac installiert, aber ich kann die Standard-App nicht auf einem Emulator ausführen. Es ist die "Hallo Welt" -App, die von Visual Studio selbst erstellt wird, wenn Sie ein neues Projekt erstellen. Ich habe versucht, es mit dem mitgelieferten Emulator aber auch Xamarin Android Player zu starten. Für beide Emulatoren erhalte ich jedoch den folgenden Fehler:Probleme beim Ausführen der Standard-Xamarin-App

"Leider App gestoppt hat."

Die Emulatoren funktionieren gut. Es ist nur die App, die Probleme gibt.

Ich fühle mich wie etwas im Manifest oder etwas fehlt. Aber das ist die Standard App. Es sollte funktionieren, oder?

-Code aus der Haupttätigkeit:

using Android.App; 
using Android.Widget; 
using Android.OS; 

namespace Project_App3.Droid 
{ 
    [Activity(Label = "App3", MainLauncher = true, Icon =  "@mipmap/icon")] 
public class MainActivity : Activity 
{ 
    int count = 1; 

    protected override void OnCreate(Bundle savedInstanceState) 
    { 
     base.OnCreate(savedInstanceState); 

     // Set our view from the "main" layout resource 
     SetContentView(Resource.Layout.Main); 

     // Get our button from the layout resource, 
     // and attach an event to it 
     Button button = FindViewById<Button>(Resource.Id.myButton); 

     button.Click += delegate { button.Text = $"{count++} clicks!"; }; 
    } 
} 
} 

Manifest Code:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android"  android:versionCode="1" android:versionName="1.0"  package="com.test.app3"> 
<uses-sdk android:minSdkVersion="15" /> 
<application android:label="App3"> 
</application> 
</manifest> 

Anwendung Ausgang:

[art] Not late-enabling -Xcheck:jni (already on) 
[AndroidRuntime] Shutting down VM 
[AndroidRuntime] FATAL EXCEPTION: main 

[Android Runtime] Prozess: com.test.app3, PID: 5225 [AndroidRuntime] java.lang.RuntimeException: Provider mono.MonoRuntimePro konnte nicht abgerufen werden vider: java.lang.RuntimeException: Anwendung Mono.Android.Platform.ApiLevel_24 oder Xamarin.Android.Platform konnte nicht gefunden werden! [Android Runtime] bei android.app.ActivityThread.installProvider (ActivityThread.java:5156) [Android Runtime] bei android.app.ActivityThread.installContentProviders (ActivityThread.java:4748) [Android Runtime] bei android.app.ActivityThread.handleBindApplication (ActivityThread.java:4688) [AndroidRuntime] bei android.app.ActivityThread.-wrap1 (ActivityThread.java) [AndroidRuntime] bei android.app.ActivityThread $ H.handleMessage (ActivityThread.java:1405) [AndroidRuntime] bei android.os.Handler.dispatchMessage (Handler.java:102) [AndroidRuntime] bei android.os.Looper.loop (Looper.java:148) [AndroidRuntime] bei android.app.ActivityThread.main (ActivityThread.java : 5417) [AndroidRuntime] bei java.lang.reflect.Method.invoke (Nati ve Methode) [AndroidRuntime] bei com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java:726) [AndroidRuntime] bei com.android.internal.os.ZygoteInit.main (ZygoteInit.java: 616) [AndroidRuntime] Verursacht von: java.lang.RuntimeException: Kann keine Anwendung finden Mono.Android.Platform.ApiLevel_24 oder Xamarin.Android.Platform! [Android Runtime] bei mono.MonoRuntimeProvider.attachInfo (MonoRuntimeProvider.java:38) [Android Runtime] bei android.app.ActivityThread.installProvider (ActivityThread.java:5153) [Android Runtime] ... 10 weitere [Android Runtime] Bedingt von: android.content.pm.PackageManager $ NameNotFoundException: Xamarin.Android.Platform [AndroidRuntime] bei android.app.ApplicationPackageManager.getApplicationInfo (ApplicationPackageManager.java304) [AndroidRuntime] bei mono.MonoRuntimeProvider.attachInfo (MonoRuntimeProvider.java : 32) [AndroidRuntime] ... 11 mehr

+0

Natürlich gibt es keine Buildfehler. – Zarif

+0

Sie sollten einen Fehler sehen, wenn dort steht "Leider wurde die App gestoppt." –

+0

Es muss einige Laufzeitfehler geben. Welche API-Ebene ist der Emulator? – Andrius

Antwort

1

Ich fand die Antwort mit Hilfe von Andrius. Ich googeln die Runtime-Ausnahmen und ich fand hier die Lösung: unable to create helloworld

Ich änderte den Zielrahmen Android Eibisch

Verwandte Themen