skip to Main Content

I got an M2 Macbook where I wanted to run my Flutter App which was previously built on an Intel chip. The App does not show any error but can’t be installed on both Android and iOS after the build finishes. I updated all dependencies but no solutions.

Android output:

Running Gradle task 'assembleDebug'...
Invalid depfile: /Users/taoufik/StudioProjects/culture_islamique_mac/.dart_tool/flutter_build/3411ceaa9368a0738c9da3ffddc7daff/kernel_snapshot.d
Invalid depfile: /Users/taoufik/StudioProjects/culture_islamique_mac/.dart_tool/flutter_build/3411ceaa9368a0738c9da3ffddc7daff/kernel_snapshot.d
✓  Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app-debug.apk...```

**iOS Output**

```Launching lib/main.dart on iPhone 15 in debug mode...
Running Xcode build...
Xcode build done.                                           28.9s
[ERROR:flutter/shell/platform/darwin/graphics/FlutterDarwinContextMetalImpeller.mm(42)] Using the Impeller rendering backend.
Error connecting to the service protocol: failed to connect to http://127.0.0.1:61374/pQCKnqnVpG8=/
the Dart compiler exited unexpectedly.```


Then runner quit.

2

Answers


  1. Chosen as BEST ANSWER

    The crush is caused by admob, AD Unit ID that wasn't added in the manifest file for android and in the info.plist for iOS. After adding them, it was all good.


  2. The issue can be related to architecture compatibility between the Intel-based and M1/M2-based Macs caches.

    Try these steps

    For Android:

    • flutter clean
    • flutter pub get
    • open android folder from android studio if you have(optional)
    • click build/clean from android studio
    • build/rebuild
    • flutter run

    For ios

    • Open the iOS module of your project in Xcode (open ios/Runner.xcworkspace)
    • Go to Project > Build Settings, search for Excluded Architectures, and remove any entries under this setting to ensure compatibility with the ARM architecture of M1/M2 chips.
    • Clean the build folder in Xcode (Product > Clean Build Folder)
    • flutter clean
    • flutter pub get
    • flutter run
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search