Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio + Gradle: define resValue without translation, how can I do that?

When defining resources with resValue in build.gradle it is impossible to mark them as translatable="false". In XML this is possible.

Exemple:

In gradle.properties:

FACEBOOK_APP_ID="XXXXXXXXXXXXX"

In gradle:

resValue "string", "FACEBOOK_APP_ID", FACEBOOK_APP_ID

When I want to generate signed APK, there is a translation error on this string because is not translated in other language... but it's normal, I don't want to translate it.

like image 874
anthony Avatar asked Sep 21 '15 08:09

anthony


People also ask

Is compileOnly deprecated in gradle?

compileOnly is the replacement — the equivalent configuration that is being deprecated is provided .


1 Answers

Gradle doesn't support this yet. You cannot add anything similar to notranslate in your gradle file.

You can add FACEBOOK_APP_ID to exclude lint translation check. MissingTranslation

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

like image 83
arbrcr Avatar answered Oct 21 '22 18:10

arbrcr