Home > Software design >  Namespace "tools" prefix not defined in AndroidManifest.xml (AdMob). How to solve?
Namespace "tools" prefix not defined in AndroidManifest.xml (AdMob). How to solve?

Time:03-09

This file in Plugins/Android/GoogleMobileAdsPlugin.androidlib.

My code:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.google.unity.ads" android:versionName="1.0" android:versionCode="1">
  <application>
    <uses-library android:required="false" android:name="org.apache.http.legacy" />
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
    <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-..." />
    <meta-data android:name="com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT" android:value="true" />
  </application>
</manifest>

Error in this line (this for block collect Advertisement ID; error in IDE):

<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>

Namespace "tools" prefix not defined

Also, I added this line for Android 12:

<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>

CodePudding user response:

You have to declare the namespace within the root tag of the XML File in your case the

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    ...>

CodePudding user response:

xmlns:tools="http://schemas.android.com/tools" 

You lost this

  • Related