[BUG]Offline pack manager crash on Android
See original GitHub issueDescribe the bug Putting Offlinemanager’s getPacks into code leads to crash of App
To Reproduce 1)react-native init AwesomeProject 2)follow installation guide of mapbox 3) Put some sample code with mapbox(example in getting started) 4)use MapboxGL.offlineManager.getPacks() 5)npx react-native run-android
Example: from getting started page + some usage of getPacks in componentDidMount
import React, { Component } from "react";
import { StyleSheet, View } from "react-native";
import MapboxGL from "@react-native-mapbox-gl/maps";
MapboxGL.setAccessToken("<YOUR_ACCESSTOKEN>");
const styles = StyleSheet.create({
page: {
flex: 1,
justifyContent: "center",
alignItems: "center",
backgroundColor: "#F5FCFF"
},
container: {
height: 300,
width: 300,
backgroundColor: "tomato"
},
map: {
flex: 1
}
});
export default class App extends Component {
componentDidMount() {
MapboxGL.setTelemetryEnabled(false);
MapboxGL.offlineManager.getPacks().then(res => (console.log(res)));
}
render() {
return (
<View style={styles.page}>
<View style={styles.container}>
<MapboxGL.MapView style={styles.map} />
</View>
</View>
);
}
}
Expected behavior App works fine and logging all available offline packs
Versions:
- Platform: Android
- Emulator/ Simulator: no
- OS: Android 10
- react-native-mapbox-gl Version 8.0.0
- React Native Version 0.60.5, 0.62.2
Screenshot:
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
[BUG]Offline pack manager crash on Android #773 - GitHub
Describe the bug. Putting Offlinemanager's getPacks into code leads to crash of App. To Reproduce 1)react-native init AwesomeProject
Read more >Android: apps crashes every time i try to open file manager
Hello all, I have a very big problem: If I open an app that needs to interact with my file manager, when I...
Read more >Detect and diagnose crashes - Android Developers
An Android app crashes whenever there's an unexpected exit caused by an unhandled exception or signal. An app that is written using Java...
Read more >Android packagemanager list causing app to crash
I downloaded Android Studio today and started a new project. I added an empty activity to the form with a textview with the...
Read more >11 Quick Ways to Fix Apps Keep Crashing on Android - iMobie
Go to Settings > “Apps” or “Application manager” > Choose the app that crashes > Tap the “Uninstall” option to make it. Then...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We ran into the same issue.
Here is the crashing stack trace.
It appears that the issue is called by calling
getPack
before the map has loaded. Try@mfazekas suddenly stop working. Uploaded post with gif of execution of example code