react-native-admob: BUILD FAILED react-native-admob:verifyReleaseResources

I get this error on running ./gradlew assembleRelease Error: FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ‘:react-native-admob:verifyReleaseResources’.

com.android.ide.common.process.ProcessException: Failed to execute aapt

package.json "react": "16.5.0", "react-native": "0.57.0", "react-native-admob": "^2.0.0-beta.5",

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15

Most upvoted comments

go to node_module/react-native-admob/android open build.gradle compileSdkVersion 27 buildToolsVersion “27.0.3”

Below solution doesn’t need to change any node_modules. Might be helpful. Add this code below project level build.gradle.

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 27
                buildToolsVersion '27.0.3'
            }
        }
    }
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex') ) {
                details.useVersion "27.1.1"
            }
        }
    }
}

Like @andylah said, we have to update node_module/react-native-admob/android/build.gradle

but in my case I have to update it to

compileSdkVersion 28
buildToolsVersion "28.0.3"

This is the same value like my build.gradle project android

worked with me

subprojects {
  project.configurations.all {
      afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 28
                buildToolsVersion '28.0.3'
            }
        }
    }
  }
}

@andylah Thank you. your solution is working.

This pull request solved that issue for me: https://github.com/sbugert/react-native-admob/pull/354. It’s exactly what @andylah wrote.