![]() Copy the livereload. At this point you still get a blank screen when running the emulator because Android doesn't trust this certificate. Optionally specify the -livereload option to use the dev server from ionic serve for livereload functionality. ![]() ionic cordova run platform options Build your app and deploy it to devices and emulators using this command. If this time is like the dozens of other times I’ve encountered this, I will come back later tonight or in the morning and things will just be working again… No indication of anything useful in server or console logs… It has really made working in this environment very challenging when dealing with deadlines and scheduled deliverables as I’ve randomly lost hours of development time randomly without warn or reason due to this issue.Įdit: Like now… 30+ mins dead in the water and the moment I click save on this post (on another PC), the black screen is magically replaced with my app’s screens without any intervention from me (other then sending mental deathrays at it). ionic cap run android -l -external -ssl -ssl-cert ssl\livereload.crt -ssl-key ssl\livereload.key. Run an Ionic project on a connected device. Out of the blue, I start getting the black screen on the device after saving a few simple CSS changes… I can kill every node.exe instance, I can uninstall and reinstall the app, I can reboot my PC and tablet - all to no avail… I’ve been working in this app all day without so much as the first issue. Like now… Why I am replying to this thread is because the black screen issue began randomly again and so I again went looking for info on how to resolve it… Just as you’ve described, I can run without livereload using this exact codebase without any issues… ionic cordova run android -l / ionic cordova run ios -l (Or just ionic run android/ios -l if youre using an older version of the CLI). ionic cordova run android -livereload / ionic cordova run ios -livereload. It’s actually quite infuriating, as it seems to begin randomly and end just as randomly… The app works with ionic serve on my web browser or with ionic capacitor run android -livereload on my real android device. Just like Duannx mentioned in the comments, the proper CLI command is. However, when I try to play native sounds or use the HTTP library from the native plugins, there is an alert that is issued that says Cordova not available. And voila after the serve command compiles the app you can run the app from the Android. When I run ionic cordova run android -livereload with my android device on the same wifi network as my laptop, the app loads fine. In those cases, you should use the local network IP (if the devices are on the same network), something like 192.168.1.XX, and as the local IP works for all cases it's recommended to always use that instead of localhost.īeta Was this translation helpful? Give feedback.I also have this issue sometimes, though I’ve yet to put my finger on what actually brings it about… But a major drawback it doesn’t work with ionic cli so no livereload possible. On real devices it won't work because the server is running in the computer and "localhost" is "this device", so fails because you don't have a server running on the real device. Perform ionic build (or run the dev server from ionic serve with the -livereload option) Run capacitor run (or open IDE for your native project with the -open option) When using -livereload with hardware devices, remember that livereload needs an active connection between device and computer. This is particularly useful when writing code that interacts with native plugins - we must run it on a device to verify that it works. ionic capacitor run will do the following. We can also use it when developing on iOS and Android devices. Is it possible do live-reload on an actual Android device. Instead, it sees only that it is connected through Ethernet to a router/firewall. Remember ionic serve That was Live Reload working in the browser, allowing us to iterate quickly. An emulated device can't see your development machine or other emulator instances on the network. On Android emulator it won't work because it's behind a virtual router/firewallĮach instance of the emulator runs behind a virtual router/firewall service that isolates it from your development machine network interfaces and settings and from the internet. ![]() Here is what it looks like on my development device. Android: However, for ionic cordova run android -l or ionic cordova run android -l -address0.0.0. capacitor capacitor What went wrong: capacitor Execution failed for task :capacitor-android:compileDebugJavaWithJavac. When it is done running, notice that it has displayed the url the application in running on. This is the code that is from the YouTube Video React Hooks In Ionic Framework - Part One. So, on iOS simulator it works because the simulator runs on the same machine as the server (your computer) The starting point for this code is in this github repo MyAppReactApp. Are you testing on real devices or simulators?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |