I’ve been running into some problems with the apk build of my app. In expo-go it works perfectly fine without any type of errors, and same goes when building the apk.
The problem is that, when I install the apk, the app gets blocked on a white screen. To be specific, it loads a "loading screen" that gets displayed while the app is loading fonts. But after that, just blank.
This is a snippet of what I’m talking about:
useEffect(() => {
async function loadFont() {
await Font.loadAsync({
[...fonts...]
});
setFontLoaded(true);
}
loadFont();
}, []);
if (!fontLoaded) {
//console.log("helloooo");
return <Text>Loading...</Text>
}
return (
<NavigationContainer>
<Drawer.Navigator
[...rest of the code...]
The point is… I have no idea how to figure this out. There’s no console to look at, and online I’ve seen very different opinions on this kind of error, from downgrading react-native-reanimated to changing ansync functions.
From what I saw online this could be related to drawer-navigator/navigationContainer
I can’t really follow this approach since I’d have to re-build the app for each small change and it takes like 1.30h of waiting most of the time. I’ve looked up on debugging with the adb tool but I have no idea how to deal with logs error and whatnot. Any tips? I really don’t know how make it "debuggable" or where to look to solve this issue. It’s getting frustrating since the app is pretty much completed and does everything right in expo, and yet as an apk… Thanks for your help!
Tried building several times, no result
2
Answers
Every time I have run into a white screen with react native it seems to be related to something broken in the JS that the bundling somehow missed.
The way I debug these problems if I am unsure where to look is by starting at the root of my app and commenting out screens and components until I can get something showing besides the white screen. Like even commenting out the entire app to just see if you can present text on the screen.
Then I add back areas one at a time when it breaks again I know to look deeper into that area.
Hope this helps you figure it out. These issues can be really frustrating but every time it’s happened to me it’s been a really dump simple error.
Nicola. I’m having identical error. The app works ok on Expo go, but after compiling it for apk, in the moment to access first page of stackNavigation, the app gets blocked on a white screen. Did you manage to solve this problem? If yes, How?