我創建了一個新的Android-Studio項目,我得到了API密鑰和我的Multidex已啓用,但我得到這個錯誤在我的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.
我怎麼能啓用我的Google Maps Android API v2?
如果我在華爲P8 Lite上啓動應用程序,API密鑰是新的,我在屏幕左下方看到一個帶有Google徽標的白色屏幕。
我的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'
}
你的谷歌控制檯說什麼? – Coder
發佈問題時,請勿發佈真實的API密鑰。這應該是私人的。 –