1

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:mergeDebugResources'.

    [string/google_app_id] /home/yushin/Desktop/b/TopStreetZambia/platforms/android/app/src/main/res/values/strings.xml [string/google_app_id] /home/yushin/Desktop/b/TopStreetZambia/platforms/android/app/build/generated/res/google-services/debug/values/values.xml: Error: Duplicate resources [string/google_api_key] /home/yushin/Desktop/b/TopStreetZambia/platforms/android/app/src/main/res/values/strings.xml [string/google_api_key] /home/yushin/Desktop/b/TopStreetZambia/platforms/android/app/build/generated/res/google-services/debug/values/values.xml: Error: Duplicate resources

2
  • In res folder inside platform > android there are some .xml file open in editor and please verify there are some keys are duplicate Commented Jun 28, 2018 at 16:29
  • Can you please explain more on what you mean? @PareshGami Commented Jun 28, 2018 at 17:29

2 Answers 2

3

it appear they was a duplication in google_app_id and google_app_key they belonged to two files one generated from google services, so what i did was went to android.json file and looked up

"res/values/strings.xml": {
    "parents": {
      "/resources": [
        {
          "xml": "<string name=\"google_app_id\">@string/google_app_id</string>",
          "count": 1
        },
        {
          "xml": "<string name=\"google_api_key\">@string/google_api_key</string>",
          "count": 1
        },
        ....

]

and removed

{
          "xml": "<string name=\"google_app_id\">@string/google_app_id</string>",
          "count": 1
        },
        {
          "xml": "<string name=\"google_api_key\">@string/google_api_key</string>",
          "count": 1
        }

that fixed the issue for me.

Sign up to request clarification or add additional context in comments.

1 Comment

sir but in my android.json file both google_app_id and google_app_key not visible in my file tell me what i do now?
2

I solved it by just renaming google_api_key to google_map_api_key just go to strings.xml and place the cursor at the google_api_key and press shift+f6 to refactor it to the name you want

1 Comment

I just renamed my strings.xml with below : <resources> <string name="app_name">GalsKart</string> <string name="launcher_name">@string/app_name</string> <string name="activity_name">@string/launcher_name</string> <string name="google_api_key1">@string/google_api_key</string> <string name="google_app_id1">@string/google_app_id</string> <string name="google_map_api_key">@string/google_api_key</string> </resources>

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.