After updating my project to targetSdkVersion 34, I’m receiving the error: “One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn’t being registered exclusively for system broadcasts”.
The error points to both functions related to this library (implementation ‘io.nlopez.smartlocation:library:3.3.3’):
`private fun startLocation() {
if (SmartLocation.with(context).location().state().isAnyProviderAvailable) {
SmartLocation.with(context).location()
.oneFix()
.start {
mUserLocation = it.latitude.toString() + ";" + it.longitude
setAddressLocation(it)
}
}
}`
`private fun setAddressLocation(it: Location) {
SmartLocation.with(context).geocoding().reverse(it) { original, results ->
if (results.size > 0) {
val result: Address = results[0]
SharedPreferenceStore.storeValue(
context,
Const.LAST_LOCATION_DETAIL,
LocationDetails(
result.premises,
result.thoroughfare,
result.adminArea,
result.locality,
result.postalCode,
result.countryName
).toJson()
)
}
}
}`
Please, does anyone have a tip for me about how to solve it?
I tried to check if there is any recommendation in the library documentation but there is no issue about that yet.
César Freitas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.