【发布时间】:2018-12-29 06:31:50
【问题描述】:
Google 地图仍在闪烁且无法加载。所有脚本、api 密钥和代码都是正确的。
应用程序gradle 文件是:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.muzammil.bustracking"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.android.gms:play-services-location:+'
implementation 'com.google.android.gms:play-services-maps:+'
implementation 'com.google.firebase:firebase-core:+'
implementation 'com.google.firebase:firebase-auth:+'
//noinspection GradleCompatible
implementation 'com.google.firebase:firebase-messaging:+'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support:design:26.1.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
// apply plugin: 'com.google.gms.google-services'
}
apply plugin: 'com.google.gms.google-services'
我在实际的 Android 手机上运行应用程序,而不是模拟器。
非常感谢您的回答...
【问题讨论】:
-
您是否为清单文件添加了权限?
-
亲爱的,还要避免在库中使用“+”,这是一种不好的做法,请添加正确的版本号。
-
当然先生,我已经添加了权限。地图现在在模拟器上运行,但在实际手机上它仍然闪烁
标签: android google-maps android-studio google-play-services google-places