Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InMobi SDK causing app:minifyReleaseWithR8 FAILED error with release build #602

Open
muskara opened this issue Dec 11, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@muskara
Copy link

muskara commented Dec 11, 2023

MAX SDK Version

12.1.0

Device/Platform Info

Android 13

Current Behavior

Despite following all the instructions in the documentation, when I define the InMobi module in build.gradle, I cannot get a release build in any way.

When I turn off the minification and shrink properties the build is successful, but I don't want to generate a release build that way.

When I completely remove the InMobi module, there is no issue, but then there is no point in using the Applovin service.

Expected Behavior

No response

How to Reproduce

Build error:

Task :app:minifyReleaseWithR8 FAILED
AGPBI: {"kind":"error","text":"Type kotlin.reflect.jvm.internal.impl.serialization.deserialization.builtins.BuiltInsResourceLoader is defined multiple times:
/Users/XXX/.gradle/caches/transforms-3/1a1af2d5a9862ecf57b256b0fca6afc5/transformed/jetified-kotlin-reflect
1.8.22.jar:
kotlin/reflect/jvm/internal/impl/serialization/deserialization/builtins/BuiltInsResourceLoader.class,
/Users/XXX/.gradle/caches/transforms-3/1a1af2d5a9862ecf57b256b0fca6afc5/transformed/jetified-kotlin-reflect
1.8.22.jar:
META-INF/versions/9/kotlin/reflect/jvm/internal/impl/serialization/deserialization/builtins/BuiltInsResourceLoader.class",
"sources":[{"file":"/Users/XXX/.gradle/caches/transforms-3/1a1af2d5a9862ecf57b256b0fca6afc5/transformed/jetified-kotlin-reflect-1.8.22.jar"}],"tool":"R8"}

app level build.gradle

release {
    signingConfig signingConfigs.release
    
    shrinkResources true
    minifyEnabled true
    proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    
    ndk {
        debugSymbolLevel 'FULL'
        abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64'
    }
}

....

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation platform('com.google.firebase:firebase-bom:32.5.0')
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.android.material:material:1.8.0'

    implementation 'com.applovin:applovin-sdk:12.1.0'
    implementation 'com.applovin.mediation:inmobi-adapter:10.6.2.0'
    implementation 'com.inmobi.monetization:inmobi-ads-kotlin:10.6.2'
    implementation 'com.squareup.picasso:picasso:2.8'
    implementation 'androidx.recyclerview:recyclerview:1.2.0'
}

build.gradle

buildscript {
    ext.kotlin_version = '1.9.20'
    ext {
        compileSdkVersion   = 33
        targetSdkVersion    = 33
        appCompatVersion    = "1.6.1"
    }

    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:7.4.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.4.0'
        classpath 'com.google.firebase:perf-plugin:1.4.2'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'
    }
}

Additional Info

PS: This is a Flutter project but not a Flutter related issue. It is related to Gradle build.

@muskara muskara added the bug Something isn't working label Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant