Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

空指针异常 #127

Open
kingkong-li opened this issue Sep 28, 2020 · 2 comments
Open

空指针异常 #127

kingkong-li opened this issue Sep 28, 2020 · 2 comments
Labels
android Only for android bug Something isn't working

Comments

@kingkong-li
Copy link

java.lang.NullPointerException

Attempt to invoke virtual method 'void com.amap.api.location.AMapLocationClient.setLocationOption(com.amap.api.location.AMapLocationClientOption)' on a null object reference

1 cn.qiuxiang.react.geolocation.AMapGeolocationModule.setLocationMode(Unknown Source)

2 java.lang.reflect.Method.invoke(Native Method)
3 com.facebook.react.bridge.JavaMethodWrapper.invoke(Unknown Source)
4 com.facebook.react.bridge.JavaModuleWrapper.invoke(Unknown Source)
5 com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
6 android.os.Handler.handleCallback(Handler.java:751)
7 android.os.Handler.dispatchMessage(Handler.java:95)
8 com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(Unknown Source)
9 android.os.Looper.loop(Looper.java:154)
10 com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(Unknown Source)
11 java.lang.Thread.run(Thread.java:761)

这个问题 我看到是因为没有初始化造成的,但我看这个源码 并没有判null 或者重新初始化,有什么好的解决方案没有

@kingkong-li kingkong-li added android Only for android bug Something isn't working labels Sep 28, 2020
@qiuxiang
Copy link
Owner

什么时候触发的?

@qiuxiang
Copy link
Owner

是没有 init 或没有等待 init 完成才会出现这个错误,这是需要调用者去保证的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Only for android bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants