question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Load ads crash the app in release mode

See original GitHub issue

Plugin Version

google_mobile_ads: ^0.13.5

Steps to Reproduce

When i run the app in debug mode it run without any problem, but when i run in release mode the crash happen with first ad load and it stop the app.

Notes:

1- i have tried to use test unit-id and my app id, both have the same issue. 2- i have added meta-data in my app manifest correctly.

flutter run --release --verbose
  [  +68 ms] E/AndroidRuntime(23328): FATAL EXCEPTION: main
  [   +2 ms] E/AndroidRuntime(23328): Process: com.araktek.abra, PID: 23328
  [        ] E/AndroidRuntime(23328): java.lang.LinkageError: Method java.lang.Object com.google.android.gms.internal.ads.ro3.zzb()
  overrides final method in class Lcom/google/android/gms/internal/ads/jo3; (declaration of 'com.google.android.gms.internal.ads.ro3'
  appears in /data/app/com.araktek.abra-zJbCG33S15XOP9NIIaF6Pw==/base.apk)
  [   +1 ms] E/AndroidRuntime(23328):     at com.google.android.gms.internal.ads.lv0.zza(Unknown Source:23)
  [        ] E/AndroidRuntime(23328):     at com.google.android.gms.internal.ads.sk2.a(Unknown Source:297)
  [        ] E/AndroidRuntime(23328):     at com.google.android.gms.internal.ads.m82.p0(Unknown Source:75)
  [        ] E/AndroidRuntime(23328):     at com.google.android.gms.internal.ads.m82.L2(Unknown Source:5)
  [        ] E/AndroidRuntime(23328):     at com.google.android.gms.internal.ads.g70.h(Unknown Source:28)
  [        ] E/AndroidRuntime(23328):     at com.google.android.gms.ads.e0.a.b(Unknown Source:29)
  [        ] E/AndroidRuntime(23328):     at io.flutter.plugins.b.f.d(Unknown Source:0)
  [        ] E/AndroidRuntime(23328):     at io.flutter.plugins.b.r.j(Unknown Source:25)
  [        ] E/AndroidRuntime(23328):     at io.flutter.plugins.b.v.j(Unknown Source:822)
  [        ] E/AndroidRuntime(23328):     at d.a.c.a.j$a.a(Unknown Source:17)
  [   +2 ms] E/AndroidRuntime(23328):     at io.flutter.embedding.engine.f.b.e(Unknown Source:49)
  [   +1 ms] E/AndroidRuntime(23328):     at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(Unknown Source:4)
  [        ] E/AndroidRuntime(23328):     at android.os.MessageQueue.nativePollOnce(Native Method)
  [        ] E/AndroidRuntime(23328):     at android.os.MessageQueue.next(MessageQueue.java:363)
  [   +1 ms] E/AndroidRuntime(23328):     at android.os.Looper.loop(Looper.java:173)
  [   +1 ms] E/AndroidRuntime(23328):     at android.app.ActivityThread.main(ActivityThread.java:8178)
  [   +1 ms] E/AndroidRuntime(23328):     at java.lang.reflect.Method.invoke(Native Method)
  [   +1 ms] E/AndroidRuntime(23328):     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
  [        ] E/AndroidRuntime(23328):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
flutter doctor -v
  [√] Flutter (Channel stable, 2.5.2, on Microsoft Windows [Version 10.0.19042.1288], locale en-US)
      • Flutter version 2.5.2 at C:\Src\flutter
      • Upstream repository https://github.com/flutter/flutter.git
      • Framework revision 3595343e20 (5 weeks ago), 2021-09-30 12:58:18 -0700
      • Engine revision 6ac856380f
      • Dart version 2.14.3
  
  [!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
      • Android SDK at C:\Users\mahmo\AppData\Local\Android\sdk
      • Platform android-31, build-tools 29.0.3
      • Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
      • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
      X Android license status unknown.
        Run `flutter doctor --android-licenses` to accept the SDK licenses.
        See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
  
  [√] Chrome - develop for the web
      • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
  
  [!] Visual Studio - develop for Windows (Visual Studio Enterprise 2019 16.10.3)
      • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise
      • Visual Studio Enterprise 2019 version 16.10.31424.327
      • Windows 10 SDK version 10.0.19041.0
      X The current Visual Studio installation is incomplete. Please reinstall Visual Studio.
  
  [√] Android Studio (version 4.1)
      • Android Studio at C:\Program Files\Android\Android Studio1
      • Flutter plugin can be installed from:
         https://plugins.jetbrains.com/plugin/9212-flutter
      • Dart plugin can be installed from:
         https://plugins.jetbrains.com/plugin/6351-dart
      • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
  
  [!] Android Studio (version 4.2)
      • Android Studio at C:\Program Files\Android\Android Studio
      • Flutter plugin can be installed from:
         https://plugins.jetbrains.com/plugin/9212-flutter
      • Dart plugin can be installed from:
         https://plugins.jetbrains.com/plugin/6351-dart
      X Unable to determine bundled Java version.
      • Try updating or re-installing Android Studio.
  
  [√] VS Code, 64-bit edition (version 1.60.0)
      • VS Code at C:\Program Files\Microsoft VS Code
      • Flutter extension version 3.27.0
  
  [√] Connected device (4 available)
      • SNE LX2 (mobile)  • 64X0218B07002965 • android-arm64  • Android 10 (API 29)
      • Windows (desktop) • windows          • windows-x64    • Microsoft Windows [Version 10.0.19042.1288]
      • Chrome (web)      • chrome           • web-javascript • Google Chrome 95.0.4638.69
      • Edge (web)        • edge             • web-javascript • Microsoft Edge 95.0.1020.30
  
  ! Doctor found issues in 3 categories.
android/build.gradle
    buildscript {
        ext.kotlin_version = '1.3.50'
        repositories {
            google()
            jcenter()
      }

      dependencies {
          classpath 'com.google.gms:google-services:4.3.8'
          classpath 'com.android.tools.build:gradle:4.1.0'
          classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
      }
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
      }
  }
  
  rootProject.buildDir = '../build'
  subprojects {
      project.buildDir = "${rootProject.buildDir}/${project.name}"
      project.evaluationDependsOn(':app')
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
android/app/build.gradle
    def localProperties = new Properties()
    def localPropertiesFile = rootProject.file('local.properties')
    if (localPropertiesFile.exists()) {
        localPropertiesFile.withReader('UTF-8') { reader ->
            localProperties.load(reader)
        }
    }
    
    def flutterRoot = localProperties.getProperty('flutter.sdk')
    if (flutterRoot == null) {
        throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
    }
    
    def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
    if (flutterVersionCode == null) {
        flutterVersionCode = '1'
    }
    
    def flutterVersionName = localProperties.getProperty('flutter.versionName')
    if (flutterVersionName == null) {
        flutterVersionName = '1.0'
    }
    
    apply plugin: 'com.android.application'
    apply plugin: 'com.google.gms.google-services'
    apply plugin: 'kotlin-android'
    apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
    
    def keystoreProperties = new Properties()
    def keystorePropertiesFile = rootProject.file('keystore.properties')
    if (keystorePropertiesFile.exists()) {
        keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
    }
    
    android {
        compileSdkVersion 30
    
        sourceSets {
            main.java.srcDirs += 'src/main/kotlin'
        }
    
        lintOptions {
            checkReleaseBuilds false
        }
    
        defaultConfig {
            applicationId "com.araktek.abra"
            minSdkVersion 23
            targetSdkVersion 30
            multiDexEnabled true
            versionCode 5
            versionName "0.3"
        }
        signingConfigs {
            release {
                keyAlias keystoreProperties['keyAlias']
                keyPassword keystoreProperties['keyPassword']
                storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
                storePassword keystoreProperties['storePassword']
            }
        }
        buildTypes {
            release {
                signingConfig signingConfigs.release
            }
        }
    }
    
    flutter {
        source '../..'
    }
    
    dependencies {
        implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
        implementation 'com.google.android.gms:play-services-ads:20.4.0'
        implementation("com.android.support:multidex:2.0.1")
    
    }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:14
  • Comments:17 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
Ali1Ammarcommented, Nov 26, 2021

i talk about mediation in comment above but now i get same error from a diffrent app that i didnt use mediation in , i only upgrade the plugin to version 1

Fatal Exception: java.lang.LinkageError: Method java.lang.Object com.google.android.gms.internal.ads.jo3.zzb() overrides final method in class Lcom/google/android/gms/internal/ads/bo3; (declaration of 'com.google.android.gms.internal.ads.jo3' appears in /data/app/com.iraqify.qabuli-1/base.apk)
       at com.google.android.gms.internal.ads.zzcqd.<init>(zzcqd.java)
       at com.google.android.gms.internal.ads.zzcqc.zza(zzcqc.java)
       at com.google.android.gms.internal.ads.zzexc.zza(zzexc.java)
       at com.google.android.gms.internal.ads.zzelg.zze(zzelg.java)
       at com.google.android.gms.internal.ads.zzelg.zzP(zzelg.java)
       at com.google.android.gms.internal.ads.zzbrw.zza(zzbrw.java)
       at com.google.android.gms.ads.interstitial.InterstitialAd.load(InterstitialAd.java)
       at io.flutter.plugins.googlemobileads.FlutterAdLoader.loadInterstitial(FlutterAdLoader.java)
       at io.flutter.plugins.googlemobileads.FlutterInterstitialAd.load(FlutterInterstitialAd.java)
       at io.flutter.plugins.googlemobileads.GoogleMobileAdsPlugin.onMethodCall(GoogleMobileAdsPlugin.java)
       at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java)
       at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java)
       at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:323)
       at android.os.Looper.loop(Looper.java:136)
       at android.app.ActivityThread.main(ActivityThread.java:6776)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1518)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)

image image

5reactions
Ali1Ammarcommented, Nov 4, 2021

same problem with me , but not everytime , also i couldnt reproduct it locally but i got it from firebase crashlytics (This issue has 337 crash events affecting 83 users) with diffrent device type and android version

firebase crashlytics title

 FlutterBannerAd.java line 58
io.flutter.plugins.googlemobileads.FlutterBannerAd.load

logs

Fatal Exception: java.lang.LinkageError: Method java.lang.Object com.google.android.gms.internal.ads.rn3.zzb() overrides final method in class Lcom/google/android/gms/internal/ads/jn3; (declaration of 'com.google.android.gms.internal.ads.rn3' appears in base.apk)
       at com.google.android.gms.internal.ads.zzcqd.zza(zzcqd.java:44)
       at com.google.android.gms.internal.ads.zzeur.zza(zzeur.java:358)
       at com.google.android.gms.internal.ads.zzejy.zzN(zzejy.java:58)
       at com.google.android.gms.internal.ads.zzejy.zze(zzejy.java:6)
       at com.google.android.gms.internal.ads.zzbhp.zzg(zzbhp.java:203)
       at com.google.android.gms.ads.BaseAdView.loadAd(BaseAdView.java:6)
       at io.flutter.plugins.googlemobileads.FlutterBannerAd.load(FlutterBannerAd.java:58)
       at io.flutter.plugins.googlemobileads.GoogleMobileAdsPlugin.onMethodCall(GoogleMobileAdsPlugin.java:626)
       at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:17)
       at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:49)
       at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:4)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:363)
       at android.os.Looper.loop(Looper.java:176)
       at android.app.ActivityThread.main(ActivityThread.java:8349)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)

it start apperse after i release new update to my app releated stuff in that update i add facebook mediation (but it work fine on my device in release mode ) i update google_mobile_ads from ^0.13.4 to ^0.13.5

Read more comments on GitHub >

github_iconTop Results From Across the Web

AdMob making my app crash in release version - Stack Overflow
i just added AdMob to my app. Everything seem to work well when i debug or install release version of app (HTC m7)....
Read more >
app crashes at launch as release b… | Apple Developer Forums
I have imported ios-charts in my Objective-C project, and running it in debug mode is fine. However, today I tried to archive and...
Read more >
Game Crash After Watching Ads using Unity Advertisements ...
The game crashes after watching an ad using the unity package version 4.0. ... Only load content AFTER initialization (in this example, ...
Read more >
Crashing when switching Debug/Release modes
VS 2017 (15.7.4) is now constantly crashing whenever I change the value in Solution Configuration dropdown (Release to/from Debug).
Read more >
Unity game crash on startup - Carlino Edilizia
You can also look into disabling unnecessary applications from running at your computer startup to free-up system resources.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found