7
votes

From Android Studio, I created a Map Activity project; so, there's no custom code.

The only custom changes made was copying the URL from the google_maps_api.xml _(https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=)_ and using it to create an API key.

Android Studio: 3.0.1 Emulator: Nexus 5X with API 25

Build.gradle file


apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "xxxx.xxx.xxxx"
        minSdkVersion 19
        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"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.google.android.gms:play-services-maps:11.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

Screenshot

enter image description here

It seems like I'm missing something; I just don't know what it is.

1
I think that you are using wrong API key.Not displaying usually happens because of it.Vladyslav Matviienko
The API key was generated using the URL in the google_maps_api.xml file autogenerated from Android Studio.I'm not sure how it could be wrong.Kneel-Before-ZOD
@AswinPAshok Thanks for the link; however, it's the same one I used and I still got this blank screen.Kneel-Before-ZOD
Try to run in your mobile. Sometimes emulator is not able to load map properly, That's why it shows blank map without loading roots.MashukKhan

1 Answers

2
votes

Try to run in your mobile. Sometimes emulator is not able to load map properly, That's why it shows blank map without loading roots.