invertase / react-native-google-mobile-ads

React Native Google Mobile Ads enables you to monetize your app with AdMob.
https://docs.page/invertase/react-native-google-mobile-ads
Other
673 stars 135 forks source link

[🐛] Bug Report Title - A manifest file in one of your active artifacts doesn't include the com.google.android.gms.permission.AD_ID permission #639

Closed cjmling closed 4 days ago

cjmling commented 4 days ago

What happened?

When publishing a release on playstore I get this error (check below). I believe that I need to include "com.google.android.gms.permission.AD_ID" in app.json , which I did.

"android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/images/adaptive-icon.png",
        "backgroundColor": "#ffffff"
      },
      "versionCode": 11,
      "package": "app.reppal.download",
      "permissions": [
        "com.google.android.gms.permission.AD_ID"
      ]
    },

I also checked AndroidManifest.xml in build .aab file and saw that it exist

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.gms.permission.AD_ID" />

What I can fix this?

The full error from playstore dashboard

Your advertising ID declaration in Play Console says that your app uses advertising ID. A manifest file in one of your active artifacts doesn't include the com.google.android.gms.permission.AD_ID permission.

If you don't include this permission in your manifest file, your advertising identifier will be zeroed out. This may break your advertising and analytics use cases, and cause loss of revenue. Learn more

You can remove these errors by updating your advertising ID declaration

Apps that target Android 13 (API 33) without the AD_ID permission will have their advertising identifier zeroed out. This may impact advertising and analytics use-cases.

Platforms

Only on Android

React Native Info

react-native seems to be unrecognized command in my pc. I use expo. Not sure what should I do for this.

Are your using Typescript?

package.json

{
  "name": "workout",
  "main": "expo-router/entry",
  "version": "1.1.5",
  "scripts": {
    "type-check": "npx tsc --noEmit",
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "test": "jest --watchAll",
    "dev": "expo start"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "@expo/vector-icons": "^14.0.0",
    "@react-native-async-storage/async-storage": "1.23.1",
    "@react-native-google-signin/google-signin": "^13.0.1",
    "@react-native-picker/picker": "2.7.5",
    "@react-navigation/native": "^6.0.2",
    "@sentry/react-native": "~5.22.0",
    "@supabase/supabase-js": "^2.45.3",
    "@tanstack/react-query": "^5.20.5",
    "axios": "^1.6.7",
    "expo": "~51.0.8",
    "expo-application": "~5.9.1",
    "expo-av": "~14.0.6",
    "expo-build-properties": "~0.12.5",
    "expo-device": "~6.0.2",
    "expo-font": "~12.0.5",
    "expo-image": "~1.12.9",
    "expo-keep-awake": "~13.0.2",
    "expo-linear-gradient": "~13.0.2",
    "expo-linking": "~6.3.1",
    "expo-notifications": "~0.28.14",
    "expo-router": "~3.5.14",
    "expo-splash-screen": "~0.27.4",
    "expo-status-bar": "~1.12.1",
    "expo-system-ui": "~3.0.4",
    "expo-web-browser": "~13.0.3",
    "prop-types": "^15.8.1",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-native": "0.74.1",
    "react-native-gifted-charts": "^1.4.7",
    "react-native-google-mobile-ads": "^14.2.3",
    "react-native-picker-select": "^9.2.0",
    "react-native-reanimated": "~3.10.1",
    "react-native-safe-area-context": "4.10.1",
    "react-native-screens": "3.31.1",
    "react-native-svg": "15.2.0",
    "react-native-url-polyfill": "^2.0.0",
    "react-native-web": "~0.19.6"
  },
  "devDependencies": {
    "@babel/core": "^7.24.0",
    "@types/react": "~18.2.79",
    "jest": "^29.2.1",
    "jest-expo": "~51.0.2",
    "react-test-renderer": "18.2.0",
    "typescript": "^5.1.3"
  },
  "private": true
}

app.json

{
  "expo": {
    "name": "REPPAL",
    "slug": "reppal",
    "version": "1.1.5",
    "orientation": "portrait",
    "icon": "./assets/images/icon.png",
    "scheme": "reppal",
    "userInterfaceStyle": "automatic",
    "splash": {
      "image": "./assets/images/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": false,
      "bundleIdentifier": "app.reppal.download",
      "config": {
        "usesNonExemptEncryption": false
      },
      "buildNumber": "25"
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/images/adaptive-icon.png",
        "backgroundColor": "#ffffff"
      },
      "versionCode": 11,
      "package": "app.reppal.download",
      "permissions": [
        "com.google.android.gms.permission.AD_ID"
      ]
    },
    "web": {
      "bundler": "metro",
      "output": "static",
      "favicon": "./assets/images/favicon.png"
    },
    "plugins": [
      "expo-router",
      "expo-font",
      [
        "@sentry/react-native/expo",
        {
          "organization": "...........",
          "project": "workout"
        }
      ],
      [
        "react-native-google-mobile-ads",
        {
          "androidAppId": "...............",
          "iosAppId": ".................."
        }
      ],
      [
        "expo-build-properties",
        {
          "ios": {
            "useFrameworks": "static"
          }
        }
      ]
    ],
    "react-native-google-mobile-ads": {
      "android_app_id": "..............",
      "ios_app_id": "................."
    },
    "experiments": {
      "typedRoutes": true
    },
    "extra": {
      "router": {
        "origin": false
      },
      "eas": {
        "projectId": "................."
      }
    }
  }
}

ios/Podfile

No response

android/build.gradle

No response

android/app/build.gradle

No response

android/settings.gradle

No response

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="app.reppal.download"
    platformBuildVersionCode="34"
    platformBuildVersionName="14"
    android:compileSdkVersion="34"
    android:compileSdkVersionCodename="14"
    android:versionCode="11"
    android:versionName="1.1.5" >

    <uses-sdk
        android:minSdkVersion="23"
        android:targetSdkVersion="34" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.gms.permission.AD_ID" />
cjmling commented 4 days ago

This error shows up when I'm trying to submit new version. I wonder the error shows here are based on previous release that didn't had the permissions include not on the new version I'm submitting.

mikehardy commented 4 days ago

A manifest file in one of your active artifacts

Make sure there are no active artifacts without it

You indicate clearly in your issue that you have included it, so this is not an issue in this repo and will not result in a change in this repo, thus should not be in our active issue set - it will be a local fix for you + your organization