MoPub Android SDK - 5K Crashes

android

#1

Hi,

Over the last few months, I’ve seen 5,000 crashes (1,000 over last 30 days) due to one bug in the MoPub Android SDK - “Fatal Exception: android.util.AndroidRuntimeException: android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview”. Full stack trace is below.

Chromium team - responsible for WebView - Suggests that SDKs handle it themselves: https://code.google.com/p/chromium/issues/detail?id=506369#c7

Can this be fixed/caught? Failing silently or with a warning toast would be far superior to crashing the whole app. Thanks!

Joey

Full stack trace:
Fatal Exception: android.util.AndroidRuntimeException: android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview
at android.webkit.WebViewFactory.getFactoryClass(WebViewFactory.java:161)
at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:101)
at android.webkit.WebView.getFactory(WebView.java:2193)
at android.webkit.WebView.ensureProviderCreated(WebView.java:2188)
at android.webkit.WebView.setOverScrollMode(WebView.java:2247)
at android.view.View.(View.java:3788)
at android.view.View.(View.java:3902)
at android.view.ViewGroup.(ViewGroup.java:507)
at android.widget.AbsoluteLayout.(AbsoluteLayout.java:55)
at android.webkit.WebView.(WebView.java:547)
at android.webkit.WebView.(WebView.java:492)
at android.webkit.WebView.(WebView.java:475)
at android.webkit.WebView.(WebView.java:462)
at android.webkit.WebView.(WebView.java:452)
at com.mopub.network.Networking.getUserAgent(SourceFile:132)
at com.mopub.network.Networking.getRequestQueue(SourceFile:61)
at com.mopub.nativeads.ServerPositioningSource.requestPositioningInternal(SourceFile:130)
at com.mopub.nativeads.ServerPositioningSource.loadPositions(SourceFile:123)
at com.mopub.nativeads.MoPubStreamAdPlacer.loadAds(SourceFile:243)
at com.mopub.nativeads.MoPubRecyclerAdapter.loadAds(SourceFile:221)
at myapp.joeykrim.Fragment.onCreateView$469ccb8a(SourceFile:21)
at android.support.v4.app.Fragment.performCreateView$469ccb8a(SourceFile:1962)
at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1067)
at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1248)
at android.support.v4.app.BackStackRecord.run(SourceFile:738)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(SourceFile:1613)
at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(SourceFile:570)
at android.support.v4.app.FragmentStatePagerAdapter.getItem(SourceFile:163)
at android.support.v4.view.ViewPager.populate(SourceFile:1106)
at android.support.v4.view.ViewPager.populate(SourceFile:952)
at android.support.v4.view.ViewPager.onMeasure(SourceFile:1474)
at android.view.View.measure(View.java:18563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5827)
at android.support.design.widget.CoordinatorLayout.onMeasureChild(SourceFile:610)
at android.support.design.widget.CoordinatorLayout.onMeasure(SourceFile:677)
at android.view.View.measure(View.java:18563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5827)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1435)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:721)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:612)
at android.view.View.measure(View.java:18563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5827)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:430)
at android.support.v7.widget.ContentFrameLayout.onMeasure(SourceFile:135)
at android.view.View.measure(View.java:18563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5827)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1435)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:721)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:612)
at android.view.View.measure(View.java:18563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5827)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:430)
at android.view.View.measure(View.java:18563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5827)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1435)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:721)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:612)
at android.view.View.measure(View.java:18563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5827)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:430)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2888)
at android.view.View.measure(View.java:18563)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2250)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1306)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1548)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1191)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6644)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777)
at android.view.Choreographer.doCallbacks(Choreographer.java:590)
at android.view.Choreographer.doFrame(Choreographer.java:560)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5938)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
Caused by android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview
at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:137)
at android.webkit.WebViewFactory.getFactoryClass(WebViewFactory.java:133)
at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:101)
at android.webkit.WebView.getFactory(WebView.java:2193)
at android.webkit.WebView.ensureProviderCreated(WebView.java:2188)
at android.webkit.WebView.setOverScrollMode(WebView.java:2247)
at android.view.View.(View.java:3788)
at android.view.View.(View.java:3902)
at android.view.ViewGroup.(ViewGroup.java:507)
at android.widget.AbsoluteLayout.(AbsoluteLayout.java:55)
at android.webkit.WebView.(WebView.java:547)
at android.webkit.WebView.(WebView.java:492)
at android.webkit.WebView.(WebView.java:475)
at android.webkit.WebView.(WebView.java:462)
at android.webkit.WebView.(WebView.java:452)
at com.mopub.network.Networking.getUserAgent(SourceFile:132)
at com.mopub.network.Networking.getRequestQueue(SourceFile:61)
at com.mopub.nativeads.ServerPositioningSource.requestPositioningInternal(SourceFile:130)
at com.mopub.nativeads.ServerPositioningSource.loadPositions(SourceFile:123)
at com.mopub.nativeads.MoPubStreamAdPlacer.loadAds(SourceFile:243)
at com.mopub.nativeads.MoPubRecyclerAdapter.loadAds(SourceFile:221)
at myapp.joeykrim.Fragment.onCreateView$469ccb8a(SourceFile:21)
at android.support.v4.app.Fragment.performCreateView$469ccb8a(SourceFile:1962)
at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1067)
at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1248)
at android.support.v4.app.BackStackRecord.run(SourceFile:738)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(SourceFile:1613)
at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(SourceFile:570)
at android.support.v4.app.FragmentStatePagerAdapter.getItem(SourceFile:163)
at android.support.v4.view.ViewPager.populate(SourceFile:1106)
at android.support.v4.view.ViewPager.populate(SourceFile:952)
at android.support.v4.view.ViewPager.onMeasure(SourceFile:1474)
at android.view.View.measure(View.java:18563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5827)
at android.support.design.widget.CoordinatorLayout.onMeasureChild(SourceFile:610)
at android.support.design.widget.CoordinatorLayout.onMeasure(SourceFile:677)
at android.view.View.measure(View.java:18563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5827)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1435)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:721)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:612)
at android.view.View.measure(View.java:18563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5827)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:430)
at android.support.v7.widget.ContentFrameLayout.onMeasure(SourceFile:135)
at android.view.View.measure(View.java:18563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5827)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1435)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:721)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:612)
at android.view.View.measure(View.java:18563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5827)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:430)
at android.view.View.measure(View.java:18563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5827)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1435)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:721)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:612)
at android.view.View.measure(View.java:18563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5827)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:430)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2888)
at android.view.View.measure(View.java:18563)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2250)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1306)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1548)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1191)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6644)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777)
at android.view.Choreographer.doCallbacks(Choreographer.java:590)
at android.view.Choreographer.doFrame(Choreographer.java:560)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5938)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)


#2

Here is additional details: https://plus.google.com/+CarlosSolorzanoInstantBits/posts/WWcyXKnbHeA
Is there any update? Is it fixed? Or is it going to be fixed?


#3

I am using mopub-sdk:4.15.0 and having exactly the same issue. Do you have any solution for this ?


#4

@cemcatikkas, this crash was fixed in the 4.16 release of the MoPub SDK. Give that a try, and let us know if you continue seeing this crash.

Vu Chau
MoPub Support


#5

Thank you, I will try and inform you.