Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

微信调起闪退 #549

Open
outofmemory opened this issue Feb 12, 2020 · 4 comments
Open

微信调起闪退 #549

outofmemory opened this issue Feb 12, 2020 · 4 comments

Comments

@outofmemory
Copy link

outofmemory commented Feb 12, 2020

Please read and follow the issue templates:

  1. Bug Report or Documentation Issue or Questions and Help?
    YES
  2. Which react-native-wechat version are you using?
    1.9.12
  3. What platform does your issue occur on? (Android/iOS/Both)
    android
  4. Please provide a clear and concise description of what the bug is as precisely as possible,you can:

Logs from Sentry:

java.lang.NullPointerException: Attempt to invoke interface method 'boolean com.tencent.mm.sdk.openapi.IWXAPI.handleIntent(android.content.Intent, com.tencent.mm.sdk.openapi.IWXAPIEventHandler)' on a null object reference
    at com.theweflex.react.WeChatModule.handleIntent(WeChatModule.java:2)
    at com.xxxx.xxxx.wxapi.WXEntryActivity.onCreate(WXEntryActivity.java:2)
    at android.app.Activity.performCreate(Activity.java:6355)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2440)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2547)
    at android.app.ActivityThread.access$1100(ActivityThread.java:151)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1398)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:157)
    at android.app.ActivityThread.main(ActivityThread.java:5603)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:774)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)

Your Environment

software version
react-native-wechat ^ 1.9.12
react-native ^ 2.0.1
node ^ 12.14.1.
npm or yarn ^ 6.13.7
outofmemory pushed a commit to outofmemory/react-native-wechat that referenced this issue Feb 12, 2020
@chunge66
Copy link

Got the same problem. Any solution?

@outofmemory
Copy link
Author

Got the same problem. Any solution?

b34cd45

@chunge66
Copy link

Got the same problem. Any solution?

b34cd45

Thank you. Add null check seems right.

public static void handleIntent(Intent intent) { for (WeChatModule mod : modules) { if (mod.api != null) { mod.api.handleIntent(intent, mod); } } }

@aoarashi1988
Copy link

Actually , this issue is probably occered when you use functional api without register the app

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

No branches or pull requests

3 participants