0

I am developing taksi app when I run app I am getting following exception

Unable to update local snapshot for com.google.android.libraries.consentverifier#com.example.starttaksi, may result in stale flags.
                                                                                                    java.util.concurrent.ExecutionException: java.lang.SecurityException: GoogleCertificatesRslt: not allowed: pkg=com.example.starttaksi, sha256=[f77957bb7143c0754d3c5e22d6c03f0af501037c4a3a8423ada13308aa8eaa05], atk=false, ver=234414038.true (go/gsrlt)
                                                                                                        at m.apa.s(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):21)
                                                                                                        at m.apa.get(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):5)
                                                                                                        at m.aqk.g(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):9)
                                                                                                        at m.yy.c(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):1)
                                                                                                        at m.zf.run(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):5)
                                                                                                        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487)
                                                                                                        at java.util.concurrent.FutureTask.run(FutureTask.java:264)
                                                                                                        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
                                                                                                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                                                                                                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                                                                                                        at java.lang.Thread.run(Thread.java:1012)
                                                                                                    Caused by: java.lang.SecurityException: GoogleCertificatesRslt: not allowed: pkg=com.example.starttaksi, sha256=[f77957bb7143c0754d3c5e22d6c03f0af501037c4a3a8423ada13308aa8eaa05], atk=false, ver=234414038.true (go/gsrlt)
                                                                                                        at android.os.Parcel.createExceptionOrNull(Parcel.java:3023)
                                                                                                        at android.os.Parcel.createException(Parcel.java:3007)
                                                                                                        at android.os.Parcel.readException(Parcel.java:2990)
                                                                                                        at android.os.Parcel.readException(Parcel.java:2932)
                                                                                                        at m.fe.c(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):11)
                                                                                                        at m.sg.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):39)
                                                                                                        at m.jr.e(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):11)
                                                                                                        at m.kp.u(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):10)
                                                                                                        at m.kp.v(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):22)
                                                                                                        at m.kp.e(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):16)
                                                                                                        at m.kt.handleMessage(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):774)

below my MainFragment where I have implemented my google maps logic

@AndroidEntryPoint
class MainFragment : Fragment(R.layout.fragment_main), OnMapReadyCallback {
    private val binding by viewBinding(FragmentMainBinding::bind)
    private lateinit var map: GoogleMap
    private var locationPermissionGranted: Boolean = false
    private var lastKnownLocation: Location? = null
    private lateinit var fusedLocationProviderClient: FusedLocationProviderClient

    companion object {
        val REQUEST_CODE_LOCATION = 32
        private const val DEFAULT_ZOOM = 15
        private const val PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION = 1
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        binding.mapView.onCreate(savedInstanceState)
        binding.mapView.getMapAsync(this)
        fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(requireActivity())

    }

    override fun onMapReady(googleMap: GoogleMap) {
        map = googleMap
        if (ActivityCompat.checkSelfPermission(
                requireContext(),
                Manifest.permission.ACCESS_FINE_LOCATION
            ) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(
                requireContext(),
                Manifest.permission.ACCESS_COARSE_LOCATION
            ) != PackageManager.PERMISSION_GRANTED
        ) {
            ActivityCompat.requestPermissions(
                requireActivity(), arrayOf(Manifest.permission.ACCESS_FINE_LOCATION),
                REQUEST_CODE_LOCATION
            )
            return
        }

        locationPermissionGranted = true
        map.isMyLocationEnabled = true

        getDeviceLocation()
    }



    private fun getDeviceLocation() {
        try {
            if (locationPermissionGranted) {
                val locationResult = fusedLocationProviderClient.lastLocation
                locationResult.addOnCompleteListener(requireActivity()) { task ->
                    if (task.isSuccessful) {
                        lastKnownLocation = task.result
                        if (lastKnownLocation != null) {
                            map.moveCamera(
                                CameraUpdateFactory.newLatLngZoom(
                                    LatLng(
                                        lastKnownLocation!!.latitude,
                                        lastKnownLocation!!.longitude
                                    ), DEFAULT_ZOOM.toFloat()
                                )
                            )
                        }
                    }
                }
            }
        } catch (e: SecurityException) {
        }
    }

}

I want to know where I am making mistake what I have to do in order to solve this problem I have tried all StackOverflow suggestion and answers as well and I have tried all possible solutions as well

1
  • There's a known issue in the public issue tracker about this error: issuetracker.google.com/issues/228091313 and it was specified there that this error is harmless and does not cause any problem with your app. Commented Nov 28, 2023 at 0:32

2 Answers 2

0

You are missing the API Key or at least have not registered the SHA-1 certificate fingerprint in there.

https://developers.google.com/maps/documentation/android-sdk/get-api-key

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

Comments

0

I fixed problem by adding following methods to my MainFragment.kt class

override fun onResume() {
        super.onResume()
        binding.mapView.onResume()
    }

    override fun onPause() {
        super.onPause()
        binding.mapView.onPause()
    }

    override fun onDestroy() {
        super.onDestroy()
        binding.mapView.onDestroy()
    }

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.