apache / incubator-weex

Apache Weex (Incubating)
https://weex.apache.org
Apache License 2.0
13.77k stars 1.82k forks source link

[Android] onRenderError -1001,degradeToH5|createInstance fail|wx_create_instance_error isJSFrameworkInit==false reInitCount == 1 weex version is 0.28.0 #3190

Open Felix8029 opened 4 years ago

Felix8029 commented 4 years ago

Describe the bug

weex: idle from create instance cache size is 0 weex: onRenderError -1001,degradeToH5|createInstance fail|wx_create_instance_error isJSFrameworkInit==false reInitCount == 1

To Reproduce

image

Environment

Expected behavior

start app and white screen

but in others phone is work,eg:HuaWei aarch64 arm64-v8a

@YorkShen can you give some help?

kxliu1990 commented 4 years ago

Describe the bug

weex: idle from create instance cache size is 0 weex: onRenderError -1001,degradeToH5|createInstance fail|wx_create_instance_error isJSFrameworkInit==false reInitCount == 1

To Reproduce

image

Environment

Expected behavior

start app and white screen

but in others phone is work,eg:HuaWei aarch64 arm64-v8a

@YorkShen can you give some help?

@Felix8029 I have the same problem as you. Have you solved this problem?

XBYoung commented 4 years ago

same bug

voids commented 4 years ago

same bug. My project has a SplashActivity render first screen, it doesn't has weex instance, and it will redirect to MainActivity which has weex instance after several seconds, and it triggers onRenderError very frequently on android 7, maybe the low performance phone leaded. I wrote the code below in onRenderError:

        Log.i(Tag, "WXSDKEngine.isInitialized: " + WXSDKEngine.isInitialized());
        Log.i(Tag, "WXSDKEngine.isSoInitialized: " + WXSDKEngine.isSoInitialized());

while reproduce, isInitialized always false. so, I wrote the code below in SplashActivity:

        new Thread(() -> {
            while (true) {
                try {
                    Thread.sleep(100);
                    if (WXSDKEngine.isInitialized()) {
                        break;
                    }
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            startActivity(new Intent(SplashActivity.this, MainActivity.class));
            finish();
        }).start();

It works! But sometimes it will take about 30+ seconds until MainActivity shows.