Surface and Nativecrypto errors when trying to get current location

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Surface and Nativecrypto errors when trying to get current location



I am getting the errors:


E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7f7fc080e0
E/NativeCrypto: ssl=0x7f5ec8fc00 cert_verify_callback x509_store_ctx=0x7f5d8f0270 arg=0x0
E/NativeCrypto: ssl=0x7f5ec8fc00 cert_verify_callback calling verifyCertificateChain authMethod=ECDHE_ECDSA
E/MPlugin: Unsupported class: com.mediatek.common.telephony.IOnlyOwnerSimSupport



when trying to get current location in kotlin android.



I tried with android 6 and 8 ,still getting error and I am not able to get current location on map, a blank map opens



Can anyone help me with what is the issue here, I am stuck with this issue from days?



This is my code to get current map location:


class MapActivity : FragmentActivity(), OnMapReadyCallback,GoogleApiClient.ConnectionCallbacks,GoogleApiClient.OnConnectionFailedListener,com.google.android.gms.location.LocationListener
private var service: LocationManager? = null
private var enabled: Boolean? = null
private var mCurrLocationMarker: Marker? = null
private lateinit var mMap: GoogleMap
private lateinit var mGoogleApiClient:GoogleApiClient
private lateinit var mLastLocation:Location

private lateinit var mLocationRequest:LocationRequest

override fun onLocationChanged(location: Location)

mLastLocation = location
val latLng=LatLng(location.latitude,location.longitude)

val markerOptions = MarkerOptions()
markerOptions.position(latLng)
markerOptions.title("Current Position")
markerOptions.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_MAGENTA))
mCurrLocationMarker = mMap.addMarker(markerOptions)
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 15f))


override fun onConnected(bundle: Bundle?)
Log.d("sasas:","im here")

mLocationRequest=LocationRequest()
mLocationRequest.interval = 1000
mLocationRequest.fastestInterval = 1000
mLocationRequest.priority = LocationRequest.PRIORITY_HIGH_ACCURACY

if (!enabled!!)
val intent = Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(intent);

// Check if permission is granted or not
if (ContextCompat.checkSelfPermission(this,android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED)
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this)

// LocationServices.getFusedLocationProviderClient(this)

override fun onConnectionSuspended(p0: Int)



override fun onConnectionFailed(p0: ConnectionResult)



override fun onCreate(savedInstanceState: Bundle?)

super.onCreate(savedInstanceState)
setContentView(R.layout.activity_map)
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
service = this.getSystemService(LOCATION_SERVICE) as LocationManager
enabled = service!!.isProviderEnabled(LocationManager.GPS_PROVIDER)
val mapFragment = supportFragmentManager.findFragmentById(R.id.map) as SupportMapFragment
mapFragment.getMapAsync(this)



override fun onMapReady(googleMap: GoogleMap)
mMap = googleMap
mMap.mapType = GoogleMap.MAP_TYPE_NORMAL
if (ActivityCompat.checkSelfPermission
(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED)
return

buildGoogleApiClient()
mMap.isMyLocationEnabled = true


@Synchronized
fun buildGoogleApiClient()
mGoogleApiClient = GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(LocationServices.API)
.build()
mGoogleApiClient.connect()





What is wrong with the code above or why am I getting those errors and why a blank map is shown instead of showing current location?





I doubt errors with Surface and NativeCrypto are related to location. Did you ask for the necessary permissions? Post the code to request the location.
– nikis
Aug 10 at 14:47


Surface


NativeCrypto





@nikis I have updated my question with the code.Please check.
– Sar Geo
Aug 10 at 16:20





@nikis Also I have given permissions in my mainfest file such as: <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
– Sar Geo
Aug 10 at 16:22






I solved it,it was my mistake,I was also using old stuff like fusedlocation api.I updated my code and it works now. :-) no issues
– Sar Geo
Aug 11 at 7:21









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard