Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook SDK : 'Apps that target Android API 30+ (Android 11+) cannot call Facebook native apps unless the package visibility needs are declared'

I use the Android Facebook SDK. I get the following message in Logcat:

com.facebook.internal.NativeProtocol: Apps that target Android API 30+ (Android 11+) cannot call Facebook native apps unless the package visibility needs are declared. Please follow https://developers.facebook.com/docs/android/troubleshooting/#faq_267321845055988 to make the declaration.

What does that mean? Do I need to add in the manifest the item mentioned on facebook page mentioned in this error message, that is to say :

<manifest package="com.example.app"> <queries> <provider android:authorities="com.facebook.katana.provider.PlatformProvider" /> </queries> ... </manifest>

Nota: I use no facebook dialog boxes in my app.

Thanks for your help.

like image 470
Regis_AG Avatar asked Jan 30 '26 16:01

Regis_AG


1 Answers

Yes, you absolutely need to add that to your manifest.

Starting with Android 11, an app can no longer see all the other apps installed on a user's device. This is a privacy enhancement. If your app needs to interact with another app (like the Facebook app for login or sharing), you must now explicitly declare this intent in your AndroidManifest.xml.

The warning you see is the Facebook SDK telling you that it can't check for the presence of the native Facebook app. Even if you don't use Facebook dialogs, the SDK performs this check in the background to enable features like Single Sign-On (SSO) and to determine the best way to handle authentication or sharing requests. Without this declaration, these features might fail or fall back to a less seamless web-view experience.

like image 109
Kergst Avatar answered Feb 02 '26 06:02

Kergst