Why is Google Ads crashing android app only on release version?

Viewed 36

I am building an Android app with Android Studio with Google Ads. The app seems to work well when I build it locally with test ads, but once I generate a released build, Google Ads throws an error in the middle of the app.

Any insight is appreciated, thank you!

Stack trace from production app enter image description here

CountDownActivity.java

public class CountDownActivity extends AppCompatActivity {
   private AdView mBannedAdView;
   ...
   @Override
   protected void onCreate(Bundle savedInstanceState) {
      mBannerAdview = findViewById(R.id.adView_count_down);
      if (mBannerAdview != null) {
         mBannerAdview.loadAd(adRequest);
      }
   }
}

activity_count_down.xml

<RelativeLayout>
    ...
    <ImageView
        android:id="@+id/answerImage"
        android:layout_width="300dp"
        android:layout_height="300dp"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:adjustViewBounds="true"
        android:visibility="invisible"/>

    <com.google.android.gms.ads.AdView
        android:id="@+id/adView_question"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_alignParentTop="false"
        android:layout_alignParentBottom="true"
        ads:adSize="BANNER"
        ads:adUnitId="ca-app-pub-<AD-ID-HERE>"
        />
</RelativeLayout>
0 Answers
Related