如何使用gms.location解决运行时错误?

时间:2019-04-12 16:08:17

标签: javascript crash location runtime

我是编码和尝试编写带有通知的地理围栏应用程序的新手。每次运行该应用程序时,都会出现运行时错误。这是我发现的东西。就像我说的那样,我对编码非常陌生,我真的不知道有人需要什么才能理解这个问题。如果还有其他需求,我绝对可以添加。谢谢!

04/12 11:33:32: Launching app
$ adb install-multiple -r -t /Users/hariberzins/Downloads/moe- 
samples-java-moe- 
master/AndroidGeofire/app/build/intermediates/split- 
apk/debug/slices/slice_9.apk /Users/hariberzins/Downloads/moe- 
samples-java-moe- 
master/AndroidGeofire/app/build/intermediates/split- 
apk/debug/slices/slice_8.apk /Users/hariberzins/Downloads/moe- 
samples-java-moe- 
master/AndroidGeofire/app/build/intermediates/split- 
apk/debug/dep/dependencies.apk /Users/hariberzins/Downloads/moe- 
samples-java-moe- 
master/AndroidGeofire/app/build/intermediates/split- 
apk/debug/slices/slice_6.apk /Users/hariberzins/Downloads/moe- 
samples-java-moe- 
master/AndroidGeofire/app/build/intermediates/split- 
apk/debug/slices/slice_1.apk /Users/hariberzins/Downloads/moe- 
samples-java-moe- 
master/AndroidGeofire/app/build/intermediates/split- 
apk/debug/slices/slice_0.apk /Users/hariberzins/Downloads/moe- 
samples-java-moe- 
master/AndroidGeofire/app/build/intermediates/split- 
apk/debug/slices/slice_7.apk /Users/hariberzins/Downloads/moe- 
samples-java-moe- 
master/AndroidGeofire/app/build/intermediates/resources/instant- 
run/debug/resources-debug.apk /Users/hariberzins/Downloads/moe- 
samples-java-moe- 
master/AndroidGeofire/app/build/intermediates/split- 
apk/debug/slices/slice_2.apk /Users/hariberzins/Downloads/moe- 
samples-java-moe- 
master/AndroidGeofire/app/build/intermediates/split- 
apk/debug/slices/slice_5.apk /Users/hariberzins/Downloads/moe- 
samples-java-moe- 
master/AndroidGeofire/app/build/intermediates/split- 
apk/debug/slices/slice_4.apk /Users/hariberzins/Downloads/moe- 
samples-java-moe- 
master/AndroidGeofire/app/build/intermediates/split- 
apk/debug/slices/slice_3.apk /Users/hariberzins/Downloads/moe- 
samples-java-moe- 
master/AndroidGeofire/app/build/intermediates/instant-run- 
apk/debug/app-debug.apk 
Split APKs installed in 1 s 111 ms
$ adb shell am start -n 
"edmt.dev.androidgeofire/edmt.dev.androidgeofire.MapsActivity" - 
a android.intent.action.MAIN -c android.intent.category.LAUNCHER 
-D
Waiting for application to come online: 
edmt.dev.androidgeofire.test | edmt.dev.androidgeofire
Waiting for application to come online: 
edmt.dev.androidgeofire.test | edmt.dev.androidgeofire
Waiting for application to come online: edmt.dev.androidgeofire.test 
| edmt.dev.androidgeofire
Connecting to edmt.dev.androidgeofire
Capturing and displaying logcat messages from application. This 
behavior can be disabled in the "Logcat output" section of the 
"Debugger" settings page.
W/ActivityThread: Application edmt.dev.androidgeofire is waiting for 
the debugger on port 8100...
I/System.out: Sending WAIT chunk
I/System.out: Debugger has connected
I/System.out: waiting for debugger to settle...
Connected to the target VM, address: 'localhost:8663', transport: 
'socket'
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/chatty: uid=10088(edmt.dev.androidgeofire) identical 1 line
I/System.out: waiting for debugger to settle...
I/System.out: debugger has settled (1305)
I/.androidgeofir: The ClassLoaderContext is a special shared 
library.
W/.androidgeofir: JIT profile information will not be recorded: 
profile file does not exits.
I/chatty: uid=10088(edmt.dev.androidgeofire) identical 10 lines
W/.androidgeofir: JIT profile information will not be recorded: 
profile file does not exits.
D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. 
Skipping initialization.
D/FirebaseApp: com.google.firebase.iid.FirebaseInstanceId is not 
linked. Skipping initialization.
D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not 
linked. Skipping initialization.
D/FirebaseApp: com.google.android.gms.measurement.AppMeasurement is 
not linked. Skipping initialization.
I/FirebaseInitProvider: FirebaseApp initialization successful
I/InstantRun: starting instant run server: is main process
W/GooglePlayServicesUtil: Google Play services out of date.  
Requires 13400000 but found 13280022
I/chatty: uid=10088(edmt.dev.androidgeofire) identical 6 lines
W/GooglePlayServicesUtil: Google Play services out of date.  
Requires 13400000 but found 13280022
D/AndroidRuntime: Shutting down VM
D/NetworkSecurityConfig: No Network Security Config specified, using 
platform default
E/AndroidRuntime: FATAL EXCEPTION: main
Process: edmt.dev.androidgeofire, PID: 12319
java.lang.RuntimeException: Unable to start activity

ComponentInfo {edmt.dev.androidgeofire / edmt.dev.androidgeofire.MapsActivity}:java.lang.NullPointerException:尝试调用虚拟方法'com.google.android.gms.location.LocationRequest com.google.android.gms .location.LocationRequest.setInterval(long)'对空对象的引用         在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)         在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)         在android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)         在android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)         在android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)         在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1808)         在android.os.Handler.dispatchMessage(Handler.java:106)         在android.os.Looper.loop(Looper.java:193)         在android.app.ActivityThread.main(ActivityThread.java:6669)         在java.lang.reflect.Method.invoke(本机方法)         在com.android.internal.os.RuntimeInit $ MethodAndArgsCaller.run(RuntimeInit.java:493)         在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)      原因:java.lang.NullPointerException:尝试在空对象引用上调用虚拟方法'com.google.android.gms.location.LocationRequest com.google.android.gms.location.LocationRequest.setInterval(long)'         在edmt.dev.androidgeofire.MapsActivity.createLocationRequest(MapsActivity.java:191)         在edmt.dev.androidgeofire.MapsActivity.setUpLocation(MapsActivity.java:140)         在edmt.dev.androidgeofire.MapsActivity.onCreate(MapsActivity.java:102)         在android.app.Activity.performCreate(Activity.java:7136)         在android.app.Activity.performCreate(Activity.java:7127)         在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)         在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)         在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)         在android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)         在android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)         在android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)         在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1808)         在android.os.Handler.dispatchMessage(Handler.java:106)         在android.os.Looper.loop(Looper.java:193)         在android.app.ActivityThread.main(ActivityThread.java:6669)         在java.lang.reflect.Method.invoke(本机方法)         在com.android.internal.os.RuntimeInit $ MethodAndArgsCaller.run(RuntimeInit.java:493)         在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 与目标VM断开连接,地址:“ localhost:8663”,传输:“ socket”

0 个答案:

没有答案