Home » Android » Android : Facebook app id showing error in values-ta/strings.xml and can't able to generate signed apk

Android : Facebook app id showing error in values-ta/strings.xml and can't able to generate signed apk

Posted by: admin May 14, 2020 Leave a comment

Questions:

I’m using facebook login in my app. I’ve created facebook app id. If I use facebook app id in values/strings.xml it works fine and I’m able to generate signed apk in android studio. If I use that facebook app id in values-ta/strings.xml and values-de/strings.xml it shows an error and I’m not able to generate apk.

Error: Resources referenced from the manifest cannot vary by configuration (except for version qualifiers, e.g. -v21.) Found variation in ta.

Elements in the manifest can reference resources, but those resources cannot vary across configurations (except as a special case, by version, and except for a few specific package attributes such as the application title and icon.)

Can anyone help me to solve this issue.

Thanks.

How to&Answers:

The solution is we need to add attribute translatable="false" in that particular string resource.

Answer:

in android manifest change to this

    <meta-data
        android:name="com.facebook.sdk.ApplicationId"
        android:value="@string/facebook_app_id"
        tools:ignore="ManifestResource" />

from : https://code.google.com/p/android/issues/detail?id=194705