react-native-admob icon indicating copy to clipboard operation
react-native-admob copied to clipboard

BUILD FAILED react-native-admob:verifyReleaseResources

Open Rushabhshroff opened this issue 8 years ago • 15 comments

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",

Rushabhshroff avatar Sep 23 '18 12:09 Rushabhshroff

I'm also getting the same error. I have the same version for react, react-native and admob. I would like to add that my build.gradle configuration is:

buildToolsVersion = "27.0.3" minSdkVersion = 16 compileSdkVersion = 27 targetSdkVersion = 26 supportLibVersion = "27.1.1"

celest67 avatar Sep 23 '18 19:09 celest67

Check this out https://github.com/facebook/react-native/issues/19239

myrsapp avatar Sep 24 '18 10:09 myrsapp

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

andylah avatar Sep 25 '18 09:09 andylah

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

marhaupe avatar Sep 25 '18 19:09 marhaupe

@andylah solution did it for me. Thank you!

celest67 avatar Sep 29 '18 20:09 celest67

@andylah Your solution work. but i wondering what about "targetSdkVersion 22" Do i need to change to 26 also?

gongsunzan avatar Sep 30 '18 14:09 gongsunzan

@gongsunzan @celest67 Can you please upvote and approve #354 if it works for you too?

marhaupe avatar Sep 30 '18 20:09 marhaupe

i tried the solution from @andylah but than another problem is happening.

../node_modules/react-native-admob/android/build.gradle: Error: All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 27.1.1, 26.1.0. Examples include com.android.support:animated-vector-drawable:27.1.1 and com.android.support:customtabs:26.1.0 [GradleCompatible]

i extended the build.gradle by adding other dependencies.

dependencies {  
    compile 'com.facebook.react:react-native:+'  
    compile 'com.google.android.gms:play-services-ads:+'  
    implementation 'com.android.support:customtabs:27.1.1'  
    implementation 'com.android.support:animated-vector-drawable:27.1.1'  
    implementation 'com.android.support:support-media-compat:27.1.1'  
    implementation 'com.android.support:support-v4:27.1.1'  
}

after this i can build the apk

breakerof avatar Dec 06 '18 12:12 breakerof

@andylah Thank you. your solution is working.

pratig-sonar avatar Jan 28 '19 14:01 pratig-sonar

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"
            }
        }
    }
}

macci10 avatar Mar 07 '19 10:03 macci10

Upgrading buildVersionTools to 28.0.3 solved my issue.

boerkey avatar Mar 07 '19 19:03 boerkey

for me the following worked

compileSdkVersion 28 buildToolsVersion "28.0.3"

abrillo2 avatar Apr 13 '19 09:04 abrillo2

worked with me

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

evansnguyen0104 avatar Apr 26 '19 11:04 evansnguyen0104

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

AOOOOWWW ILOVEDD!!!!!!!!

lfoliveir4 avatar May 03 '19 07:05 lfoliveir4

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

adityajhordan avatar Apr 18 '20 15:04 adityajhordan