flutter app runs on Android simulator but not iOS simulator - ios

I am running a flutter app on the Android simulator successfully but when I run it on the iOS simulator the app opens to a white screen then crashes.
I have done all of the following about 10 times each.
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
sudo xcodebuild -license
flutter update
flutter clean
xcode clean build folder
flutter build ios
flutter run
Remove the Pods folder and Podfile.lock files.
cd ios
pod deintegrate
cd ..
flutter clean
flutter build ios
Xcode 12.5.1
I also made sure Xcode Signing & Capabilities were set. I also stopped and removed all antivirus software.
It doesn't work by running debug and running via terminal ( flutter run --enable-software-rendering ) doesn't show any errors.
UPDATE:
Deleted the iOS folder and tried to run flutter create and now getting.
"No option specified for the output directory"
flutter create doesn't work.
Got the above flutter create working and now the app won't install on the Android device at all, where as it was working before flutter create was run (suggested below). Added memory and wiped Android simulator and still won't install on Android saying not enough memory. Deleting the ios folder and running "flutter create" was a disaster.
Rolling back to original code. Still stuck on not installing on iOS. It has to be something with Xcode.

Related

I cant run my flutter project after updating to xcode 14... keep saying Unable to read project 'Runner.xcodeproj'

Unable to get Xcode project information:
2022-12-01 13:57:05.376 xcodebuild[71564:226197] Writing error result bundle to
/var/folders/6g/w7cqd0s54c33_20mrl4v2q640000gn/T/ResultBundle_2022-01-12_13-57-0005.xcresult
xcodebuild: error: Unable to read project 'Runner.xcodeproj'.
Reason: Project /Users/noel/Treegar/treegar-app/ios/Runner.xcodeproj cannot be opened because it is missing its
project.pbxproj file.
i keep getting this error when ever i run flutter run or flutter build ios.
i dont know what to do... it works fine on android but not on ios.
ive updated xcode and flutter same problem
flutter doctor -v
UPdate cocoapod to latest version
update flutter
update xcode
This error message indicates that the Runner.xcodeproj file is missing or cannot be opened.
This file is part of the Xcode project for your Flutter app and is necessary for building and running the app on iOS.
To fix this issue, try the following steps:
Make sure that you have the latest version of Xcode installed on
your computer. You can check for updates and download the latest
version of Xcode from the Mac App Store.
Make sure that you have the latest version of the Flutter SDK
installed on your computer. You can update Flutter by running the
flutter upgrade command in a terminal window.
Make sure that you have the latest version of CocoaPods installed on
your computer. You can update CocoaPods by running the
sudo gem
install -n /usr/local/bin cocoapods
command in a terminal window.
Make sure that you have a valid Xcode project file for your Flutter
app. If the Runner.xcodeproj file is missing, you can try running
the flutter create . command in the root directory of your Flutter
app to recreate the Xcode project files.
If the above steps do not help, you can try deleting the ios directory in your Flutter app and running the flutter create . command again to recreate the Xcode project files from scratch.
After trying these steps, try running the flutter run or flutter build ios command again to see if the issue has been resolved. If you continue to encounter errors, please provide more information about the specific steps you are taking and the full error message you are seeing.
try flutter clear and pubget.
or
try pod install
or
if it is not harmfull for your code try to delete ios folder and recreate it
in your project. may be this can work .

Not able to build and run any flutter app on iOS simulator using the command flutter run

Error occurring:-
pubspec.yaml file:-
Podfile:-
Below are solutions I tried but still the app don't build on iOS Simulator on MAC m1.
Tried running pod init and pod install in iOS directory.
Tried running flutter clean and flutter pub get.
Tried re-installing the CocoaPods.
Tried updating the Xcode command line tools.
Tried deleting and again downloading the common line tools.
Tried updating the Xcode to latest version

Error launching application on iPhone Flutter

I'm unable to test my flutter application on VSCode which is running on catalina on vitual box.
After launching application from VSCode, I am just getting single line error Error launching application on Najam’s iPhone. and then application is opening in the device but it is then disconnected with VSCode
Launching lib/main.dart on Najam’s iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: H5PHS46J86
Running pod install... 277.5s
Running Xcode build...
└─Compiling, linking and signing... 114.5s
Xcode build done. 346.8s
Installing and launching... 59.8s
Error launching application on Najam’s iPhone.
What I've tried
As suggested here https://github.com/flutter/flutter/issues/69632#issuecomment-803646337, I tried below solution but it didn't work for me
Setting platform to 10.0 inside the Podfile (platform :ios, '10.0' )
Doing a combination of flutter clean, pod cache clean --all and pod install
I also tried this solution too https://stackoverflow.com/a/64661277/7290043. But it didn't work either.
flutter clean pod cache clean --all
rm -rf ios/Flutter/Flutter.framework
flutter pub get
pod install
flutter run
What should I do?
The time to launch is very long. What type of machine are you building on? VSCode debugging might just be timing out. Try running directly from xcode and a) see if it remains connected, and b) see if any further errors are reported
Same issue, I fixed it:
flutter/bin/cache,delete flutter_tools.snapshot and flutter_tools.stamp;
flutter/packages/flutter_tools/lib/src/ios/devices.dart, find 'await observatoryDiscovery.uri.timeout(const Duration(seconds: 60))'
Then change 60 to 240
flutter run
wow, success

How do I fix this flutter iOS error in Xcode?

When I run the command "flutter build ios" - my app is built just fine. I can also run the app in the simulator. However, in Xcode, when I try to open the project, I get the error "unable to attach to DB: error: accessing build database"
This is the first time I've come across this problem on this app. Flutter doctor comes out clean, and nothing changes if I run "flutter clean" and build it again. I can't distribute my app until this is fixed.
That happens at times when the iOS build gets corrupted for some reason.
Close Xcode.
Run flutter clean
After that flutter build ios
Open Xcode again and run your app.
This should generally solve your issue.
If that does not work, you can try this:
flutter clean
cd ios
rm Podfile.lock
rm -rf Pods
pod deintegrate
pod cache clean
pod setup
pod install
After that run flutter build ios
This worked for me, after i run this command
rm -rf ~/Library/Developer/Xcode/DerivedData/
Then i rerun the app and it came to life.

Running react-native run-ios is success. but not launch simulator

I've been using ReactNative in Windows. Android is perfect and now it has to build on the iPhone and give ipa to clients.
However, even if you run counter-native run-ios after updating the code yesterday, the app will not be launched on the simulator.
I started a new project because I thought there might be a problem with my project, and then I ran a counter-native run-ios, but I failed.
The terminal is output as a successful build, but there is no response to the simulator.
App is not installed.
Somebody please help me.
react-native version is 0.59.9
Images are run on terminals and simulators.
As in latest react-native version 0.60.0 + they have fixed too many problems which are with integration of latest xCode version.
Please do the following to achieve
Upgrade react-native version to 0.60.0 or +
rm -rf node_modules/&& yarn install && react-native link
cd ios and then pod install
Close the bundle and run(Cmd+ r) from xCode
Well, in my case I was in sudo mode. When I turned it back to normal mode, it showed up on the IOS simulator as an app.

Resources