段错误:11(在项目“Pods”中的目标“DKImagePickerController”中)

11

我正在使用Flutter开发iOS应用程序。一切都正常工作,突然间我收到了一个错误。

SwiftCodeGeneration normal arm64 (in target 'DKImagePickerController' from project 'Pods')
    cd /Users/lasthoney/development_project/flutter/workspace/CTRON/ios/Pods
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/Objects-normal/arm64/DKPopoverViewController.bc -embed-bitcode -target arm64-apple-ios9.0 -Xllvm -aarch64-use-tbi -O -disable-llvm-optzns -module-name DKImagePickerController -o /Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/Objects-normal/arm64/DKPopoverViewController.o

Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0.  Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/Objects-normal/arm64/DKPopoverViewController.bc -embed-bitcode -target arm64-apple-ios9.0 -Xllvm -aarch64-use-tbi -O -disable-llvm-optzns -module-name DKImagePickerController -o /Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/Objects-normal/arm64/DKPopoverViewController.o
1.  Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8)
2.  Compiling with the current language version
3.  Running pass 'Function Pass Manager' on module '/Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/Objects-normal/arm64/DKPopoverViewController.bc'.
4.  Running pass 'ObjC ARC contraction' on function '@UI_USER_INTERFACE_IDIOM'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  swift-frontend           0x0000000107206f88 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x0000000107205f9c llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x0000000107207618 SignalHandler(int) + 344
3  libsystem_platform.dylib 0x00000001863b44e4 _sigtramp + 56
4  swift-frontend           0x0000000105184e8c llvm::objcarc::BundledRetainClaimRVs::insertRVCallWithColors(llvm::Instruction*, llvm::CallBase*, llvm::DenseMap<llvm::BasicBlock*, llvm::TinyPtrVector<llvm::BasicBlock*>, llvm::DenseMapInfo<llvm::BasicBlock*>, llvm::detail::DenseMapPair<llvm::BasicBlock*, llvm::TinyPtrVector<llvm::BasicBlock*> > > const&) + 64
5  swift-frontend           0x0000000105195878 (anonymous namespace)::ObjCARCContract::run(llvm::Function&, llvm::AAResults*, llvm::DominatorTree*) + 1024
6  swift-frontend           0x0000000106f7ae24 llvm::FPPassManager::runOnFunction(llvm::Function&) + 1292
7  swift-frontend           0x0000000106f8138c llvm::FPPassManager::runOnModule(llvm::Module&) + 60
8  swift-frontend           0x0000000106f7b5a8 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1088
9  swift-frontend           0x0000000102f46ee8 swift::performLLVMOptimizations(swift::IRGenOptions const&, llvm::Module*, llvm::TargetMachine*) + 3376
10 swift-frontend           0x0000000102f47e28 swift::performLLVM(swift::IRGenOptions const&, swift::DiagnosticEngine&, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, llvm::StringRef, swift::UnifiedStatsReporter*) + 2440
11 swift-frontend           0x0000000102f50364 swift::performLLVM(swift::IRGenOptions const&, swift::ASTContext&, llvm::Module*, llvm::StringRef) + 180
12 swift-frontend           0x0000000102aa8ea0 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6976
13 swift-frontend           0x0000000102a70130 swift::mainEntry(int, char const**) + 808
14 dyld                     0x00000001099ad0f4 start + 520
error: Segmentation fault: 11 (in target 'DKImagePickerController' from project 'Pods')

还有

CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler (in target 'DKImagePickerController' from project 'Pods')
    cd /Users/lasthoney/development_project/flutter/workspace/CTRON/ios/Pods
    export DEVELOPER_DIR\=/Applications/Xcode.app/Contents/Developer
    export SDKROOT\=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.4.sdk
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name DKImagePickerController -O -whole-module-optimization -enforce-exclusivity\=checked @/Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/Objects-normal/armv7/DKImagePickerController.SwiftFileList -D COCOAPODS -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.4.sdk -target armv7-apple-ios9.0 -g -module-cache-path /Users/lasthoney/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -Xfrontend -serialize-debugging-options -embed-bitcode -swift-version 5 -I /Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/DKImagePickerController -F /Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/DKImagePickerController -F /Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/DKPhotoGallery -F /Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/SDWebImage -F /Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/SwiftyGif -c -num-threads 8 -output-file-map /Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/Objects-normal/armv7/DKImagePickerController-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/Objects-normal/armv7/DKImagePickerController.swiftmodule -Xcc -I/Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/DKImagePickerController-generated-files.hmap -Xcc -I/Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/DKImagePickerController-own-target-headers.hmap -Xcc -I/Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/DKImagePickerController-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/DKImagePickerController-project-headers.hmap -Xcc -I/Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/DKImagePickerController/include -Xcc -I/Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/DerivedSources-normal/armv7 -Xcc -I/Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/DerivedSources/armv7 -Xcc -I/Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/DerivedSources -Xcc -DPOD_CONFIGURATION_RELEASE\=1 -Xcc -DCOCOAPODS\=1 -emit-objc-header -emit-objc-header-path /Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/Objects-normal/armv7/DKImagePickerController-Swift.h -import-underlying-module -Xcc -ivfsoverlay -Xcc /Users/lasthoney/Library/Developer/Xcode/DerivedData/Runner-ffimvuyezsoasahfibifkngbbnva/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/unextended-module-overlay.yaml -working-directory /Users/lasthoney/development_project/flutter/workspace/CTRON/ios/Pods

remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
Command CompileSwiftSources failed with a nonzero exit code

我搜寻了这个错误,但没有找到任何解决方案。


你更新了Xcode从13.2.1到13.3吗? - Arbiter Chil
是的,我的Xcode最近更新了。当前版本为13.3(13E113)。 - Honey Last
你一直在使用的库需要升级以适应新的Swift分割代码。因此,临时解决方案是进入您的构建设置中,找到已启用位码并将其禁用,然后尝试或者回到13.2.1,直到包被更新为其最新的Swift代码要求。 - Arbiter Chil
启用 Bitcode 设置已经为 No。 - Honey Last
这个回答解决了你的问题吗?Xcode 归档失败,带有 Flutter 插件 - Ethan11
3个回答

7
我在我的 Podfile 文件中添加了这一行:
pod 'DKImagePickerController/PhotoGallery', :git => 'https://github.com/miguelpruivo/DKImagePickerController.git'

以下是:

target 'Runner' do
  use_frameworks!
  use_modular_headers!
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  pod 'DKImagePickerController/PhotoGallery', :git => 'https://github.com/miguelpruivo/DKImagePickerController.git'
end

我可以通过在 ios 文件夹中运行以下命令再次构建我的 IOS 应用程序:

flutter build ipa

3
我也遇到了使用Xcode 13.3时同样的问题,并用UIDevice.current.userInterfaceIdiom替换了UI_USER_INTERFACE_IDIOM。现在可以进行归档了。

是的,它在我的 M1 Pro 上运行正常... - Kudos
请更详细地说明在哪里进行更改? - Yogi Arif Widodo
我在Xcode 13.3.1 (13E500a)和这个Cocapods 上遇到了问题,所以我把所有的UI_USER_INTERFACE_IDIOM改成了UIDevice.current.userInterfaceIdiom,然后就能编译了。 - peetadelic

0

您只需要更改此Pods/Target Support Files/Pods-App/Pods-App-frameworks.sh文件,在调用readlink时添加-f标志。换句话说,需要将:

source="$(readlink "${source}")"

替换为

source="$(readlink -f "${source}")"

这对我有效。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接