您的位置:首页 > 移动开发

Android 5.x浏览器webView或者qqX5崩溃,Resources$NotFoundException:String resource ID #0x2040003

2020-03-05 01:14 1856 查看

Android 5.x浏览器webView或者qqX5崩溃,Resources$NotFoundException:String resource ID #0x2040003

周末客户反馈app中h5页面崩溃,bugly显示

java.lang.RuntimeException:Unable to start activity ComponentInfo{com.gw.huiyou/com.stategrid.ghwapp.module.main.views.GoodsWebActivity}: android.view.InflateException: Binary XML file line #10: Error inflating class net.coming.dev.view.MyX5WebView
2 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
3 ......
4 Caused by:
5 android.content.res.Resources$NotFoundException:String resource ID #0x2040003
6 android.content.res.Resources.getText(Resources.java:338)
7 android.content.res.VivoResources.getText(VivoResources.java:123)
8 android.content.res.Resources.getString(Resources.java:436)
9 com.android.org.chromium.content.browser.ContentViewCore.setContainerView(ContentViewCore.java:694)
10 com.android.org.chromium.content.browser.ContentViewCore.initialize(ContentViewCore.java:618)
11 com.android.org.chromium.android_webview.AwContents.createAndInitializeContentViewCore(AwContents.java:674)
12 com.android.org.chromium.android_webview.AwContents.setNewAwContents(AwContents.java:823)
13 com.android.org.chromium.android_webview.AwContents.<init>(AwContents.java:662)
14 com.android.org.chromium.android_webview.AwContents.<init>(AwContents.java:597)
15 com.android.webview.chromium.WebViewChromium.initForReal(WebViewChromium.java:319)
16 com.android.webview.chromium.WebViewChromium.access$100(WebViewChromium.java:104)
17 com.android.webview.chromium.WebViewChromium$1.run(WebViewChromium.java:271)
18 com.android.webview.chromium.WebViewChromium$WebViewChromiumRunQueue.drainQueue(WebViewChromium.java:131)
19 com.android.webview.chromium.WebViewChromium$WebViewChromiumRunQueue$1.run(WebViewChromium.java:118)
20 com.android.org.chromium.base.ThreadUtils.runOnUiThread(ThreadUtils.java:144)
21 com.android.webview.chromium.WebViewChromium$WebViewChromiumRunQueue.addTask(WebViewChromium.java:115)
22 com.android.webview.chromium.WebViewChromium.init(WebViewChromium.java:268)
23 android.webkit.WebView.<init>(WebView.java:591)
24 android.webkit.WebView.<init>(WebView.java:526)
25 android.webkit.WebView.<init>(WebView.java:509)
26 android.webkit.WebView.<init>(WebView.java:496)
27 com.tencent.smtt.sdk.WebView$a.<init>(Unknown Source)
28 com.tencent.smtt.sdk.WebView.<init>(Unknown Source)
29 com.tencent.smtt.sdk.WebView.<init>(Unknown Source)
30 com.tencent.smtt.sdk.WebView.<init>(Unknown Source)
31 com.tencent.smtt.sdk.WebView.<init>(Unknown Source)
32 net.coming.dev.view.MyX5WebView.<init>(MyX5WebView.java:88)
33 java.lang.reflect.Constructor.newInstance(Native Method)
34 java.lang.reflect.Constructor.newInstance(Constructor.java:288)
35 android.view.LayoutInflater.createView(LayoutInflater.java:607)
36 android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
37 android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
38 android.view.LayoutInflater.inflate(LayoutInflater.java:504)
39 android.view.LayoutInflater.inflate(LayoutInflater.java:414)
40 android.view.LayoutInflater.inflate(LayoutInflater.java:365)
41 androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
42 androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
43 net.coming.dev.ioc.IocBaseActivity.setContentView(IocBaseActivity.java:44)
44 com.stategrid.ghwapp.module.main.views.GoodsWebActivity.initView(GoodsWebActivity.java:107)
45 net.coming.dev.base.BaseMvpActivity.onCreate(BaseMvpActivity.java:72)
46 android.app.Activity.performCreate(Activity.java:6176)
47 android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1115)
48 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2532)
49 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2659)
50 android.app.ActivityThread.access$900(ActivityThread.java:188)
51 android.app.ActivityThread$H.handleMessage(ActivityThread.java:1521)
52 android.os.Handler.dispatchMessage(Handler.java:111)
53 android.os.Looper.loop(Looper.java:194)
54 android.app.ActivityThread.main(ActivityThread.java:5714)
55 java.lang.reflect.Method.invoke(Native Method)
56 java.lang.reflect.Method.invoke(Method.java:372)
57 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:984)
58 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

看到问题貌似不是代码中的,考虑是不是qq x5的问题,换了原生webView依然不见效。百度一圈,虽然找到类似问题,可是并没有解决方案。最后决定用笨方法,代码回滚。根据不同时段webview在Android5.x中的运行情况,定位到迁移androidx后,升级1.1.0出现了问题:

appcompat              : 'androidx.appcompat:appcompat:1.1.0',

当引用1.0.0时正常,原来这一版对webview有更改。为了快速修复问题,先行后退版本。

  • 点赞
  • 收藏
  • 分享
  • 文章举报
zoou2009 发布了1 篇原创文章 · 获赞 0 · 访问量 517 私信 关注
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐