Error launching application on iPhone Flutter - ios

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

Related

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

flutter app runs on Android simulator but not iOS simulator

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.

Error says cocoapods is not installed after installation

I get this error when I try to run my flutter app on Macbook Pro:
Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Warning: CocoaPods not installed. Skipping pod install.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install:
sudo gem install cocoapods
CocoaPods not installed or not in valid state.
Error launching application on iPhone 12 Pro Max.
This is my first attempt to run this app on a mac. I have installed cocoapods and the simulator I have is iPhone 12 Pro Max - 14.3. I am doing this in Android Studio.
I am new to macs and this has been a lengthy task trying to get this to run on mac. Any suggestions?
Run pod update in your pod file and clean the flutter project and try to run
command for pod update
pod update
command for flutter clean
flutter clean

YogaKit.modulemap not found in React Native on IOS after build in Xcode 12.4 on Macbook M1

Just make a new React Native projects on new Macbook M1. At first it was building on Xcode 12.4 with any troubles. But after a few days build failed with error:
fatal error: module map file '/Users/jocoders/Library/Developer/Xcode/DerivedData/CryptoWalletApp-hfiwvoyqlbgufkgtyvqtxygiaodf/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap' not found
What I already tried, but nothing works from it:
Checked cocoapods build target and it is the same version as my projects build target https://github.com/facebook/react-native/issues/28503#issuecomment-643744117
Rebuild a project;
Install pod with command arch -x86_64 pod install;
Put arm64 in Xcode Excluded Architectures https://github.com/facebook/react-native/issues/28503#issuecomment-770378485.
Guys can you tell me please how to solve it? Is it possible now to develop for React Native on new Macbook M1? I have it already a few weeks, but still not work on IOS, because it is so painy, a lot of errors. And I was waiting more surprises from Android more then IOS, but in real Android works with out any troubles.
All day I tried to find the decision and nothing worked to me except it: please try to open Xcode through Rosetta - Right click on Xcode in applications folder -> Get Info -> set Open with Rosetta to true
When you try to create a project using the below command in M1(Apple Silicon Chip):
npx react-native init ProjectName
Try to build using below steps:
Open Terminal and install rosetta
Type "softwareupdate — install-rosetta" command in your terminal.
After installation completes, go to the Application.
Find Terminal App
Right click and make a Duplicate Terminal
Now right click on a duplicate terminal and click on "Get Info"
You will see checkbox with option "Open with Rosetta". Enable it. Rosetta checkbox in terminal
That's it. Rename your rosetta terminal so that you can identify it easily.
Open your Rosetta Terminal and run the command npx react-native init ProjectName
After project initialisation done type npx react-native start to start metro.
Now type command npx react-native run-android for run into Android
Type command npx react-native run-ios for run into iOS.
After project initialisation is done you can run start and run command in VS Code also.
I had this problem with react-native 0.70 and xcode 14.2, and i was able to eventually get the app to run by opening the .workspace (NOT the .project xcode file) xcode file in xcode and running (the "play" button in xcode) from the root directory.
After this worked (the app succesfully ran in the ios simulator), i was able to run metro in the terminal and then run
yarn react-native run-ios
from within the ios folder of the app.
The app succesfully built and ran from terminal.
I had the same issue although not on a M1. I fixed it using all the recommendations from this answer.
Quoting the answer there for reference:
Make sure your cocoapods build target is the same version as your
projects build target.
Try rebooting your machine.
Examine your podfile to make sure your build scheme is included in it.
The last thing that really helped me was rebooting the machine. Strange!
I have got an M1 mac setup. The above methodologies were not working for me. However, this worked: Run XCode Rosetta
Finder -> Xcode in applications folder -> Get Info -> set Open with
Rosetta to true
Xcode is now under Rosetta.

Can't run the app on iPhone Simulator because of missing files

I've got a project with several cocoapods dependendencies. One of them is OpenSSL-Universal. It worked for a while until a couple of days ago.
I have cocoapods 1.7.2 and Xcode 10.2.1 and when I try to run the app on a Simulator, I get this error:
This app could not be installed at this time.
Failed to load Info.plist from bundle at path
/Users/trevisil/Library/Developer/CoreSimulator/Devices/7362482B-3AF1-4419-A7FE-EB52AB22DCDC/data/Library/Caches/com.apple.mobile.installd.staging/temp.QmfWcQ/extracted/Payload/Lifepots.app/Frameworks/OpenSSL.framework
I've tried to:
Clean the build folder
Download the dependencies again
Use an older version of Cocoapods
Clean the DeriveData folder
Reboot the simulator
Reset the simulator
Reboot the laptop
Try from another laptop
Any other suggestion?
Now try to pod deintegrate and then pod integrate
Close Xcode
Open terminal, select project directory and type command pod deintegrate
After above process completed in terminal type pod integrate or pod install
Reopen Xcode and run project

Resources