各位大佬好, onStartCommand里面设置定时器,定时器回调函数里面获取位置信息,可以获取,但是当app exit,的时候,上报空指针。 应该是前台继续服务。APP也有后台服务的权限。 测试了一下,在执行获取权限列表的时候也有同样类似错误,空指针,如下:
21:24:49.694 java.lang.NullPointerException
at uts.sdk.modules.DCloudUniGetAppAuthorizeSetting.IndexKt$getAppAuthorizeSetting$1.invoke(index.kt:39)
at uts.sdk.modules.DCloudUniGetAppAuthorizeSetting.IndexKt$getAppAuthorizeSetting$1.invoke(index.kt:38)
at uts.sdk.modules.hrKeepAlive.IndexKt.getLocationTap(index.kt:218)
at uts.sdk.modules.hrKeepAlive.ForegroundCoreService$onStartCommand$1.invoke(index.kt:78)
at uts.sdk.modules.hrKeepAlive.ForegroundCoreService$onStartCommand$1.invoke(index.kt:77)
at io.dcloud.uts.UTSTimerKt$setInterval$runnableTask$1.invoke(UTSTimer.kt:158)
at io.dcloud.uts.UTSTimerKt$setInterval$runnableTask$1.invoke(UTSTimer.kt:157)
at io.dcloud.uts.UTSTimerKt.setInterval$lambda$3$lambda$2(UTSTimer.kt:164)
at io.dcloud.uts.UTSTimerKt.$r8$lambda$zCuqnEKvpL7ghhy53_Az9Spia6k(Unknown Source:0)
at io.dcloud.uts.UTSTimerKt$$ExternalSyntheticLambda3.run(Unknown Source:2)
at android.os.Handler.handleCallback(Handler.java:955)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loopOnce(Looper.java:206)
at android.os.Looper.loop(Looper.java:296)
at android.app.ActivityThread.main(ActivityThread.java:9024)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:569)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:976)
1***@139.com
- 发布:2024-09-20 22:00
- 更新:2024-09-20 22:00
- 阅读:86
0 个回复