Problems with running app In flutter simulator after reinstalling Xcode - xcode

Sorry I need help I am total new into programming/developing.
Im working om a Mac M1 and I did experience problems.
In terminal I write:
flutter create and the flutter run.
The app builds.
But when I try to run and debug in vscode this error comes up:
Expected ios/Runner.xcodeproj but this file is missing. No application found for TargetPlatform.ios. Is your project missing an ios/Runner/Info.plist? Consider running "flutter create ." to create one.
Any ideas?

Related

React Native `RuntimeError: abort(Error: xcrun exited with non-zero code: 2` on iOS simulator

I was working on a React Native project with a group and was asked to use the iPhone 13 simulator as a model while working. I only had access to the iPhone 12 simulator, and I saw that my XCode was a version behind, so I updated it. Now with the new XCode, I am getting an error when I start the React Native server and try and open the iOS simulator. the error is shown below:
Running this command with the suggested build with -s Assertions=1 reveals the following:
My package.json is as following:
Any idea what is going on or how to proceed? Expo seems to be able to run, but trying to open the simulator crashes the server. The project I am on is near tight deadlines and I am totally held up by this. Either a way to troubleshoot this error or a way to roll back my XCode install and just live with a dated simulator would be greatly appreciated.
Figured it our thanks to ShepSims from https://github.com/expo/expo-cli/issues/2413 . Before being able to open the iOS simulator from the terminal, I needed to open XCode and open the simulator there. This mounts the simulator bundle, allowing later access by pressing i after running expo start.
I was receiving the same error as above with XCode command line tools installed only, no XCode installed.
I tried re-installing XCode command line tools which didn't do anything.
For me this was solved with advice mentioned at https://github.com/expo/expo-cli/issues/3871:
open Simulator.app, as it automatically sets the default device.
It is not anything. It was solved by opening simulator from XCOde on my mac
The fastest way from my point of view is "spotlight" (Cmd+Space) search for "Simulator", hit enter before running "expo start" in your terminal.
You can solve the problem by using this command
sudo expo start
Or
manually open simulator
start app: react-native run-ios
manually do: Hardware -> Device -> select iOS -> select Device (different than before !)
that will open a second simulator
start the app again: react-native run-ios (expo start then press i)
this opens the app in the selected simulator
Note:- please stay open the silumater then press the i in the expo and same for the react-native run-ios command

Command PhaseScriptExecution failed with a nonzero exit code Xcode

Recently I had tried adding the google_mobile_ads package to my flutter app. After deciding I didn't want them anymore I took them away, only to run into this error. Prior to the package, everything worked fine, but now I can't even run the project anymore. This is what Xcode tells me:
https://docs.google.com/document/d/13XrC2NTgQ87hlVCmLI2qiQTLhhD6vgMaQkz0ac_tQM0/edit?usp=sharing
What I've tried:
Flutter clean
Restarting Mac
Restarting Xcode and IDE
Changing simulators
Deleting iOS folder completely and rebuilding it
Any direction would be very helpful.

Flutter desktop embedding

Following these instructions
I tried to run a new project on macOS(desktop) using Android Studio.
I get the following error:
Launching lib/main.dart on macOS in release mode... Finished with
error: Unable to get Xcode project information: xcodebuild: error:
The directory
/Users/current.user/Work/Playground/testout/flutter_app2/macos does
not contain an Xcode project, workspace or package.
I get the same issue if I run in the terminal flutter run --release -d macOS
Running on a simulator/device, works fine.
It doesn't sound like you followed the instructions for running a project other than the FDE example. A newly created Flutter project doesn't have support for running on desktop; you need to add that.
See also flutter.dev/desktop#create for information on the state of create and run for desktop.

How to resolve missing required file for Flutter iOS Build

I have written my first non-trivial flutter app and have successfully built and run it on both the Android and iOS simulators and an Android device (MOTO G7). In attempting to build it for an Xs Max connected to my iMac I get the following error during the Xcode build:
/Users/dev/FirstApp/ios/Runner/GeneratedPluginRegistrant.m:6:9: 'path_provider/PathProviderPlugin.h' file not found
I have searched the disk and found the following:
/Users/dev/FirstApp/build/ios/Debug-iphonesimulator/path_provider/path_provider.framework/Headers/PathProviderPlugin.h
/Users/dev/FirstApp/build/path_provider/intermediates/javac/debug/compileDebugJavaWithJavac/classes/io/flutter/plugins/pathprovider/PathProviderPlugin.class
I have googled and checked SO for various hints/solutions. None of the, few, suggested fixes has worked for me. My Flutter Doctor -v command display all checkmarks and no issues.
Am I missing something? Is this a Flutter/Xcode bug? I am using Xcode 10.3 and Flutter 1.7.x. Any suggestions or outright fixes would be appreciated.
In your xcode Open the *.xcworkspace file instead of *.xcodeproj file then
Product>Clean
Product>Archive
and waiting

Getting error while running flutter project in simulator in debug mode

Error comes after running flutter run
The Xcode project does not define target "Runner" which is needed by
Flutter
tooling.
Open Xcode to fix the problem:
open ios/Runner.xcworkspace
Encountered error while building for device.
Just make sure that your app target called "Runner". It seems that flutter tooling relies on this target name.
Example

Resources