Missing class com.facebook.infer.annotation.Nullsafe$Mode (referenced from: com.facebook.ads.NativeAdBase
Asked Answered
A

2

10

I updated my android studio to "Android Studio Dolphin | 2021.3.1" now I have problems in some projects:

Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in "Location Address"

enter image description here

and the missing classes are:

AGPBI: {"kind":"warning","text":"Missing class com.facebook.infer.annotation.Nullsafe$Mode (referenced from: com.facebook.ads.NativeAdBase)\r\nMissing class comMissing class com.facebook.infer.annotation.Nullsafe$Mode (referenced from: com.facebook.ads.NativeAdBase)

Missing class com.facebook.infer.annotation.Nullsafe$Mode (referenced from: com.facebook.ads.NativeAdBase)

Missing class com.facebook.infer.annotation.Nullsafe (referenced from: com.facebook.ads.NativeAdBase)

My Gradle.build file:

    plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services'
}

android {
    compileSdk 32

    defaultConfig {
        applicationId "app_id"
        minSdk 20
        targetSdk 32
        versionCode 4
        versionName "2.1"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        debug {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'),
                    'proguard-rules-debug.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    namespace 'app_id'
}

dependencies {
    implementation 'androidx.appcompat:appcompat:1.5.1'
    implementation 'com.google.android.material:material:1.6.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    //admob
    implementation 'com.google.android.gms:play-services-ads:21.2.0'
    implementation 'com.google.ads.mediation:facebook:6.11.0.1'
    //firebase
    // Import the BoM for the Firebase platform
    implementation platform('com.google.firebase:firebase-bom:30.4.1')
    // Add the dependency for the Analytics library
    // When using the BoM, you don't specify versions in Firebase library dependencies
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.firebase:firebase-inappmessaging-display'
}

Please help me in this problem.

Abridgment answered 26/9, 2022 at 12:24 Comment(0)
L
25

I have solved this problem by adding the following dependencies

implementation 'com.facebook.infer.annotation:infer-annotation:0.18.0'

Hope, it will help.

Logogram answered 7/12, 2022 at 15:19 Comment(3)
It's working, it is really helpful for me.Abridgment
@Rafiqullah Taibzada Ok, good to hear that. Will you please mark it as accepted answer then?Logogram
it's not a solution, there should be just some proguard rules...Assembly
U
6

Solution 1: try to create release then go to yourproject\app\build\outputs\mapping\release\missing_rules.txt.

check the missing_rules.txt and there will be some rules generated by the gradle itself, just copy and include it in the proguard rules pro.

Solution 2: Simply adding this

implementation 'com.facebook.infer.annotation:infer-annotation:0.18.0'

Hope this helps

Underpay answered 10/10, 2023 at 7:39 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.