android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview错误

最近在工作中遇到手机系统在很多情况下报错
信息如下:

01-01 22:22:27.922 18772 18772 E AndroidRuntime: FATAL EXCEPTION: main

01-01 22:22:27.922 18772 18772 E AndroidRuntime: Process: com.sprd.note, PID: 18772

01-01 22:22:27.922 18772 18772 E AndroidRuntime: java.lang.RuntimeException: Unable to resume activity {com.sprd.note/com.sprd.note.NoteEditor}: android.util.AndroidRuntimeException: android.webkit.WebViewFactory$MissingWebViewPackageException: android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3104)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3135)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2482)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.app.ActivityThread.-wrap11(ActivityThread.java)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1345)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:102)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:148)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:5452)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:762)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)

01-01 22:22:27.922 18772 18772 E AndroidRuntime: Caused by: android.util.AndroidRuntimeException: android.webkit.WebViewFactory$MissingWebViewPackageException: android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.webkit.WebViewFactory.getProviderClass(WebViewFactory.java:211)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:158)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.webkit.WebView.getFactory(WebView.java:2285)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.webkit.WebView.findAddress(WebView.java:1691)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.text.util.Linkify.gatherMapLinks(Linkify.java:471)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.text.util.Linkify.addLinksSprd(Linkify.java:618)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.text.util.Linkify.addLinksSprd(Linkify.java:568)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at com.sprd.note.NoteEditor.updateDisplay(NoteEditor.java:217)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at com.sprd.note.NoteEditor.onResume(NoteEditor.java:198)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1261)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.app.Activity.performResume(Activity.java:6327)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3093)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    ... 10 more

01-01 22:22:27.922 18772 18772 E AndroidRuntime: Caused by: android.webkit.WebViewFactory$MissingWebViewPackageException: android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.webkit.WebViewFactory.fetchPackageInfo(WebViewFactory.java:109)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.webkit.WebViewFactory.getProviderClass(WebViewFactory.java:183)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    ... 21 more

01-01 22:22:27.922 18772 18772 E AndroidRuntime: Caused by: android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:140)

01-01 22:22:27.922 18772 18772 E AndroidRuntime:    at android.webkit.WebViewFactory.fetchPackageInfo(WebViewFactory.java:107)

后来发现是gms.mk中去掉webviewGoogle应用的问题

PRODUCT_PACKAGES += \
    AndroidForWork \
    ConfigUpdater \
    GoogleBackupTransport \
    GoogleFeedback \
    GoogleLoginService \
    GoogleOneTimeInitializer \
    GooglePartnerSetup \
    GoogleServicesFramework \
    GoogleCalendarSyncAdapter \
    GoogleContactsSyncAdapter \
    GoogleTTS \
    GmsCore \
    SetupWizard \
    Phonesky \
    WebViewGoogle

添加上WebViewGoogle就ok了。

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值