Android app fail to start after adding admob

后端 未结 4 1556
灰色年华
灰色年华 2020-12-03 16:37

I\'m trying to implement admob in my app, but the app failed to start after I added it.

This is the activity code: http://code.google.com/p/zhuang-dict/source/browse

4条回答
  •  北荒
    北荒 (楼主)
    2020-12-03 17:15

    If you have added Google AdView from the palette and app stopped working.

    Go to "Gradle Scripts" folder in Android Studio Find the build.gradle(Module: app)

    Remove this line from the file end

    implementation 'com.google.android.gms:play-services-ads:18.1.1'

    Save the file and Build the Project again. Everything will work fine again

    dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'com.google.android.gms:play-services-ads:18.1.1'
    }
    

提交回复
热议问题