【发布时间】:2015-08-19 10:49:16
【问题描述】:
我正在尝试在我的应用中实现 Google 地图,我已经请求了 API,并且已经将 API 密钥正确地放在了正确的位置,并且地图似乎可以毫无问题地加载,但是部分代码以红色突出显示。将不胜感激任何帮助!哦,我正在使用 android studio。
此外,在此之前我已经在测试应用程序上尝试过它,它运行良好 iirc。然后我删除了该项目和谷歌开发者控制台上的所有密钥,并为我的主项目开始了新的项目,这发生了。如果此信息有任何帮助。
这是代码错误的屏幕截图:
如果有帮助,这里是 build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "bossharriscorporation.sendmethere"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.google.android.gms:play-services:7.8.0'
}
【问题讨论】:
-
在问题本身中包含所有相关代码/图像,而不是链接
-
对不起,我是新手,我现在就做。
-
见here
-
您的代码中可能有一些错误,由于无法访问android api...请检查成绩控制台
-
File -> Invalidate Caches/Restart -> Invalidate and Restart一次怎么样?