I'm building my App using "npx eas-cli build --profile development" but it keeps on failing at gradle with the error below, It builds successfully on IOS without any Issue. At first I thought the issue was with my project but when I remove "react-native-google-mobile-ads" it builds successfully without any issue. so it looks like "react-native-google-mobile-ads" is causing the failure. Please am I missing something or Its a general issue? base on this line
"Attribute meta-data#com.google.android.gms.ads.APPLICATION_ID@value value=(ca-app-pub-3940256099942544~3347511713) from AndroidManifest.xml:27:73-127"
in the gradle error,it is showing the id above which is not the Android app id I provided in the app.js
package.json:
"react": "18.2.0",
"react-native": "0.71.7",
"expo": "48.0.0",
"react-native-google-mobile-ads": "^10.3.2",
app.json:
{
"expo":{},
"react-native-google-mobile-ads": {
"android_app_id": "my Admob android app id",
"ios_app_id": "my Admob iOS app id"
}
}
Gradle Error
[stderr] /home/expo/workingdir/build/android/app/src/debug/AndroidManifest.xml:27:73-127 Error:
[stderr] Attribute meta-data#com.google.android.gms.ads.APPLICATION_ID@value value=(ca-app-pub-3940256099942544~3347511713) from AndroidManifest.xml:27:73-127
[stderr] is also present at [:react-native-google-mobile-ads] AndroidManifest.xml:14:13-67 value=(ca-app-pub-7326900831199527~1591451448).
[stderr] Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:27:5-129 to override.
[stderr] /home/expo/workingdir/build/android/app/src/debug/AndroidManifest.xml:28:85-105 Error:
[stderr] Attribute meta-data#com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT@value value=(true) from AndroidManifest.xml:28:85-105
[stderr] is also present at [:react-native-google-mobile-ads] AndroidManifest.xml:17:13-34 value=(false).
[stderr] Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:28:5-107 to override. > Task :expo:generateDebugRFile > Task :react-native-fast-image:generateDebugRFile > Task :react-native-device-info:generateDebugRFile Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings 373 actionable tasks: 373 executed
[stderr] FAILURE: Build completed with 2 failures.
[stderr] 1: Task failed with an exception.
[stderr]
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:processDebugMainManifest'.
[stderr] > Manifest merger failed with multiple errors, see logs
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] 2: Task failed with an exception.
[stderr]
[stderr] * What went wrong:
[stderr] java.lang.StackOverflowError (no error message)
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 4m 23s
I have tried downgrading to different react-native-google-mobile-ads versions but all failed to build too. I have. also tried building with the --clear-cache flag