question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android Build Error - [string/google_app_id] - Duplicate Resource

See original GitHub issue

Hi, using cordova 7.0.1 android 6.2.3

Android build failed message

Execution failed for task ':mergeDebugResources'.
[string/google_app_id] .../platforms/android/res/values/strings.xml	
[string/google_app_id] .../platforms/android/build/generated/res/google-services/debug/values/values.xml: Error: Duplicate resources
  • Removed the google_app_id from platforms/android/res/values/strings.xml
  • Same problem
  • Removed the google_app_id from platforms/android/build/generated/res/google-services/debug/values/values.xml
  • Same problem
  • Removed google_app_id from both files
  • Same problem

Any idea?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

15reactions
nickforddevcommented, Jul 21, 2017

I am experiencing the same issue, same versions. Also using phonegap-plugin-push.

Execution failed for task ':mergeDebugResources'.
> [string/google_app_id] /Sites/rafipayment_frontend/platforms/android/res/values/strings.xml	[string/google_app_id] /Sites/rafipayment_frontend/platforms/android/build/generated/res/google-services/debug/values/values.xml: Error: Duplicate resources

Edit: I’ve tried removing the Android platform, also tried removing and installing this plugin and phonegap-plugin-push in different orders.

I was eventually able to get phonegap build to run, by deleting the following from android.json:

"res/values/strings.xml": {
    "parents": {
        "/resources": [
            {
                "xml": "<string name=\"google_app_id\" translatable=\"false\">85075801930</string>",
                "count": 1
            }
        ]
    }
}

…along with the corresponding entry in strings.xml, but I honestly don’t know what side effects that will have and it seems like a very hacky solution at best.

6reactions
chemerisukcommented, Jul 22, 2017

This is a trash from a some other plugin. It will be ok, because this constant value is generated from your ‘google-services.json’ now

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Duplicate Resources" error when building Android app
The reason you are seeing this error is because Android considers the following images to be the same, based on how they are...
Read more >
[Android] Error: Duplicate resources · Issue #22234 - GitHub
Here is the error I'm getting while generating the release build ... Error: Duplicate resources * Try: Run with --stacktrace option to get...
Read more >
Android Studio throws error: “Duplicate resources”
It seems like you have the same image resource in two files OR you added an additional, non-required file to the res folder....
Read more >
Configure build variants | Android Developers
Build variants are the result of Gradle using a specific set of rules to combine settings, code, and resources configured in your build...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found