【问题标题】:My codes are highlighted in red, but my code works. How can I fix this?我的代码以红色突出显示,但我的代码有效。我怎样才能解决这个问题?
【发布时间】: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 一次怎么样?

标签: android android-studio


【解决方案1】:

我找到了答案。我粗心。显然应用程序名称中不能有感叹号。我以前不知道。我将学习更多,以使自己变得更好。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-02
    • 2013-10-24
    • 1970-01-01
    • 2021-02-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多