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

来源:互联网 发布:亲淘软件下载 编辑:程序博客网 时间:2024/06/10 10:38

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

01-01 22:22:27.922 18772 18772 E AndroidRuntime: FATAL EXCEPTION: main01-01 22:22:27.922 18772 18772 E AndroidRuntime: Process: com.sprd.note, PID: 1877201-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.webview01-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.webview01-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 more01-01 22:22:27.922 18772 18772 E AndroidRuntime: Caused by: android.webkit.WebViewFactory$MissingWebViewPackageException: android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview01-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 more01-01 22:22:27.922 18772 18772 E AndroidRuntime: Caused by: android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview01-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 1
原创粉丝点击