java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wEgyptianpost/com.wEgyptianpost.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.ads.AdView.loadAd(com.google.android.gms.ads.AdRequest)' on a null object reference

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,

Create an empty public constructor in your code.

Solutions on the web

via Stack Overflow by Mahmoud Ragab
, 10 months ago
Unable to start activity ComponentInfo{com.wEgyptianpost/com.wEgyptianpost.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.ads.AdView.loadAd(com.google.android.gms.ads.AdRequest)' on a null object reference
via Stack Overflow by GBR 33
, 6 months ago
Unable to start activity ComponentInfo{com.****.****/com.****.****.ShareActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.ads.AdView.loadAd(com.google.android.gms.ads.AdRequest)' on a null object reference
via Stack Overflow by Santosh
, 1 year ago
Unable to start activity ComponentInfo{com.santossingh.jokeapp.free/com.santossingh.jokeapp.free.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.ads.AdView.loadAd(com.google.android.gms.ads.AdRequest)' on a null object reference
via Stack Overflow by Squishy47
, 1 year ago
Unable to start activity ComponentInfo{com.example.sam.myfirstapp/com.example.sam.myfirstapp.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.ads.AdView.loadAd(com.google.android.gms.ads.AdRequest)' on a null object reference
via Stack Overflow by Todopinion Eru Kar
, 1 week ago
Unable to start activity ComponentInfo{com.acimutstudios.puzzle/com.acimutstudios.puzzle.MenuActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.ads.AdView.loadAd(com.google.android.gms.ads.AdRequest)' on a null object reference
via GitHub by thedevleon
, 1 year ago
Unable to start activity ComponentInfo{.../...app.IntroActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.FrameLayout.addView(android.view.View)' on a null object reference
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wEgyptianpost/com.wEgyptianpost.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.ads.AdView.loadAd(com.google.android.gms.ads.AdRequest)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)

Users with the same issue

Once, 1 month ago
33 times, 2 months ago
8 times, 2 months ago
468 times, 3 months ago
65 times, 5 months ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.