I tried to integrate express ads into my application. In the express documentation for my own ads, I read that they work best when displayed with an ad size of FULL_WIDTH. I tried to set my ad size to FULL_WIDTH, but it does not work with IllegalStateException:
Caused by: java.lang.IllegalStateException: The ad size and ad unit ID must be set before loadAd is called.
Here is my xml code:
<com.google.android.gms.ads.NativeExpressAdView android:id="@+id/adView" android:layout_width="wrap_content" android:layout_height="wrap_content" ads:adSize="FULL_WIDTH" ads:adUnitId="@string/native_ad_unit"/>
The ad unit is correct, it works with other ad sizes, such as 320x150, etc.
Is there something wrong with my implementation?
Greetings
source share