Search code examples
androidmapshuawei-mobile-servicesgmsmapviewhuawei-developers

Map: GMS works, HMS dont; onMapReady not called


I have both GMS and HMS in one android project. GMS version works, but HMS dont call the onMapReady callback. This is the code:


    private var mMap: HuaweiMap? = null
    private var mapFragment: SupportMapFragment? = null

 private fun setMapFragment() {
        mapFragment = supportFragmentManager.findFragmentById(R.id.map) as SupportMapFragment?
        mapFragment!!.getMapAsync(this)
        mapFragment!!.view!!.isClickable = false
    }

    override fun onMapReady(huaweiMap: HuaweiMap) {
        mMap = huaweiMap
        loadMap()
    }

I thought GMS and HMS was implemented the same way, but i guess i am wrong. Does HMS need more permissions than GMS or something to make it work??


Solution

  • This problem is a known bug and it will be rectified on November 9, 2020.

    Currently, workarounds can be used:

    1. Change SupportMapFragement to MapView.
    2. Roll back the SDK version.