Flutter desktop embedding - macos

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.

Related

Xcode error when build project in flutter

I am new in flutter.I uses Xcode version-12.3 and flutter version Flutter 2.10.4.
when I build the project in Xcode I got an error Command PhaseScriptExecution failed with a nonzero exit code.
And when i try to build in terminal an error- Encountered error while building for device.
enter image description here
When I run the project in terminal it gives a warning:Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2
will it make any difference to build my project.

Xcode build is missing expected TARGET_BUILD_DIR build setting

I face error while launching on device on iPhone 12 Pro Max. This is console log
Launching lib/main.dart on iPhone 12 Pro Max in `debug mode`
Running Xcode build...
Xcode build done. 270.9s
Xcode build is missing expected TARGET_BUILD_DIR build setting.
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.
I just ran into this and fixed it as follows:
run command flutter upgrade
run command flutter clean
run command flutter pub get if you have missing dependencies
attach phone
run command flutter run
If it still fails, open the Xcode runner project, set your development team and run it directly from there.
After it runs, close Xcode, do a clean build, and run it using your preferred approach.

Problems with running app In flutter simulator after reinstalling 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?

React native project not on present IOS simulator or on Xcode

this is the second part of a bigger problem where the first part was solved here React native project deleted on xcode, can't run "run-ios react-native".
I have deleted my project on Xcode may it be .xcworkspace or .xcodeproje.
Because of that, I had to delete IOS and android folders while downgrading, updating and re-upgrading my react version to re-install IOS and android folders.
Thanks to that the emulator is working but unfortunately the project isn't present in the emulator and is still absent with Xcode. One thing to point out is that the simulator only appears when ran in the integrated terminal and nor in general terminal after cd-ing in the project folder.
Can anyone please help re-integrating the project in the emulator and on Xcode please.
Here is the error when the emulator is running in a general terminal:
error Command failed: xcrun instruments -s
xcrun: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk' (errno=No such file or directory)
xcrun: error: unable to find utility "instruments", not a developer tool or in PATH
Here is the error for building the project within emulator when ran from VS code integrated terminal:
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening project.xcodeproj
In Xcode, select Xcode menu, then Preferences, then Locations tab. Click on the advanced button, select legacy and exit Xcode.

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