Error creating Google Maps Activity

0

When I create a new - > Google - > Google Maps Activity it creates everything correctly.

Then I add the key in google_maps_api.xml .

<stringname="google_maps_key" templateMergeStrategy="preserve" translatable="false">
    chave . . .
</string>

However, when compiling the project it has the following error :

  

Error: Execution failed for task ': app: dexDebug'.   com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command' C: \ Program Files (x86) \ Java \ jdk1.8.0_65 \ bin \ java.exe '' finished with non-zero exit value 2   Information: BUILD FAILED   Information: Total time: 13:53   Information: 1 error   Information: 0 warnings   Information: See complete output in console

It automatically puts in the dependencies (compile 'com.google.android.gms: play-services: 9.4.0')

If I switch to version 8.4.0 (compile 'com.google.android.gms: play-services: 8.4.0') it stops giving the error, but when I enter the Map Activity, it does not appear. only the google logo appears in the lower left corner of the screen.

    
asked by anonymous 31.01.2017 / 18:30

1 answer

1

Cristian,

Take a look at your AndroidManifest.xml

You'll notice there's the end of it like this:

<meta-data
    android:name="com.google.android.geo.API_KEY"
    android:value="@string/google_maps_key" />

You need to register this KEY there in the Dashboard on Google, you will need SHA-1 from your development machine.

It has been researched on how to generate KEY HASH for Google Maps.

I hope I have helped, Hugs.

    
31.01.2017 / 19:37