1

Caused by: com.android.build.gradle.tasks.ResourceException: [string/app_name] C:\Android Work\projectName\build\generated\res\resValues\tst\values\generated.xml [string/app_name] C:\Android Work\projectName\build\generated\res\resValues\tst\values\gradleResValues.xml: Error: Duplicate resources

Same file is in generated.xml and gradleResValues.xml

<!-- Automatically generated file. DO NOT MODIFY -->

<!-- Values from build type: tst -->
<string name="app_name" translatable="false">Test</string>

It's saying there's a same string in these both files, how to avoid this exception?

By the way it's only happening to my test build, debug build is working fine!!

6
  • You can't delete one of them? Commented Mar 31, 2020 at 17:30
  • it's recreating Commented Mar 31, 2020 at 17:34
  • File>invalidate caches Have you tried this? Commented Mar 31, 2020 at 17:41
  • 1
    Does this answer your question? Gradle resValue causes duplicate string resources Commented Mar 31, 2020 at 18:01
  • no, i don't have any app_name in strings.xml and debug.setRoot('build-types/debug') is not defined in my build file. Yes, I have tried Invalidate and restart. no result. Commented Mar 31, 2020 at 19:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.