大白金星 2023-03-22 11:27 采纳率: 100%
浏览 53
已结题

Mac环境下的android studio在编译flutter项目时,安卓手机可以正常编译打包,但是苹果虚拟机在Xcode build时就会报错

Mac环境下的android studio在编译flutter项目时,安卓手机可以正常编译打包,但是苹果虚拟机在Xcode build时就会报错,不过经过我测试有的项目又可以编译运行,所以排除了环境安装的问题,网上找了好多方法但都不行,请教一下各位同志们,是不是Xcode还有什么配置要更改,或者是iOS文件里面有什么东西要删除。

android studio日志:

Launching lib/main.dart on iPhone 8 Plus in debug mode...
Running pod install...
Running Xcode build...
Xcode build done.                                           22.3s
Failed to build iOS app
Error (Xcode): Target debug_ios_bundle_flutter_assets failed: Exception: Failed to codesign /Users/apple/FlutterProjects/bms_flutter/build/ios/Debug-iphonesimulator/App.framework/App with identity -.

Could not build the application for the simulator.
Error launching application on iPhone 8 Plus.

Xcode日志:
Target debug_ios_bundle_flutter_assets failed: Exception: Failed to codesign /Users/apple/Library/Developer/Xcode/DerivedData/Runner-bofzxcajanrxjxawfrrbhdmhyuce/Build/Products/Debug-iphonesimulator/App.framework/App with identity -.

flutter版本:
Flutter 3.7.7 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 2ad6cd72c0 (13 days ago) • 2023-03-08 09:41:59 -0800
Engine • revision 1837b5be5f
Tools • Dart 2.19.4 • DevTools 2.20.1

flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.7, on macOS 13.2.1 22D68 darwin-x64, locale
    zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] Connected device (4 available)
[✓] HTTP Host Availability

我怀疑和下面这两个文件有关,但是有这个文件的也编译成功了;
profile.lock内容:


PODS:
  - device_info_plus (0.0.1):
    - Flutter
  - disk_space (0.0.1):
    - Flutter
  - Flutter (1.0.0)
  - flutter_blue_plus (0.0.1):
    - Flutter
    - flutter_blue_plus/Protos (= 0.0.1)
  - flutter_blue_plus/Protos (0.0.1):
    - Flutter
    - Protobuf (~> 3.11)
  - FMDB (2.7.5):
    - FMDB/standard (= 2.7.5)
  - FMDB/standard (2.7.5)
  - package_info_plus (0.4.5):
    - Flutter
  - path_provider_foundation (0.0.1):
    - Flutter
    - FlutterMacOS
  - Protobuf (3.21.1)
  - shared_preferences_foundation (0.0.1):
    - Flutter
    - FlutterMacOS
  - sqflite (0.0.2):
    - Flutter
    - FMDB (>= 2.7.5)
  - webview_flutter_wkwebview (0.0.1):
    - Flutter

DEPENDENCIES:
  - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
  - disk_space (from `.symlinks/plugins/disk_space/ios`)
  - Flutter (from `Flutter`)
  - flutter_blue_plus (from `.symlinks/plugins/flutter_blue_plus/ios`)
  - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
  - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`)
  - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/ios`)
  - sqflite (from `.symlinks/plugins/sqflite/ios`)
  - webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)

SPEC REPOS:
  https://github.com/CocoaPods/Specs.git:
    - FMDB
    - Protobuf

EXTERNAL SOURCES:
  device_info_plus:
    :path: ".symlinks/plugins/device_info_plus/ios"
  disk_space:
    :path: ".symlinks/plugins/disk_space/ios"
  Flutter:
    :path: Flutter
  flutter_blue_plus:
    :path: ".symlinks/plugins/flutter_blue_plus/ios"
  package_info_plus:
    :path: ".symlinks/plugins/package_info_plus/ios"
  path_provider_foundation:
    :path: ".symlinks/plugins/path_provider_foundation/ios"
  shared_preferences_foundation:
    :path: ".symlinks/plugins/shared_preferences_foundation/ios"
  sqflite:
    :path: ".symlinks/plugins/sqflite/ios"
  webview_flutter_wkwebview:
    :path: ".symlinks/plugins/webview_flutter_wkwebview/ios"

SPEC CHECKSUMS:
  device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
  disk_space: e94d34bbdf77954adfb39e60bde9cc5c7233eda6
  Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
  flutter_blue_plus: 6787777145d615de01828f3a9fa423c3c702f0b3
  FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
  package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
  path_provider_foundation: 37748e03f12783f9de2cb2c4eadfaa25fe6d4852
  Protobuf: 9e88c1e667d75aa2491d211f26ccddde4e8ad4cf
  shared_preferences_foundation: 297b3ebca31b34ec92be11acd7fb0ba932c822ca
  sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
  webview_flutter_wkwebview: b7e70ef1ddded7e69c796c7390ee74180182971f

PODFILE CHECKSUM: d4b3474092930fbb95bf2a0d04d10ef405cb59af

COCOAPODS: 1.12.0

podfile内容:


Last login: Wed Mar 22 10:53:33 on ttys002
apple@DbayMacBook-Pro ~ % /Users/apple/FlutterProjects/bms_flutter/ios/Podfile ; exit;
/Users/apple/FlutterProjects/bms_flutter/ios/Podfile: line 2: platform: command not found
/Users/apple/FlutterProjects/bms_flutter/ios/Podfile: line 6: https://github.com/CocoaPods/Specs.git: No such file or directory

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[进程已完成]

  • 写回答

4条回答 默认 最新

  • CSDN-Ada助手 CSDN-AI 官方账号 2023-03-28 07:58
    关注
    不知道你这个问题是否已经解决, 如果还没有解决的话:

    如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

问题事件

  • 系统已结题 4月18日
  • 已采纳回答 4月10日
  • 修改了问题 3月22日
  • 创建了问题 3月22日

悬赏问题

  • ¥20 请问这种量表怎么用spss量化分析(作为中介模型的因变量
  • ¥55 AD844 howland电流源如何驱动大额负载
  • ¥15 C++ /QT 内存权限的判断函数列举
  • ¥15 深度学习GFnet理解问题
  • ¥15 单细胞小提琴堆叠图代码
  • ¥50 升级strust2版本到2.3.15.1后使用ognl3.0.6.jar windows环境中没有问题,但部署到linux环境报错
  • ¥15 vue页面,node封装接口
  • ¥15 求TMS320F280039C工程模板!
  • ¥15 delphi+fastreport实现分组补空打印问题
  • ¥15 使用python把两台mysql数据库服务器数据导出和导入