try {
val adresstext= findViewById(R.id.editText3)as TextView
fusedLocationClient = LocationServices.getFusedLocationProviderClient(this)
fusedLocationClient.lastLocation.addOnSuccessListener {
location -> location
var locationx=location.longitude
var locationy=location.latitude
val name = findViewById(R.id.textView) as TextView
name.text=(locationx.toString()+" "+locationy.toString())
var geocoder: Geocoder
var listadress :List<Address>
geocoder = Geocoder(this, Locale.getDefault());
listadress =geocoder.getFromLocation(locationy,locationx,1)
var adress=listadress[0].getAddressLine(0)
var city =listadress[0].locality.get(0)
var state = listadress[0].adminArea.get(0)
var country = listadress[0].getCountryName()
var postalCode = listadress[0].getPostalCode()
var knownName = listadress[0].getFeatureName()
adresstext.text=(adress+city+state+country+postalCode+knownName)
}
}
catch (e: java.lang.Exception)
{
Toast.makeText(this,e.toString(),Toast.LENGTH_LONG).show()
}
Это мой код, когда я запускаю его в эмуляторе, он работает без ошибок. Но когда я запускаю его с помощью своего телефона (я подключаю его к моему p c), кнопка не работает, и он говорит :
V/AudioManager: querySoundEffectsEnabled...
D/AwareBitmapCacher: handleInit switch not opened pid=19134
До этого, когда программа открывается в моем телефоне, запуск запуска выглядит следующим образом:
E/: APS:IFLoad:importExternalFunctions, search function createNewHwApsUtils failed, dlsym err:undefined symbol: createNewHwApsUtils
E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@6c8edde
E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@3bb1bbf
это 3 красных Как я могу решить эту проблему?