java.lang.RuntimeException: Unable to start activity ComponentInfo{com.vmapps.quotesking/com.vmapps.quotesking.material.QuoteViewActivity}: java.lang.IllegalStateException: The ad size and ad unit ID must be set before loadAd is called.

tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Admob Native Express Ads

    Stack Overflow | 8 months ago | Rajubhai Rathod
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.vmapps.quotesking/com.vmapps.quotesking.material.QuoteViewActivity}: java.lang.IllegalStateException: The ad size and ad unit ID must be set before loadAd is called.

    Root Cause Analysis

    1. java.lang.IllegalStateException

      The ad size and ad unit ID must be set before loadAd is called.

      at com.google.android.gms.ads.internal.client.zzab.zzdg()
    2. com.google.android
      NativeExpressAdView.loadAd
      1. com.google.android.gms.ads.internal.client.zzab.zzdg(Unknown Source)
      2. com.google.android.gms.ads.internal.client.zzab.zza(Unknown Source)
      3. com.google.android.gms.ads.BaseAdView.loadAd(Unknown Source)
      4. com.google.android.gms.ads.NativeExpressAdView.loadAd(Unknown Source)
      4 frames
    3. com.vmapps.quotesking
      QuoteViewActivity.onCreate
      1. com.vmapps.quotesking.material.QuoteViewActivity.onCreate(QuoteViewActivity.java:209)
      1 frame
    4. Android Platform
      ActivityThread.main
      1. android.app.Activity.performCreate(Activity.java:6178)
      2. android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
      3. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2652)
      4. android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2773)
      5. android.app.ActivityThread.access$900(ActivityThread.java:177)
      6. android.app.ActivityThread$H.handleMessage(ActivityThread.java:1434)
      7. android.os.Handler.dispatchMessage(Handler.java:102)
      8. android.os.Looper.loop(Looper.java:135)
      9. android.app.ActivityThread.main(ActivityThread.java:5930)
      9 frames
    5. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:372)
      2 frames
    6. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
      2 frames