sbugert / react-native-admob

A react-native component for Google AdMob banners
BSD 2-Clause "Simplified" License
1.13k stars 532 forks source link

Execution failed for task ':app:processDebugResources'. when installing react-native-admob #541

Closed ornakash closed 3 years ago

ornakash commented 3 years ago

Hello,

I am trying to use react-native-admob@2.0.0-beta.6 with the latest version of react-native. First of all, my computer information:

System: OS: Windows 10 10.0.18363 CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz Memory: 1.35 GB / 7.89 GB Binaries: Node: 15.3.0 - C:\Program Files\nodejs\node.EXE Yarn: Not Found npm: 6.14.9 - C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: API Levels: 23, 26, 27, 28, 29 Build Tools: 23.0.1, 28.0.3, 29.0.2, 29.0.3, 30.0.2 System Images: android-23 | ARM EABI v7a, android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom Android NDK: Not Found Windows SDK: AllowAllTrustedApps: Disabled IDEs: Android Studio: Version 3.6.0.0 AI-192.7142.36.36.6392135 Visual Studio: 16.7.30406.217 (Visual Studio Community 2019) Languages: Java: 15.0.1 Python: 3.9.0 npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: 0.63.4 => 0.63.4 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found

Everytime I install react-native-admob I get a error when I try to react-native run-android

Configure project :react-native-whatsapp-stickers WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed soon. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

Task :react-native-admob:compileDebugJavaWithJavac

Task :app:processDebugResources FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings 117 actionable tasks: 22 executed, 95 up-to-date Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:processDebugResources'.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource linking failed C:\Users\Nakash.gradle\caches\transforms-2\files-2.1\23e9bd4ea99c76ba7f1eb83035085b4b\play-services-ads-lite-19.6.0\AndroidManifest.xml:27:5-38:15: AAPT: error: unexpected element found in .

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

BUILD FAILED in 15s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 Note: Some input files use or override a deprecated API.

AndroidManifest.xml has the correct google admob app ID (I used expo-admob with the same and it worked perfectly).

IMPORTNAT - I tried to clean npm cache, gradle cache, re-install the library - none of these worked.

Could you help me solve this?

mohamedHamadaboy commented 3 years ago

same probleme

mahisat commented 3 years ago

This worked for me

In android/app/build.gradle dependencies { implementation(project(":react-native-admob"), { exclude group: "com.google.android.gms" }) }

Refer to this URL https://stackoverflow.com/questions/56668532/execution-failed-for-task-react-native-admobverifyreleaseresources

ornakash commented 3 years ago

This worked for me

In android/app/build.gradle dependencies { implementation(project(":react-native-admob"), { exclude group: "com.google.android.gms" }) }

Refer to this URL https://stackoverflow.com/questions/56668532/execution-failed-for-task-react-native-admobverifyreleaseresources

Thanks for your answer! unfortunately now my app crashes without an error message

mahisat commented 3 years ago

Try gradle clean

On Wed, Dec 9, 2020 at 3:58 AM ornakash notifications@github.com wrote:

This worked for me

In android/app/build.gradle dependencies { implementation(project(":react-native-admob"), { exclude group: "com.google.android.gms" }) }

Refer to this URL https://stackoverflow.com/questions/56668532/execution-failed-for-task-react-native-admobverifyreleaseresources

Thanks for your answer! unfortunately now my app crashes without an error message

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sbugert/react-native-admob/issues/541#issuecomment-741138497, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALTINVH7VUYSGHPNNMSCT3DST2SAVANCNFSM4UPF77TQ .

marcosOrdieres commented 3 years ago

Hi @ornakash I had the same problem as you by adding the solution from @mahisat I solved it by adding implementation "com.google.android.gms:play-services-ads:16.0.0"

As referred to the Stackoverflow URL he placed. so by having in android/app/build.gradle the next works for me:

    implementation(project(":react-native-admob"), {
        exclude group: "com.google.android.gms"
    })

    implementation "com.google.android.gms:play-services-ads:16.0.0"
ornakash commented 3 years ago

Hi @ornakash I had the same problem as you by adding the solution from @mahisat I solved it by adding implementation "com.google.android.gms:play-services-ads:16.0.0"

As referred to the Stackoverflow URL he placed. so by having in android/app/build.gradle the next works for me:

    implementation(project(":react-native-admob"), {
        exclude group: "com.google.android.gms"
    })

    implementation "com.google.android.gms:play-services-ads:16.0.0"

Thank you very much guys, that worked perfectly! @mahisat @marcosOrdieres