有人指出我使用Android设备日志记录(logcat),并从手机运行应用程序,而不是VS.
这样算下来,我得到这样的输出:
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)
所以,这似乎是解决URL的问题。经过一番研究,我发现我需要给应用程序提供INTERNET许可。
您是否在运行时为棉花糖添加了位置权限? –
是的......我做了它不需要任何特别的权限来做一个http post?对? – srecce
您知道吗,您可以将其上传到CLOSED alpha/beta测试版的商店中,以便除了您(和您允许的人)以外没有人能看到它,并查看它是否崩溃。如果是这样,点击**发送错误报告**,你会得到错误的日志! – Vucko