You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary
In Android version 10, When user using the location services and disabled the location from drawer. App got crash. We tried to debug it on Android studio cat log but didn't able to find any way to fix it in our react native project.
Reproducible sample code
"react-native-maps": "^1.10.3",
Steps to reproduce
Disable the locaiton from drawer. Try on and off
Expected result
App should not crash
Actual result
Got Crash
React Native Maps Version
1.10.3
What platforms are you seeing the problem on?
Android
React Native Version
0.72.4
What version of Expo are you using?
Not using Expo
Device(s)
realme 3i
Additional information
FATAL EXCEPTION: mqt_native_modules
Process: com.enviro, PID: 8697
java.lang.AbstractMethodError: abstract method "void android.location.LocationListener.onProviderDisabled(java.lang.String)"
at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:365)
at android.location.LocationManager$ListenerTransport.access$000(LocationManager.java:275)
at android.location.LocationManager$ListenerTransport$1.handleMessage(LocationManager.java:291)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:227)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
at java.lang.Thread.run(Thread.java:919)
In our code, we are using only geolocation library. I dont know why its showing the name of this library folder while trying to debugging in Android Studio.
The screenshot above is also share from android studio logs. I guess map library might be internally interconnected with Geo location. For more clarity on this issue, I am sharing below code related to fetching current location. This got crash only when user tried to disable the location form notification drawer.
import Geolocation from '@react-native-community/geolocation';
Summary
In Android version 10, When user using the location services and disabled the location from drawer. App got crash. We tried to debug it on Android studio cat log but didn't able to find any way to fix it in our react native project.
Reproducible sample code
"react-native-maps": "^1.10.3",
Steps to reproduce
Disable the locaiton from drawer. Try on and off
Expected result
App should not crash
Actual result
Got Crash
React Native Maps Version
1.10.3
What platforms are you seeing the problem on?
Android
React Native Version
0.72.4
What version of Expo are you using?
Not using Expo
Device(s)
realme 3i
Additional information
FATAL EXCEPTION: mqt_native_modules
Process: com.enviro, PID: 8697
java.lang.AbstractMethodError: abstract method "void android.location.LocationListener.onProviderDisabled(java.lang.String)"
at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:365)
at android.location.LocationManager$ListenerTransport.access$000(LocationManager.java:275)
at android.location.LocationManager$ListenerTransport$1.handleMessage(LocationManager.java:291)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:227)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
at java.lang.Thread.run(Thread.java:919)
In our code, we are using only geolocation library. I dont know why its showing the name of this library folder while trying to debugging in Android Studio.
The screenshot above is also share from android studio logs. I guess map library might be internally interconnected with Geo location. For more clarity on this issue, I am sharing below code related to fetching current location. This got crash only when user tried to disable the location form notification drawer.
import Geolocation from '@react-native-community/geolocation';
useEffect(() => {
getCurrentLocation();
}, []);
useEffect(() => {
// getCurrentLocation();
const handleAppStateChange = (nextAppState) => {
console.log('nextAppState', nextAppState);
if (appState.match(/inactive|background/) && nextAppState === 'active') {
getCurrentLocation();
}
setAppState(nextAppState);
}, [appState]);
const getCurrentLocation = async () => {
try {
const result = await Promise.race([
request(
Platform.OS === "ios" ? PERMISSIONS.IOS.LOCATION_WHEN_IN_USE : PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION
),
new Promise((_, reject) => setTimeout(() => reject('Location request timed out'), 7000)),
]);
};
The text was updated successfully, but these errors were encountered: