当我尝试在 M1 mac 上的 ios 模拟器上运行我的应用程序时,我不断收到以下错误
Xcode's output:
↳
<unknown>:0: error: merge-module command failed with exit code 1 (use -v to see invocation)
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
iPhoneSimulator14.5.sdk/usr/include/CommonCrypto/module.modulemap:1:8: error: redefinition of
module 'CommonCrypto'
module CommonCrypto [system] [extern_c] {
^
/Users/me/Desktop/project/job/ios/Pods/SCrypto/Frameworks/iphonesimulator/CommonCrypt
o.framework/module.map:1:8: note: previously defined here
module CommonCrypto [system] {
^
Command MergeSwiftModule failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
warning: Capabilities for Signing & Capabilities may not function correctly because its
entitlements use a placeholder team ID. To resolve this, select a development team in the
Runner editor. (in target 'Runner' from project 'Runner')
Xcode 版本:12.5 可可豆:1.10.0.
Flutter Doctor 输出
[✓] Flutter (Channel dev, 2.3.0-0.1.pre, on macOS 11.3.1 20E241 darwin-arm, locale en-NG)
• Flutter version 2.3.0-0.1.pre at /Users/me/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision d72bfb8d07 (11 days ago), 2021-04-26 06:05:55 -0700
• Engine revision de6e1adf97
• Dart version 2.14.0 (build 2.14.0-18.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/moses/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5, Build version 12E262
• CocoaPods version 1.10.0
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
? https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
? https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
[✓] VS Code (version 1.56.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.22.0
[✓] Connected device (2 available)
• iPhone 12 Pro Max (mobile) • 7561F67B-74C8-464F-8191-E5A09B83F01B • ios •
com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
• Chrome (web) • chrome • web-javascript • Google
Chrome 90.0.4430.93
• 未发现问题!
Android 运行良好,无论我使用哪个颤振频道,问题仍然存在。
我已经尝试了一切,在过去的 48 小时内我几乎没睡过,试图解决这个问题。任何帮助将不胜感激。
答案 0 :(得分:0)
只需在您的 swift 文件中添加 import CommonCrypto
。我希望这能解决问题。