Hi everyone,
I am currently facing a splashscreen issue when I upgraded to SDK 39.
In developement mode, everything works perfectly. But when I am publishing the app to the play store, the app launch with the splash screen, then the view start to appear correctly but after a small amount of time, it gets back to the splash screen and the app freezes.
I tried to hide manually “hideAsync()” the splashscreen but it does not work.
- SDK Version: 39.0.0
- Platforms: Android
All packages are updated.
Here is my App.js code:
export default function App(props) {
const [logos, setLogos] = useState([]);
const [isReady, setReady] = useState(false);
useEffect(() => {
load()
}, [])
const load = async () => {
await loadLogos()
await loadTranslations()
await loadFonts()
setReady(true)
}
const loadLogos = async () => {
var response = await fetch('http://inline-hockey.ch/api/fsih_club/')
var data = await response.json()
var tmp = []
for (var i = 0; i < data.length; i++) {
tmp.push({ id: data[i].id, logo: data[i].logo })
}
setLogos(tmp)
}
const loadTranslations = async () => {
var response = await fetch('http://inline-hockey.ch/api/app_translations')
var data = await response.json()
i18n.translations = data;
i18n.locale = Localization.locale;
// When a value is missing from a language it'll fallback to another language with the key present.
i18n.fallbacks = true;
}
const loadFonts = async () => {
await Font.loadAsync({
Lato_400Regular: require('./assets/fonts/Lato-Regular.ttf')
})
}
const getView = () => {
if (!isReady) {
return null;
} else {
return <LogosContext.Provider value={logos}>
<PaperProvider theme={theme}>
<NavigationContainer>
<Stack.Navigator screenOptions={{
headerShown: false
}}>
<Stack.Screen name="Root" component={DrawerNavigator} />
<Stack.Screen name="GameInfo" component={GameInfo} />
<Stack.Screen name="TeamInfo" component={TeamInfo} />
</Stack.Navigator>
</NavigationContainer>
</PaperProvider>
</LogosContext.Provider>
}
}
return (
getView()
)
}
Thanks for your help