小编Deb*_*ndy的帖子

应用程序在使用Google Play服务时遇到问题.请再试一次

我已多次完成此代码.但从今天早上起,我发现这个问题就出现了.这是显示地图布局的基本代码.并向我显示此错误.我也正确地输入了API密钥.模拟器的屏幕截图我搜索了其他StackOverflow帖子,但没有什么适合我.

package com.example.maptest

import android.support.v7.app.AppCompatActivity
import android.os.Bundle

import com.google.android.gms.maps.CameraUpdateFactory
import com.google.android.gms.maps.GoogleMap
import com.google.android.gms.maps.OnMapReadyCallback
import com.google.android.gms.maps.SupportMapFragment
import com.google.android.gms.maps.model.LatLng
import com.google.android.gms.maps.model.MarkerOptions

class MapsActivity : AppCompatActivity(), OnMapReadyCallback {

    private lateinit var mMap: GoogleMap

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_maps)
        // Obtain the SupportMapFragment and get notified when the map is ready to be used.
        val mapFragment = supportFragmentManager
            .findFragmentById(R.id.map) as SupportMapFragment
        mapFragment.getMapAsync(this)
    }

    /**
     * Manipulates the map once available.
     * This callback is triggered when the map is ready …
Run Code Online (Sandbox Code Playgroud)

android google-maps kotlin google-play-services

12
推荐指数
2
解决办法
8723
查看次数