'Errors when trying to run flutter app on M1 Max MacBook Pro

Okay. I am new to Flutter. I have a working Flutter app that runs just fine on my old MacBook Air. I now have a new computer... a bright, shiny, nice-smelling M1 Max MacBook Pro. The app won't run. I've tried a new flutter app. It won't run either. It runs on Chrome, and occasionally (40%) on iOS emulator, but then won't run on Android. I have absolutely no idea how to fix this because I don't understand what the problem(s) are. Supposedly VSCode, Android Studio, flutter all support Apple Silicon at this point. I've read a bunch of posts of people complaining about similar issues but the solutions either didn't work or they were for older releases that weren't yet supposedly supporting M1. What I have done to attempt to fix the iOS emulator issue:

  • uncommented the iOS version in Podfile, changed to 10.0
  • ran sudo arch -x86_64 gem install ffi successfully

Didn't help.

Then, there is the Android emulator error:

Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
lib/main.dart:1
✓  Built build/app/outputs/flutter-apk/app-debug.apk.
Error: ADB exited with exit code 1
Performing Streamed Install

adb: failed to install /Users/home/Desktop/flutter_dev/rr_v1a/build/app/outputs/flutter-apk/app.apk: 
Exception occurred while executing 'install':
android.os.ParcelableException: java.io.IOException: Requested internal only, but not enough space
    at android.util.ExceptionUtils.wrap(ExceptionUtils.java:34)
    at com.android.server.pm.PackageInstallerService.createSession(PackageInstallerService.java:557)
    at com.android.server.pm.PackageManagerShellCommand.doCreateSession(PackageManagerShellCommand.java:3143)
    at com.android.server.pm.PackageManagerShellCommand.doRunInstall(PackageManagerShellCommand.java:1341)
    at com.android.server.pm.PackageManagerShellCommand.runInstall(PackageManagerShellCommand.java:1303)
    at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:193)
    at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
    at android.os.ShellCommand.exec(ShellCommand.java:38)
    at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:24742)
    at android.os.Binder.shellCommand(Binder.java:950)
    at and
Error launching application on sdk gphone64 arm64.
Exited (sigterm)

Any help is very much appreciated.



Solution 1:[1]

Its means the minimum supported version of Flutter is currently iOS 10. If we set the Podfile version to platform :ios, '10.0' then Flutter apps wouldn't be able to deploy to iOS 9 devices.

  1. From Podfile uncomment the this line # platform :ios, '9.0'
  2. Chnage it into platform :ios, '10.0'
  3. run pod install

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Paresh Mangukiya