my flutter app do not run in iphone device from android studio - flutter

When I run for the application from the xcode it works, and same thing
in simulator , but when I do the run from the Android Studio in iphone
device, It displays a white screen and then shuts down, and it appears
like this :
Launching lib/main.dart on iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: 7R6D66J964
Running Xcode build...
Xcode build failed due to concurrent builds, will retry in 2 seconds.
Xcode build done. 44.9s
Installing and launching...
Error launching application on iPhone.
flutter doctor :
[✓] Flutter (Channel master, 1.24.0-2.0.pre.55, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-JO)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.1)
[✓] Android Studio (version 4.1)
[✓] Connected device (3 available)
! Error: iPhone is busy: Copying cache files from device. Xcode will continue when iPhone is finished. (code -10)
• No issues found!

Open Xcode
go to Wondow -> Devices & simulator
your phone showing left side
right click on that and unpair
no pair the device and it's working properly

Related

Android Studio and VS Code stuck on "Syncing files to device" when trying to debug flutter app on iOS simulator with M1 mac

I am working on a flutter app with my M1 MacBook Pro and can't get the debugger of Android Studio or VS Code to work with an iOS simulator (iPhone 14 Pro with iOS 16.2). When I try to start debugging in Android Studio I get this output in the console:
Launching lib/main.dart on iPhone 14 Pro in debug mode...
Running Xcode build...
Xcode build done. 9,5s
Debug service listening on ws://127.0.0.1:62652/S84BCtJtulI=/ws
Syncing files to device iPhone 14 Pro...
After that nothing happens.
I tried running the simulator via Rosetta, but that did not help.
It is running fine with flutter run and from Xcode itself but I want the debugger in Android Studio (or VS Code).
This is the result for flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 3.7.0-13.0.pre.41, on macOS 13.0.1 22A400 darwin-arm64, locale de-DE)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
✗ cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.74.3)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
! Doctor found issues in 1 category.
Am I doing something wrong? Am I missing something?

i can't debug on physical device

i am trying to debug on a physical device a flutter app. During launch it freezes on:
Running Gradle task 'assembleDebug'...
i run the program with
flutter run -v
, everything works perfectly.
this is my flutter doctor
Doctor summary (to see all details, run flutter doctor -v): [✓]
Flutter (Channel stable, 3.3.7, on macOS 13.0.1 22A400 darwin-arm,
locale it-IT) [✓] Android toolchain - develop for Android devices
(Android SDK version 33.0.0-rc1) [✓] Xcode - develop for iOS and macOS
(Xcode 14.1) [✓] Chrome - develop for the web [✓] Android Studio
(version 2021.3) [✓] VS Code (version 1.73.1) [✓] Connected device (4
available) [✓] HTTP Host Availability
• No issues found!
during startup I get a white screen on the physical device, but I don't get errors of any kind.
help please?
it happened to me many times,
when that happened I use flutter clean and then close and reopen
vs code and most important I delete my old versions of the app this soluation works fine for me and I hope that helps you

How to fix error - App sandbox not enabled (Flutter, macos)

I am using a library to run "shutdown" terminal command
https://pub.dev/packages/process_run
And everything works as it should.
When I set the sandbox mode to false everything works as it should, but then an error occurs when uploading to Testflight (See screenshot)
If the sandbox mode is set to true, then Testflight is loaded, but now it is not possible to call the necessary commands
If someone can understand how to achieve my final goal, I will be very grateful.
I need to call the command "sudo shutdown -h now" to shut down the mac
flutter doctor
[✓] Flutter (Channel stable, 3.3.4, on macOS 12.6 21G115 darwin-x64, locale en-RU)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.72.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
You have problem with Xcode Asset.xcassets folder
kindly add icon generated for apple and then try again .
for creating icon you can use this website :
https://appicon.co/

avoid use of removable GPUs (via com.apple.CoreSimulator.simctl:GPUSelectionPolicy->avoidRemovable)

Today when I start the flutter app in Mac Book Pro M1(the code did not change and runs fine in the Old 2019 Mac Book Pro), shows error like this:
This will generate a JSON format file containing all messages that
need to be translated.
Launching lib/main.dart on iPhone 13 in debug mode...
Running pod install...
Running Xcode build...
Xcode build done. 35.1s
Exception: Unable to launch com.earth.dolphin on 1DF4FFBC-4606-4406-A67D-8A263A470676:
ProcessException: Process exited abnormally:
com.earth.dolphin: -1
2022-03-06 18:23:50.661 simctl[62639:2998773] apply_selection_policy_once: avoid use of removable GPUs (via com.apple.CoreSimulator.simctl:GPUSelectionPolicy->avoidRemovable)
An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=3):
The request to open "com.earth.dolphin" failed.
The process did launch, but has since exited or crashed.
Command: /usr/bin/arch -arm64e xcrun simctl launch 1DF4FFBC-4606-4406-A67D-8A263A470676 com.earth.dolphin --enable-dart-profiling --enable-checked-mode --verify-entry-points --start-paused --observatory-port=0
Error launching application on iPhone 13.
why did this happen and what should I do to fix it? Seems no one facing the problem after searching from Google. This is the flutter info:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.2, on macOS 12.2.1 21D62 darwin-arm, locale en-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] Android Studio (version 2021.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.1)
[✓] VS Code (version 1.64.2)
[✓] Connected device (3 available)

Cannot run first project under flutter

Mac with Mojave
Flutter installed
Flutter Doctor passed all the tests
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14.2 18C54, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.2)
[✓] IntelliJ IDEA Community Edition (version 2018.3)
[✓] Connected device (2 available)
I started IntelliJ IDE, and clicked on create new project
I selected the Android Emulator: Nexus 5S, and the emulator opened up properly.
I clicked on the green arrow to run, but I got the following error message:
════════════════════════════════════════════════════════════════════════════════
No valid code signing certificates were found
You can connect to your Apple Developer account by signing in with your Apple ID
in Xcode and create an iOS Development Certificate as well as a Provisioning
Profile for your project by:
1- Open the Flutter project's Xcode target with
open ios/Runner.xcworkspace
2- Select the 'Runner' project in the navigator then the 'Runner' target
in the project settings
3- In the 'General' tab, make sure a 'Development Team' is selected.
You may need to:
- Log in with your Apple ID in Xcode first
- Ensure you have a valid unique Bundle ID
- Register your device with your Apple Developer Account
- Let Xcode automatically provision a profile for your app
4- Build or run your project again
5- Trust your newly created Development Certificate on your iOS device
via Settings > General > Device Management > [your new certificate] > Trust
For more information, please visit:
https://developer.apple.com/library/content/documentation/IDEs/Conceptual/
AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html
Or run on an iOS simulator without code signing
════════════════════════════════════════════════════════════════════════════════
Finished with error: No development certificates available to code sign app for device deployment
Any ideas?
It looks like it's trying to run on an ios device that doesn't have a valid certificate. Flutter doctor is saying there are 2 devices connected. If you have an ios device attached to your computer, try disconnecting it so that flutter doesn't try to use it instead of the emulator.