2016-05-31 8 views
1

Ich bin ein Neuling auf Xamarin, so nahm ich die BackgroundlocationDemo Beispiel aus den Tutorials und änderte ein paar Dinge. Im Grunde eine Verbindung zu einer API bei Standortwechsel.App funktioniert gut auf adb debuggen, aber Absturz nach der Bereitstellung apk auf Telefon

Es funktioniert gut mit vs USB-Debugging auf meinem Handy, aber wenn ich die apk bereitstellen, und auf dem gleichen Telefon installieren es stürzt ab (nicht sicher ist, wenn es den Speicherort oder beim Post an die API erhält), ohne Fehler , nur "Anwendung hat aufgehört" Nachricht.

Nicht sicher, wie man das debuggt, oder wo das Problem ist, oder irgendwelche Informationen vom Unfall auf dem Telefon erhalten.

Ich schätze, Sie helfen mir im Voraus, um mir in die richtige Richtung zu zeigen.

+0

hast du die Berechtigung für den Standort zur Laufzeit für Marshmallow hinzugefügt? –

+0

Ja ... Ich habe es getan Benötigen Sie keine spezielle Erlaubnis, um eine http-Post zu machen? Recht? – srecce

+0

Weißt du was, du kannst es hochladen, um den Laden in einem GESCHLOSSENEN Alpha-/Beta-Test zu spielen, damit niemand es dir sehen kann (und Leuten, die du erlaubst) und ob es abstürzt. Wenn dies der Fall ist, klicken Sie auf ** Fehlerbericht senden ** und Sie erhalten ein Protokoll des Fehlers! – Vucko

Antwort

0

Jemand wies mich an, die Android-Geräteprotokollierung (logcat) zu verwenden, und führen Sie die App vom Telefon statt VS.

So tun, dass ich diese Ausgabe bekam:

06-01 00:44:40.431 E/AndroidRuntime(2986): FATAL EXCEPTION: main 
06-01 00:44:40.431 E/AndroidRuntime(2986): Process: Location.Droid, PID: 2986 
06-01 00:44:40.431 E/AndroidRuntime(2986): java.lang.RuntimeException: java.lang.reflect.InvocationTargetException 
06-01 00:44:40.431 E/AndroidRuntime(2986): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) 
06-01 00:44:40.431 E/AndroidRuntime(2986): Caused by: java.lang.reflect.InvocationTargetException 
06-01 00:44:40.431 E/AndroidRuntime(2986): at java.lang.reflect.Method.invoke(Native Method) 
06-01 00:44:40.431 E/AndroidRuntime(2986): at java.lang.reflect.Method.invoke(Method.java:372) 
06-01 00:44:40.431 E/AndroidRuntime(2986): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) 
06-01 00:44:40.431 E/AndroidRuntime(2986): ... 1 more 
06-01 00:44:40.431 E/AndroidRuntime(2986): Caused by: md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable: System.Net.WebException: Error: NameResolutionFailure 
06-01 00:44:40.431 E/AndroidRuntime(2986): at System.Net.WebClient.UploadDataInternal (System.Uri address, System.String method, System.Byte[] data, System.Net.WebRequest& request) [0x000a6] in :0 
06-01 00:44:40.431 E/AndroidRuntime(2986): at System.Net.WebClient.UploadString (System.Uri address, System.String method, System.String data) [0x00054] in :0 
06-01 00:44:40.431 E/AndroidRuntime(2986): at System.Net.WebClient.UploadString (System.String address, System.String data) [0x00019] in :0 
06-01 00:44:40.431 E/AndroidRuntime(2986): at (wrapper remoting-invoke-with-check) System.Net.WebClient:UploadString (string,string) 
06-01 00:44:40.431 E/AndroidRuntime(2986): at Location.Droid.Services.LocationService.OnLocationChanged (Android.Locations.Location location) [0x00157] in :0 
06-01 00:44:40.431 E/AndroidRuntime(2986): at Android.Locations.ILocationListenerInvoker.n_OnLocationChanged_Landroid_location_Location_ (IntPtr jnienv, IntPtr native__this, IntPtr native_location) [0x00011] in :0 
06-01 00:44:40.431 E/AndroidRuntime(2986): at (wrapper dynamic-method) System.Object:cad3edbb-2ed8-4cac-ad94-e74d5e046d4e (intptr,intptr,intptr) 
06-01 00:44:40.431 E/AndroidRuntime(2986): at md5227b9e8295fbee87e0da67869d6e828e.LocationService.n_onLocationChanged(Native Method) 
06-01 00:44:40.431 E/AndroidRuntime(2986): at md5227b9e8295fbee87e0da67869d6e828e.LocationService.onLocationChanged(LocationService.java:68) 
06-01 00:44:40.431 E/AndroidRuntime(2986): at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:281) 
06-01 00:44:40.431 E/AndroidRuntime(2986): at android.location.LocationManager$ListenerTransport.access$000(LocationManager.java:210) 
06-01 00:44:40.431 E/AndroidRuntime(2986): at android.location.LocationManager$ListenerTransport$1.handleMessage(LocationManager.java:226) 
06-01 00:44:40.431 E/AndroidRuntime(2986): at android.os.Handler.dispatchMessage(Handler.java:102) 
06-01 00:44:40.431 E/AndroidRuntime(2986): at android.os.Looper.loop(Looper.java:135) 
06-01 00:44:40.431 E/AndroidRuntime(2986): at android.app.ActivityThread.main(ActivityThread.java:5343) 

So scheint es ein Problem zu lösen Sie die URL zu sein. Nach ein wenig Recherche habe ich herausgefunden, dass ich INTERNET die Erlaubnis für die App geben muss.

Verwandte Themen