3

With AdWhirl I got these Exceptions...

I Couldn't found Wrong from my Side...

Could anyone Suggest on this..

FATAL EXCEPTION: main
E/AndroidRuntime(  279): java.lang.NullPointerException
E/AndroidRuntime(  279):    at android.webkit.WebView.requestFocus(WebView.java:6081)
E/AndroidRuntime(  279):    at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1073)
E/AndroidRuntime(  279):    at android.view.ViewGroup.requestFocus(ViewGroup.java:1029)
E/AndroidRuntime(  279):    at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1073)
E/AndroidRuntime(  279):    at android.view.ViewGroup.requestFocus(ViewGroup.java:1029)
E/AndroidRuntime(  279):    at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1073)
E/AndroidRuntime(  279):    at android.view.ViewGroup.requestFocus(ViewGroup.java:1029)
E/AndroidRuntime(  279):    at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1073)
E/AndroidRuntime(  279):    at android.view.ViewGroup.requestFocus(ViewGroup.java:1029)
E/AndroidRuntime(  279):    at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1073)
E/AndroidRuntime(  279):    at android.view.ViewGroup.requestFocus(ViewGroup.java:1029)
E/AndroidRuntime(  279):    at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1073)
E/AndroidRuntime(  279):    at android.view.ViewGroup.requestFocus(ViewGroup.java:1032)
E/AndroidRuntime(  279):    at android.view.View.requestFocus(View.java:3556)
E/AndroidRuntime(  279):    at android.view.View.requestFocus(View.java:3534)
E/AndroidRuntime(  279):    at android.view.ViewRoot.focusableViewAvailable(ViewRoot.java:1611)
E/AndroidRuntime(  279):    at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:451)
E/AndroidRuntime(  279):    at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:451)
E/AndroidRuntime(  279):    at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:451)
E/AndroidRuntime(  279):    at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:451)
E/AndroidRuntime(  279):    at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:451)
E/AndroidRuntime(  279):    at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:451)
E/AndroidRuntime(  279):    at android.view.View.setFlags(View.java:4493)
E/AndroidRuntime(  279):    at android.view.View.setVisibility(View.java:3030)
E/AndroidRuntime(  279):    at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:668)
E/AndroidRuntime(  279):    at android.widget.TabHost.setCurrentTab(TabHost.java:323)
E/AndroidRuntime(  279):    at android.widget.TabHost$2.onTabSelectionChanged(TabHost.java:129)
E/AndroidRuntime(  279):    at android.widget.TabWidget$TabClickListener.onClick(TabWidget.java:453)
E/AndroidRuntime(  279):    at android.view.View.performClick(View.java:2408)
E/AndroidRuntime(  279):    at android.view.View$PerformClick.run(View.java:8816)
E/AndroidRuntime(  279):    at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime(  279):    at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime(  279):    at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(  279):    at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime(  279):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(  279):    at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(  279):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime(  279):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime(  279):    at dalvik.system.NativeStart.main(Native Method)
JOM
  • 8,139
  • 6
  • 78
  • 111
Sabari
  • 51
  • 4

2 Answers2

1

I got the exact same error on my app since I added this code in my main activity:

@Override
    public void onDestroy() {
        if (adView != null) {
            adView.destroy();
        }
        super.onDestroy();
    }

It seems to be an exception coming from the Admob part. In this discussion, Eric Leichtenschlag from the Admob SDK support team explains that the code above can actually be skipped for Android 2.1+:

The call to AdView.destroy() isn't as important if you are running Android 2.1+, as I'm not sure there are any known WebView crashes on Android 2.1+ devices. If not making this call is indeed a workaround to this error, it is your best short term bet. We don't want this to be the long term solution though. The AdView.destroy() call lets us clean up the AdView properly, and it is intended to prevent catch these WebView errors, not cause them.

Yoann Hercouet
  • 17,894
  • 5
  • 58
  • 85
1

This is a bug in Android that seems to be exposed by the AdMob SDK. In my experience it hasn't been deterministic, and has been a pretty rare exception on devices.

Eric Leichtenschlag
  • 8,881
  • 1
  • 28
  • 28
  • Thanks for the quick responses Eric...I'm very glad with your cooperation....Let me advise regarding ths..This issue is came from the Admob?...I was used MillenialMedia also along with them(Admob+Inmobi+MdotM..).. – Sabari Mar 23 '12 at 06:33
  • 1
    It is really a problem with the Android framework. I've seen some instances of this android.webkit.WebView.requestFocus crash happening with people using AdMob directly, which suggests it is not an AdWhirl issue. I'm not sure whether or not this crash happens on other networks. – Eric Leichtenschlag Mar 23 '12 at 16:33
  • Hi guys, did you take a look at this answer? http://stackoverflow.com/questions/6143831/nullpointerexception-on-webview-webview-requestfocus Could help adding "screenOrientation" to the AdMob activity, in the manifest file? – Lisitso Aug 20 '12 at 09:50