I just setup facebook SDK in my Flutter app using the facebook_app_events plugin, following the official facebook guide for both Android and IOS. I continued to release the app and I encountered this error in Google Play Console:
I tried to resolve this by adding the following codes to the AndroidManifest.xml
:
I added: <uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
between the <manifest> ... </manifest> tag
And I added xmlns:tools="http://schemas.android.com/tools"
inside the <manifest ...>
tag
(Note that I also tried without the tools:node"remove"
)
Full AndroidManifest.xml
code as follows:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.cartier.workshop">
<application android:usesCleartextTraffic="true" android:label="Driwego" android:name="${applicationName}" android:icon="@mipmap/launcher_icon">
<activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme" />
<meta-data
android:name="firebase_messaging_auto_init_enabled"
android:value="false" />
<meta-data
android:name="firebase_analytics_collection_enabled"
android:value="false" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"/>
<data android:host="myapps.driwego.com"/>
<data android:pathPrefix="/redirect"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data android:name="flutterEmbedding" android:value="2" />
<meta-data android:name="com.google.android.geo.API_KEY" android:value="AIzaSyBNh7_pPu1ni8jKLWK-ecY26v3fCGwcgf8" />
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
<meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token"/>
</application>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
</manifest>
Note that the error in Google Play Console only appears when I mark my app is using advertising ID (which I'm unsure of) in the app content declaration:
I would like to know if I should mark "app is using advertising ID" on or off. If it's on, then how should I resolve this issue?