Skip to content
This repository has been archived by the owner on Jun 6, 2019. It is now read-only.

Weex Android异常:java.lang.NullPointerException: NullPointerException in DoInvoke because of null receiver #226

Open
zhiaizhenlan opened this issue Jul 2, 2018 · 2 comments

Comments

@zhiaizhenlan
Copy link

在我们的App中,有一个通用的activity来承载weex页面,已经上线了一些weex的页面,近期从bugly
观察看,部分机型报出了标题中的崩溃,(我们自己测试的时候没有测出来这样的问题,业务正常)

具体,在activity onCreate中:

//初始化weex
InitConfig config = new InitConfig.Builder().setImgAdapter(new ImageAdapter()).build();
WXSDKEngine.initialize(Global.getInstance(), config);
try {
WXSDKEngine.registerModule("GetSizeModule", GetSizeModule.class);
WXSDKEngine.registerModule("RequestModule",RequestModule.class);
WXSDKEngine.registerModule("WebJumpModule",WebJumpModule.class);
WXSDKEngine.registerModule("WeexCommonModule",WeexCommonModule.class);
WXSDKEngine.registerComponent("richtextforroaming", RichTextForRoaming.class);
WXSDKEngine.registerComponent("ApngImageView", ApngImageView.class);
} catch (WXException e) {
e.printStackTrace();
}
mWXSDKInstance = new WXSDKInstance(WeexCommonActivity.this);
mWXSDKInstance.registerRenderListener(this);
mBundleUrl='xxxx'; //我们的js bundle
mWXSDKInstance.renderByUrl("smart service", mBundleUrl, null, null, WXRenderStrategy.APPEND_ASYNC);

环境为weex sdk 0.10.0, weex-builder:v0.2.6 weexpack:v1.1.5

详细错误日志如下(隐去App的包名):

java.lang.RuntimeException:Unable to start activity ComponentInfo{xx/xx.activity.WeexCommonActivity}: java.lang.NullPointerException: NullPointerException in DoInvoke because of null receiver

2 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2758)
3 ......
4 Caused by:
5 java.lang.NullPointerException:NullPointerException in DoInvoke because of null receiver
6 xx.activity.WeexCommonActivity.onCreate(Native Method)
7 android.app.Activity.performCreate(Activity.java:6875)
8 android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
9 com.didi.virtualapk.internal.VAInstrumentation.callActivityOnCreate(VAInstrumentation.java)
10 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2711)
11 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2819)
12 android.app.ActivityThread.-wrap12(ActivityThread.java)
13 android.app.ActivityThread$H.handleMessage(ActivityThread.java:1558)
14 android.os.Handler.dispatchMessage(Handler.java:102)
15 android.os.Looper.loop(Looper.java:163)
16 android.app.ActivityThread.main(ActivityThread.java:6396)
17 java.lang.reflect.Method.invoke(Native Method)
18 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
19 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)

Any idea?

@JerryJson
Copy link

这个问题你们解决了吗

@wudouxingjun
Copy link

我们的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