Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android gradle disable removing resources without default value

Since upgrading to Android Gradle Plugin 3.2, resources without required default values are removed. Causing the build to fail.

Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
  warn: removing resource my.package.name:string/my_string_resource without required default value.
  /path/to/layout.xml: AAPT: error: resource string/my_string_resource (aka my.package.name:string/my_string_resource) not found

Can this be disabled? I'm currently using the latest Android Gradle Plugin: 3.4.0

We need that because our customer's translation process requires us to deliver test-builds of the app in another language than the default language. Default values have to be omitted so that translators can easily see what still needs to be translated.

like image 263
Ranil Wijeyratne Avatar asked Feb 14 '26 06:02

Ranil Wijeyratne


2 Answers

It happens when localizing a string resource and it is missing in the default English resources.
The "required default value" just needs to be created in file src/main/res/values/strings.xml

like image 68
Martin Zeitler Avatar answered Feb 16 '26 19:02

Martin Zeitler


I dont know the reason for this error but in my case was because I had this wrong xml value in one of my layouts

android:foreground="null"

Exist the posibility that you had a wrong xml value

like image 21
Gilberto Ibarra Avatar answered Feb 16 '26 18:02

Gilberto Ibarra



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!