I'm using React Native to develop an Android app. Sometimes, after I run react-native run-android and my app starts, it hangs on a white screen. Shaking my phone doesn't do anything, and when I click 'pause' in the VSCode debugger it has no effect. If I press the Home button to background the app, then click on the app again, it launches normally and debugging works as expected. Is this a known issue? What can I do to fix it?
Open your android folder in Android studio
Press the green Play button
Open the logcat window from the bottom bar
Make sure the Device and Process are point to the right value, then inspect any error there
I don't have this problem, you need to inspect what happened at run-time to see how to fix this.
have you resolve this issue?
if you use react-native-vector-icons, make sure you update those fonts(Octicons.ttf and etc) in assets/fonts.
it works fine on iOS but on android, whenever the app is installed then sometimes it gets blank white screen after splash, but it works fine sometimes as well. it is just randomly happened
once i updated them, it works fine
Posting answer for people hitting this question possibly facing the same issue as me - blank white screen on android, ios working fine:
Make sure in your MainActivity.java you have getMainComponentName() function:
public class MainActivity extends ReactActivity {
#Override
protected String getMainComponentName() {
return "devApp3";
}
}
Related
I wanted to share a very annoying problem I have with Expo React-Native. It does not break the app or something but it is just annoying to work with.
I am using Expo and I am using the Android Studio Emulator. Expo is installed on a Virtuall Device and its working properly, however I have this problem for a longer time I think since ReactNative 0.61(or 0.60) when they implemented "Fast Refresh". There are time "Fast Refresh" does work right but sometimes when changing a small thing u get an Error thats something like:
Attempted to assign to readonly property.
When you reload the app so the error goes away expo shows a white screen with an endless blue spinner... It's just annoying to quit the node server, close the app, open devops in a browser and bring everything back up everytime.
Has anybody experienced the same behavior or knows a fix for this ?
I've started developing a react-native app using Expo and running it in my Android phone. Things worked OK at first but then suddenly:
Every time I introduced a syntax error on my code, my phone would not display the compiling errors (they used to appear as white text on a red background) but instead it would show an uninformative error screen with a blue background.
My phone stopped responding to the shake gesture in order to access the dev menu. (I wonder who thought that shaking was a good idea as opposed to a more conventional menu...)
Live recompiling stopped working.
Even when refreshing manually, changes to my code sometimes won't be applied. It looks like the expo app is working with an old, cached version of my code.
Expo is indeed running in production mode. Any pointers?
Since you mentioned your project is running in production mode you must change it to development mode, you can do this by clicking the toggle button on expo-cli's interface.
Alternatively if you're using Expo CLI just press p while your project is running to toggle between modes.
You can read more about Dev/production modes here.
I've noticed that every time I run a cordova app using cordova run android, it seems like the menu button is being pressed, the context menu on another currently open app pops up.
It doesn't bother me but I was just curious if anyone else has noticed this peculiar behaviour...
Yes, this is normal. I can observe the same behaviour while developing on an android device.
I have tested my application using ionic-serve and everything run normally.
But, when i tried it using device, the application will first run the splash screen (which is not run when using ionic serve) and nothing happen, only white screen.
Can somebody please help me with this situation?
I have no idea about what happen.
The white screen issue often occurs on devices and not in the browser when you are injecting something into a module that kicks off your app. Try to figure out which one, and remove it (if it's not being used) or update it.
First thing to do is to check for errors in the log. To see them, type the address chrome://inspect/#devices in chrome, and click on your app. You'll need to make sure your device has usb debugging turned on.
I've created a sample application (just a textview, nothing else), and I noticed a bug.
After installing it from the SDCard, it displays the "Application installed" screen, with the done and open buttons.
If I click the open button, a strange thing occurs:
Whenever I put the application in background and reopen it from the application icon, it doesn't reopen it, it creates a new instance.
I can confirm that it is creating a new instance, because after putting it on background and reopening a few times, when I click the back button, it opens the previous instance, instead of returning to the home screen.
Now the strange thing is that it only happens after installing from the SDCard and clicking on the open button.
If I click the done button (or installing via ADB) and open the application via icon, it doesn't happen.
Also, if I click the open button (and the bug occurs), after the application is ended for the first time, the bug doesn't occurs anymore.
I've tested it in different devices and in different Android versions (GB, HC and ICS), and the bug is reproducing in them all.
Does someone know if this is an known issue from Android and if so, does someone have an official reference that I can refer?
Thanks in advance
Yep, it is a nasty, well-known Android bug that has been around since the very beginning. See the following:
Android issue 26658
Android issue 2373
Android app acts differently installed from adb vs sdcard