Home > database >  No internet permission but the permission is given, when i intilize the admob banner (it give a red
No internet permission but the permission is given, when i intilize the admob banner (it give a red

Time:06-17

I get this missing "Missing permissions required by BaseAdView.loadAd: android.permission.INTERNET" when i copy pasted the meta tags that are needed for the google maps sdk, without them it doesn't show the error. What could be the issue and the fix?

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="*******">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.SmartQ">
        <activity
            android:name=".mapp"
            android:exported="false" />
        <activity
            android:name=".sdkmaps"
            android:exported="false" />
        <activity
            android:name=".map"
            android:exported="false" />
        <!--
             TODO: Before you run your application, you need a Google Maps API key.

             To get one, follow the directions here:

                https://developers.google.com/maps/documentation/android-sdk/get-api-key

             Once you have your API key (it starts with "AIza"), define a new property in your
             project's local.properties file (e.g. MAPS_API_KEY=Aiza...), and replace the
             "YOUR_API_KEY" string in this file with "${MAPS_API_KEY}".
        -->
        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="${MAPS_API_KEY}" />
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <activity
            android:name=".Web_view"
            android:exported="false" />
        <activity
            android:name=".Update1"
            android:exported="false" />
        <activity
            android:name=".MainActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity> <!-- Sample AdMob app ID: ca-app-pub-3940256099942544~3347511713 -->
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="*******" />
    </application>

</manifest>

picture

CodePudding user response:

The problem is that android is unable to resolve ${MAPS_API_KEY}.

The easiest fix is replacing ${MAPS_API_KEY} with real key directly in manifest, something like:

<meta-data
    android:name="com.google.android.geo.API_KEY"
    android:value="AIzaSyBdJ88HN7LTGkHHK5whfaVv8a5ozlx2E_k" />

If you anyway want to store your key in .properties file, follow this answer: How to store maps api key in local.properties and use it in AndroidManifest.xml

  • Related