2

Exception:

java.lang.RuntimeException: Unable to start activity ComponentInfo{my.app.package/com.facebook.ads.InterstitialAdActivity}: java.lang.NullPointerException

I saw an Exception with Facebook InterstitialAd Activity in my Android Application.

Do you have any idea for this null pointer ex?

Abhinav Singh Maurya
  • 3,283
  • 8
  • 31
  • 49
anilst
  • 155
  • 1
  • 9
  • Possible duplicate of [What is a Null Pointer Exception, and how do I fix it?](http://stackoverflow.com/questions/218384/what-is-a-null-pointer-exception-and-how-do-i-fix-it) – Orkun Kocyigit Nov 18 '15 at 07:29
  • Nope, it's not same with that question. It's about facebook Ads Activity. It's not my fault. I asked this question maybe anybody solve the same problem. Thx. – anilst Nov 18 '15 at 07:34
  • If you think the Audience Network SDK contains a bug, you can report it to facebook at developers.facebook.com/bugs – derabbink Dec 30 '15 at 16:24

2 Answers2

1

Not enough information for diagnosing the issue. Please provide a code snippet showing how the activity is called. In general, to use the Interstitial Ad, you have to declare the InterstitialAdActivity first in the manifest file:

<application android:label="@string/app_name">

  ...

  <activity android:name="com.facebook.ads.InterstitialAdActivity"
    android:configChanges="keyboardHidden|orientation|screenSize" />
</application>
Jason Chen
  • 208
  • 1
  • 7
0

I had the same. Try updating to a later Audience Network SDK, e.g. 4.9.0, which fixes some issues:

https://developers.facebook.com/docs/android/change-log-4.x

Fixed

  • Fixed bug related to detached surface texture causing
  • IllegalStateException. Fixed bug causing crashes if ad title was null.
Dunc
  • 16,506
  • 6
  • 74
  • 95