1

I cannot force the latest renderer to work with certain API levels on the emulator with the following code:

MapsInitializer.initialize(applicationContext, MapsInitializer.Renderer.LATEST, this)

With API level 30, I can get the latest renderer working.
Google Play services client version: 18020000
Google Play services package version: 231715037
Google Play services maps renderer version(maps_core): 231112103

With API level 34, I am forced to use legacy renderer:
Google Play services client version: 18020000
Google Play services package version: 231818044
Google Play services maps renderer version(legacy): 203115000

Both of these devices are setup the exact same except for the API level. To me, this seems backwards, that a newer Android version is causing the app to use the older renderer.

I created my app using the Google Maps Views Activity wizard

class MapsActivity : AppCompatActivity(), OnMapReadyCallback, OnMapsSdkInitializedCallback {

    private lateinit var mMap: GoogleMap
    private lateinit var binding: ActivityMapsBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        MapsInitializer.initialize(applicationContext, MapsInitializer.Renderer.LATEST, this)

        binding = ActivityMapsBinding.inflate(layoutInflater)
        setContentView(binding.root)

        // 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 to be used.
     * This is where we can add markers or lines, add listeners or move the camera. In this case,
     * we just add a marker near Sydney, Australia.
     * If Google Play services is not installed on the device, the user will be prompted to install
     * it inside the SupportMapFragment. This method will only be triggered once the user has
     * installed Google Play services and returned to the app.
     */
    override fun onMapReady(googleMap: GoogleMap) {
        mMap = googleMap
        
        val coordinates = LatLng(39.999495, -83.012685)
        mMap.addMarker(MarkerOptions().position(coordinates).title("Marker"))
        mMap.moveCamera(CameraUpdateFactory.newLatLng(coordinates))
    }

    override fun onMapsSdkInitialized(renderer: MapsInitializer.Renderer) {
        when (renderer) {
            MapsInitializer.Renderer.LATEST -> Log.d("MapsDemo", "The latest version of the renderer is used.")
            MapsInitializer.Renderer.LEGACY -> Log.d("MapsDemo", "The legacy version of the renderer is used.")
        }
    }
}
4
  • I did create an issue on Google's issuetracker at issuetracker.google.com/issues/327248427 Commented Feb 28, 2024 at 20:00
  • Did you find any solution for this? I'm also facing the same issue Commented Jul 13, 2024 at 8:11
  • 1
    The only way I could get this to work is to complete the device setup by tapping on the notification that appears when you first launch the emulator. Commented Jul 15, 2024 at 18:35
  • alright, thank you Commented Jul 16, 2024 at 16:18

1 Answer 1

-1

Here's what I had to do in order to get the emulator using the LATEST renderer:

You're using a virtual device with Google Play. you have finished the set up your device prompt to enable Google Play.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.