When I try to run my Ionic 4 app in release mode (both in Simulator and a local iOS device) the splash screen comes up and then all I get is a white screen.
For example, when I execute this command:
ionic cordova run ios --release --prod -- --verbose
I also tried a brand new 'myApp' project (https://ionicframework.com/docs/installation/cli) and exactly the same thing happens. There is no error even when I add verbose and consolelogs.
In debug mode, a local server is started and that renders the app. How is it supposed to work in release mode?
Update: I installed the browser platform since I can't inspect an iOS device in Chrome and I see this error in the browser console which I'll now investigate:
Error: Cannot find module '#angular/core'
The main issue was that I somehow referenced some things from 'ionic-angular' instead of '#ionic/angular'. I don't know how that happened or why it didn't cause issues in Debug mode.
There was also a node-sass issue that I had to resolve first. Once I did that, I got some helpful errors running npm test.
rm -rf node_modules
sudo rm -rf /tmp/*
rm -rf /root/.npm/node-sass
npm uninstall --save node-sass
npm cache clean --force
npm install
Related
When in debug mode app works fine. But during the release build it loads only the splash screen. But when I tick debug executable in release mode.The app is working fine. Please guide. Sorry for the format.
Apple rejects my app
Guideline 2.1 - Performance - App Completeness
We discovered one or more bugs in your app when reviewed on iPad
running iOS 12.4 on Wi-Fi.
Specifically, your app only launched to a splash screen with no other
content available to the user.
Next Steps
To resolve this issue, please run your app on a device to identify any
issues, then revise and resubmit your app for review.
You should be write following command in terminal(Android Studio/Visual Code)
rm -rf $HOME/Library/Developer/Xcode/DerivedData/*
# destroy entire flutter cache (will be redownloaded and rebuilt)
# rm -rf $HOME/Library/Flutter/bin/cache/*
# sometimes Flutter doesn't recompile the frameworks
rm -rf ios/Flutter/App.framework ios/Flutter/Flutter.framework
# remove the entire pub-cache
rm -rf ~/.pub-cache/*
# now, remove the build directory
rm -rf build
# now remove the .packages file
rm -f .packages
# now remove the plugins directory
rm -rf .flutter-plugins
pushd ios
pod deintegrate
rm -rf Pods Podfile.lock
rm -rf .symlinks/*
popd
flutter packages get
Do clean of code by flutter clean
Install pods for iOS by
cd ios then pod install.
Then make release build for iOS by flutter build ios --release.
Now you can open iOS project in xcode and only splash screen issue will be fixed.
Same thing happened to me:
flutter clean
flutter build ios --release
Was all I needed (didn't need to do the pod install).
A few links that might also be helpful:
https://github.com/flutter/flutter/issues/22765#issuecomment-449618558
Flutter app opens, but is stuck on splash-screen
You need to build initially from Android studio for iOS.
Initially clean your project - flutter clean
Then run below line in terminal of Android studio.
flutter build ios --release
Now, open XCode and clean project then make your archive. Your issue of stuck in Splash is resolved.
I am developing a React Native app. Since last week, I don't know why, I cannot run my app via react-native run-ios because the app just close after splash is shown.
Conversely, if I run the application from Xcode it works perfectly. In Android works perfectly too.
I need to run it via react-native run-ios to debug, someone have an idea what could be happening?
This problem has occurred after update my macOS from Sierra (not High Sierra) to Mojave.
EDIT: When this screen appear, it don't let a second to response, automatically the app close itself, and I cannot activate the debug mode to try see something in the console, the Node console of the server don't seems show anything weird, all is like it should be.
I've had similar errors, for me it was enough to re-run pod install, clean cache, restart simulator and temporarily disable the debugger.
1) Clean all the cache:
rm -rf $TMPDIR/react-* && rm -rf $TMPDIR/metro-* && rm -rf $TMPDIR/haste-* && watchman watch-del-all && rm -rf ios/build && rm -rf node_modules && npm install && npm start -- --reset-cache
2) re-run pod install in the ios folder
3) restart the simulator or try to change the simulator:
react-native run-ios --simulator="iPhone 7"
4) After app starts installing on simulator immediately run a CMD+D and disable debugger
If you get any error with cocoaPods try re-installing them:
sudo gem install cocoapods
The error your are getting for cocoapods should be fixed with a simple re-install.
Update: I was able to replicate this on device, the only workaround to I found to load content was to disable the debugger and using console.warn to debug things. On simulator restarting JS server and disable&&enable the debugger seems to fix any issue.
I will update my answer if I will find a better solution.
I could reach to debug the app from Xcode changing schema from Release to Debug.
Anyway I could reach open it with the command react-native run-ios.
The steps to change schema are those:
Product -> Scheme -> Edit Scheme and select Debug instead of Release.
I installed a fresh react-native app.I keep getting the below error when I ran react-native run-ios
Incorrect hash:
eb7c61ff0c1c55cd85deb3c15f2731c14c787429 ?/Users/johndoe/.rncache/boost_1_63_0.tar.gz
I have tried react-native upgrade, rm -rf node_modules
Still doesn't work.
try this one:
rm -rf ~/.rncache
then re-run it.
react-native run-ios
if it's still not showing the simulator, then you could try to add --simulator="iPhone 6s"
react-native run-ios --simulator="iPhone 6s"
Run this command to freshen up everything and pray twice facing the north.
watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
Check this error using simulator app and real device.
Upgrade Xcode to currently latest version.
Otherwise use create-react-native-app. That way you can run app both device and simulator, which is great case if you don't need to detach your app.
I just resolve it, this problem is the version of boost wrong in start scripts.
Go to https://github.com/facebook/react-native/blob/0.56-stable/scripts/ios-install-third-party.sh and select the branch your rn version.
Drag to the bottom and go to the url such as https://github.com/react-native-community/boost-for-react-native/releases/download/v1.63.0-0/boost_1_63_0.tar.gz
Copy the download file to ~/.rncache, replace the old one.
Restart.
Done!
I can't seem to be able to build or emulate in iOS. Xcode is up to date.
This is what I've tried so far:
reinstalling npm
ionic hooks add
sudo remove ios
sudo add ios (got errors when trying to emulate and build)
sudo remove ios
Adding ios without sudo (still errors trying to emulate and build)
npm install -g ios-sim
chown -R username .config/, files belong to me or root
It says iOS platform isn't installed when it definetly is.
I also don't understand how to unlink '/Users/sh/Desktop/PT/www/build/app.html'?
The screenshot below is for emulate but I get the exact same errors for build as well.
This fixed EACCES error:
sudo chown -R username /Users/username/desktop/folder
This allowed it to build and emulate correctly by installing again:
sudo npm install -g cordova
However it is not coming up correctly in the emulator but that wasn't the scope of this particular question. The emulator does launch from the command line now.
I'm working with Cordova to build my mobile app. I'm working on a Mac machine and when I try to build and run my app on iOS device, but I'm keep getting this error.
When running:
cordova build ios
output:
** BUILD SUCCEEDED **
then I run
cordova run ios
I get the error
.../ios/cordova/run: Command failed with exit code 2
You may not have the required environment or OS to run this project
If I try to open the project in Xcode and run it, it successfully run on the device.
I notice that before the run failed, it output the message
ios-sim was not found. Please download, build and install 'npm install -g ios-sim'
I'm guessing Cordova thinks the device isn't plugged in since the ios-sim is a simulatur plugin for cordvoa. But I may be wrong.
Any ideas?
(This question is similar to Cordova: You may not have the required environment or OS to run this project, but this question regarding iOS there that Android)
try
npm install -g ios-sim
npm install -g ios-deploy
I suggest you read iOS Platform guide for more info.