我有一台 M2 Macbook,我想在其中运行我的 Flutter 应用程序,该应用程序之前是在 Intel 芯片上构建的。该应用程序没有显示任何错误,但在构建完成后无法在 Android 和 iOS 上安装。我更新了所有依赖项,但没有解决方案。
Android 输出:
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.
该问题可能与基于 Intel 和基于 M1/M2 的 Mac 缓存之间的架构兼容性有关。
尝试这些步骤
对于安卓:
适用于ios
挤压是由 admob 引起的,AD 单元 ID 未添加到 android 的 manifest 文件 和 iOS 的 info.plist 中。添加后,一切都很好。