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

Attempt to invoke virtual method 'void com.reactlibrary.AliyunUploadManager.asyncUpload(com.facebook.react.bridge.ReactContext, java.lang.String, java.lang.String, java.lang.String, com.facebook.react.bridge.ReadableMap, com.facebook.react.bridge.Promise)' on a null object reference #85

Open
wutiange opened this issue Nov 16, 2020 · 2 comments

Comments

@wutiange
Copy link

java.lang.NullPointerException: Attempt to invoke virtual method 'void com.reactlibrary.AliyunUploadManager.asyncUpload(com.facebook.react.bridge.ReactContext, java.lang.String, java.lang.String, java.lang.String, com.facebook.react.bridge.ReadableMap, com.facebook.react.bridge.Promise)' on a null object reference
at com.reactlibrary.RNAliyunOssModule.asyncUpload(RNAliyunOssModule.java:188)
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:371)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:150)
at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:900)
at android.os.Handler.dispatchMessage(Handler.java:103)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:26)
at android.os.Looper.loop(Looper.java:219)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:225)
at java.lang.Thread.run(Thread.java:929)

不知道为啥会出现这个错误,而且还不少。我去看了android 的代码,我觉得AliyunUploadManager不可能为空,我们初始化的代码initWithSecurityToken是在app启动的时候调用的,而且在使用之前都会initWithSecurityToken一下,所以不可能为空。希望哪个帮我解决一下这个问题。这个错误是错误收集帮我收集到的错误。

@wutiange
Copy link
Author

"react": "16.9.0",
"react-native": "0.61.5",
"aliyun-oss-react-native": "^1.0.0-alpha.7",

@newyoung21
Copy link

@wutiange 请问解决了吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants