Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

Solucionar error Attribute meta-data#com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT@value con la libreria react-native-google-mobile-ads en React Native y Expo

Tiempo de lectura: < 1 minuto

Voy a enseñarte cómo solucionar el error:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
[stderr] /home/expo/workingdir/build/android/app/src/debug/AndroidManifest.xml:21:85-105 Error:
[stderr] Attribute meta-data#com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT@value value=(true) from AndroidManifest.xml:21:85-105
[stderr] is also present at [:react-native-google-mobile-ads] AndroidManifest.xml:19:13-34 value=(false).
[stderr] Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:21:5-107 to override.
> Task :react-native-screens:parseDebugLocalResources
> Task :react-native-share:compileDebugLibraryResources
> Task :react-native-safe-area-context: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
Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.
351 actionable tasks: 351 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 : Attribute meta-data#com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT@value value=(true) from AndroidManifest.xml:21:85-105
[stderr] is also present at [:react-native-google-mobile-ads] AndroidManifest.xml:19:13-34 value=(false).
[stderr] Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:21:5-107 to override.
[stderr] /home/expo/workingdir/build/android/app/src/debug/AndroidManifest.xml:21:85-105 Error: [stderr] Attribute meta-data#com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT@value value=(true) from AndroidManifest.xml:21:85-105 [stderr] is also present at [:react-native-google-mobile-ads] AndroidManifest.xml:19:13-34 value=(false). [stderr] Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:21:5-107 to override. > Task :react-native-screens:parseDebugLocalResources > Task :react-native-share:compileDebugLibraryResources > Task :react-native-safe-area-context: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 Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness. Please consult deprecation warnings for more details. 351 actionable tasks: 351 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 : Attribute meta-data#com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT@value value=(true) from AndroidManifest.xml:21:85-105 [stderr] is also present at [:react-native-google-mobile-ads] AndroidManifest.xml:19:13-34 value=(false). [stderr] Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:21:5-107 to override.
[stderr] /home/expo/workingdir/build/android/app/src/debug/AndroidManifest.xml:21:85-105 Error:

[stderr] 	Attribute meta-data#com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT@value value=(true) from AndroidManifest.xml:21:85-105

[stderr] 	is also present at [:react-native-google-mobile-ads] AndroidManifest.xml:19:13-34 value=(false).

[stderr] 	Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:21:5-107 to override.

> Task :react-native-screens:parseDebugLocalResources

> Task :react-native-share:compileDebugLibraryResources

> Task :react-native-safe-area-context: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

Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.

Please consult deprecation warnings for more details.

351 actionable tasks: 351 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 : Attribute meta-data#com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT@value value=(true) from AndroidManifest.xml:21:85-105

[stderr]   	is also present at [:react-native-google-mobile-ads] AndroidManifest.xml:19:13-34 value=(false).

[stderr]   	Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:21:5-107 to override.

Este error está asociado a la librería de com.google.android.gms.ads.

Para solucionarlo tenemos que ir a nuestro AndroidManifest.xml generado, buscar esta línea:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<meta-data android:name="com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT" android:value="true"/>
<meta-data android:name="com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT" android:value="true"/>
    <meta-data android:name="com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT" android:value="true"/>

Y cambiarla a false:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<meta-data android:name="com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT" android:value="false"/>
<meta-data android:name="com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT" android:value="false"/>
    <meta-data android:name="com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT" android:value="false"/>

Otra forma de solucionarlo es ir a nuestro archivo app.json y añadir esto:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
"react-native-google-mobile-ads": {
"android_app_id": "xxxxxxxxxxxx",
"ios_app_id": "xxxxxxxxxxxxxxx",
"delay_app_measurement_init": true
}
"react-native-google-mobile-ads": { "android_app_id": "xxxxxxxxxxxx", "ios_app_id": "xxxxxxxxxxxxxxx", "delay_app_measurement_init": true }
 "react-native-google-mobile-ads": { 
"android_app_id": "xxxxxxxxxxxx", 
"ios_app_id": "xxxxxxxxxxxxxxx", 
"delay_app_measurement_init": true 
} 
0

Deja un comentario