【问题标题】:React-native error : is also present at [:@react-native-firebase_admob] AndroidManifest.xml:18:13-29React-native 错误:也存在于 [:@react-native-firebase_admob] AndroidManifest.xml:18:13-29
【发布时间】:2020-08-14 13:17:31
【问题描述】:

安装 react-native-firebase_admob 后,我更改了清单文件的值:

 <application>
   ******
   <meta-data  android:name="com.google.android.gms.ads.APPLICATION_ID"
                android:value="ca-app-pub-4247389872422093~1957443376"/>

然后我得到这个错误:

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : 
           Attribute meta-data#com.google.android.gms.ads.APPLICATION_ID@value
           value=(ca-app-pub-4247389872422023~1957443376)
           from AndroidManifest.xml:30:78-132

is also present at
           [:@react-native-firebase_admob] AndroidManifest.xml:18:13-29
           value=().

Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:30:9-134
to override.

【问题讨论】:

    标签: android firebase react-native admob firebase-admob


    【解决方案1】:

    按照建议去做。

    
    <application>
       ******
    <meta-data  android:name="com.google.android.gms.ads.APPLICATION_ID"
                android:value="ca-app-pub-4247389872422093~1957443376"
                tools:replace="android:value"/>
    

    【讨论】:

    • 我知道了:The prefix "tools" for attribute "tools:replace" associated with an element type "meta-data" is not bound
    • 我在顶部的清单标签中添加了xmlns:tools="http://schemas.android.com/tools" 属性,它起作用了!!
    【解决方案2】:

    这里是修复:

    <manifest ... xmlns:tools="http://schemas.android.com/tools">
        <application>
           ...
           <meta-data  android:name="com.google.android.gms.ads.APPLICATION_ID"
                       android:value="ca-app-pub-4247389872422093~1957443376"
                       tools:replace="android:value"/>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-06-25
      • 1970-01-01
      • 1970-01-01
      • 2023-02-19
      • 1970-01-01
      • 2022-10-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多