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

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/

Related

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

Android SDK cannot be found

When I run flutter doctor, this is what is says:
[✓] Flutter (Channel stable, 3.3.6, on macOS 12.1 21C52 darwin-arm, locale
en-CN)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from:
https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK
components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup
for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.71.1)
[✓] VS Code (version 1.72.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
! Doctor found issues in 1 category.
I have downloaded android 12 from android studio, so I don't know what could be causing this problem. I didn't download it to a custom location, it is just sitting in my applications.
I tried looking for an answer on StackOverflow and online, but their problem is different from mine.
Use this code in the terminal: flutter config --android-sdk
For use the path where is your Android SDK located. In most cases it is "C:\Users\yourSystemUsername\AppData\Local\Android\Sdk"
First, find the location of your android SDK. If you cant, download again to custom location using SDK Manager from Android Studio.
My location looks like C:\src\Android\SDK
Now run the following command-> flutter config --android-sdk "sdk-location"
In my case, flutter config --android-sdk "C:\src\Android\SDK"
Your sdk file should look something like this

Error importing files in vsCode flutter/dart files

my app was running before I decided to plug my phone to test it on a real device.
I'm working on MacOS and I used to work with iPhone 13 simulator . I plugged my Galaxy phone and started the debug.
This is my flutter doctor :
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-TN)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.66.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
• No issues found!
As I said , I plugged my phone then weird error keeps coming out of no where !
: Error: The method 'ProductDetail' isn't defined for the class '_PopularProductsState'.
package:FreedomDistribution/…/components/popular_product.dart:58
- '_PopularProductsState' is from 'package:FreedomDistribution/screens/home//components/popular_product.dart' ('lib/screens/home//components/popular_product.dart').
package:FreedomDistribution/…/components/popular_product.dart:1
Try correcting the name to the name of an existing method, or defining a method named 'ProductDetail'.
builder: (context) => ProductDetail(
^^^^^^^^^^^^^
I got almost 200 errors like this , and my imports are just fine (tested like 5min ago , nothing changed) ..
I tried , flutter clean , closing vsCode , unplug phone .. nothing !
I found in some thread that I should delete .vscode but I didn't find it (show hidden files are checked).

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)

Flutter run: No supported devices connected error on Mac

I cannot seem to run my flutter project anymore. I created a new empty one and still the same: I get the same error
No supported devices connected.
The following devices were found, but are not supported by this project:
Chrome (web) • chrome • web-javascript • Google Chrome 88.0.4324.192
If you would like your app to run on web, consider running flutter create . to
generate projects for these platforms.
It worked perfectly before! I used fluter doctor to check if everything is ok
[✓] Flutter (Channel stable, 2.0.1, on macOS 11.2.2 20D80 darwin-arm, locale
en-GB)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
✗ Android licenses not accepted. To resolve this, run: flutter doctor
--android-licenses
[!] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS
development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.53.2)
[✓] Connected device (1 available)
I run my projects in VSCode and worked perfectly fine before... Flutter is put to date.
When I do flutterdeviced the IOS Simulator does not appear anymore :(
Accept licenses and try again. May be they changed agreement
run: flutter doctor --android-licenses
export PATH="$PATH://Users/USERNAME/dev/flutter/bin"
USERNAME= which user
dev = where flutter is
flutter doctor --android-licenses