-3

I'm trying to implement Google Maps in my app, I've already requested the API and already properly put in the API key at the right place, and the map seem to load up without any problems, but sections of codes are highlighted in red. Would appreciate any help! Oh, and I am using android studio.

Also, I've tried it on a test app before this, and it worked fine iirc. Then I deleted that project and all the keys at google's developer console and started new for my main project and this happens. If this info helps in any way.

Here's a screenshot of the code error : My code

Here's build.gradle if it helps :

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'
}
  • Include all relevant code/images in the question itself, not as links – Scott Aug 19 '15 at 10:52
  • Sorry, am new to this, I'll do it now. – Izwan Harris Aug 19 '15 at 10:54
  • See [here](http://stackoverflow.com/help/asking) – Scott Aug 19 '15 at 10:54
  • There might be some error in your code due to which android api's could not be accessed...please check grade console – Shadow Droid Aug 19 '15 at 11:04
  • How about `File -> Invalidate Caches/Restart -> Invalidate and Restart` for once ? – TheLittleNaruto Aug 19 '15 at 12:25
  • @TheLittleNaruto I already did that a few times, also tried rebuilding. Something worth noticing is, when it was restarting, the codes would appear to not be 'red-ed' until it was about 10s to finish and then, the coded is 'red-ed' again. Sorry for the bad word choice. – Izwan Harris Aug 19 '15 at 12:48
  • Which AS version do you have ? – TheLittleNaruto Aug 19 '15 at 12:50
  • @TheLittleNaruto v 1.3.1. It's really confusing, because I did exactly the same thing before (except on a different directory, but same drive partition) but that one worked nicely. I'm currently comparing every single code between the 2 projects to find anything different and it doesn't seem like it's the code that's problematic. It doesn't help that it doesn't have build/compile errors, and the map loads nicely on my test phone. – Izwan Harris Aug 19 '15 at 13:02
  • Can you replace play services dependency to `com.google.android.gms:play-services-maps:7.8.0` ? I am not really sure if that's gonna work. But give it a try. We're programmers; we should try all possible ways anyway. ;-) – TheLittleNaruto Aug 19 '15 at 13:28
  • @TheLittleNaruto I tried your solution buddy, it didn't work, because it wasn't that kind of a problem. I found the answer already, you cannot have an exclamation mark as an app file name. I didn't know. Thanks for helping! – Izwan Harris Aug 19 '15 at 14:53

1 Answers1

0

I found the answer. I was careless. Apparently the application name cannot have an exclamation mark in it. I didn't know before. I shall learn more to better myself.