Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tag <provider> attribute authorities has invalid character '{' in AndroidManifest.xml using Facebook ShareLink

Though I delete the "{}" braces but it still occurs.

<provider
        android:name="com.facebook.FacebookContentProvider" android:authorities="com.facebook.app.FacebookContentProvider{facebook_app_id}"
        android:exported="true" />
like image 517
Shakawat Hossain Avatar asked Apr 15 '15 06:04

Shakawat Hossain


3 Answers

The format shoud be: android:authorities="com.facebook.app.FacebookContentProvider0123456789" , where 012345678 is your Facebook app ID. Use it without the { character. So your provider tag should be:

<provider
android:authorities="com.facebook.app.FacebookContentProvider0123456789"
android:name="com.facebook.FacebookContentProvider"
android:exported="true"/>

However, if you accidently have already used the { character, then you will be most likely facing an Android Studio bug as it is reported here. The problem is that you are trying to edit the wrong manifest. The poped up manifest from Android Studio build message is not the application's manifest.

So simply open your application's manifest and you can edit it without problem.

like image 198
Menelaos Kotsollaris Avatar answered Sep 28 '22 02:09

Menelaos Kotsollaris


I had the same: the IDE re-inserted the curly braces. I cut the part, restarted Android Studio and pasted it. Then it worked.

like image 31
David Avatar answered Sep 28 '22 02:09

David


Replace {facebook_app_id} in the snippet you posted with your Facebook app id.

like image 44
Gokhan Caglar Avatar answered Sep 28 '22 01:09

Gokhan Caglar