0

I created a new Android-Studio project, I got the API KEY and my Multidex is enabled but I'm getting this error in my logcat:

01-26 16:55:51.989 5606-5750/com.example.maptestdel E/HAL: load: id=gralloc != hmi->id=gralloc
01-26 16:55:52.121 5606-5751/com.example.maptestdel E/b: Authentication failed on the server.
01-26 16:55:52.121 5606-5751/com.example.maptestdel E/Google Maps Android API: Authorization failure.  Please see https://developers.google.com/maps/documentation/android-api/start for how to correctly set up the map.
01-26 16:55:52.125 5606-5751/com.example.maptestdel E/Google Maps Android API: In the Google Developer Console (https://console.developers.google.com)
                                                                               Ensure that the "Google Maps Android API v2" is enabled.
                                                                               Ensure that the following Android Key exists:
                                                                                API Key: ABCDEFGHIJKLMNOPQRSTUVWXYZBLABLABLA
                                                                                Android Application (<cert_fingerprint>;<package_name>): 8B:9C:A2:53:68:BE:3D:3F:4A:53:39:F7:71:83:E6:EB:F4:63:06:6C;com.example.maptestdel
01-26 16:55:53.767 5606-5748/com.example.maptestdel W/DynamiteModule: Local module descriptor class for com.google.android.gms.googlecertificates not found.

How can I enable my Google Maps Android API v2?
The API key is new, if I start the app on my Huawei P8 Lite I'm getting a white screen with the Google logo at the bottom-left.

My build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "24.0.2"

    defaultConfig {
        applicationId "com.example.maptestdel"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        multiDexEnabled true

    }
    dexOptions {
        javaMaxHeapSize "4g"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:25.1.0'
    compile 'com.google.android.gms:play-services:10.0.1'
    compile 'com.android.support:multidex:1.0.1'
}
Vertexwahn
  • 7,709
  • 6
  • 64
  • 90
Aaron Waller
  • 175
  • 4
  • 21

2 Answers2

0

How to enable "Google Maps Android API v2" in developers console

Please follow the above link . You can create your developers account on google console , create a brand new project , create keys for Android and enable required map api's .

Community
  • 1
  • 1
Anurag Aggarwal
  • 247
  • 1
  • 5
0

There might be many thing that you are missing as you did't paste your whole code

In manifest :

 <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="YOUR_API_KEY" />

In Gradle

Top level Build File

  classpath 'com.google.gms:google-services:3.0.0'

Project level build file

apply plugin: 'com.google.gms.google-services'

and finally in your Google Developer Console you have to enable the Google Maps Android API

Try this and let me know if this work for you or not

Rakshit Nawani
  • 2,604
  • 14
  • 27