miguelpruivo / flutter_file_picker

File picker plugin for Flutter, compatible with mobile (iOS & Android), Web, Desktop (Mac, Linux, Windows) platforms with Flutter Go support.
MIT License
1.35k stars 673 forks source link

Xcode 13.3 - Error (Xcode): Segmentation fault: 11 Encountered error while archiving for device. #999

Closed iamshaunwu closed 2 years ago

iamshaunwu commented 2 years ago

Hi, after upgrading to Xcode 13.3 and iOS 15.4,

Appreciate if some light can be shed on this issue. Thanks!

SwiftCodeGeneration normal arm64 (in target 'DKImagePickerController' from project 'Pods')
    cd /Users/myname/Projects/apps/my_app_name/ios/Pods
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/myname/Library/Developer/Xcode/DerivedData/Runner-faokyziihkhtwugbkjwfnzeicqgb/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/Objects-normal/arm64/DKPopoverViewController.bc -embed-bitcode -target arm64-apple-ios12.0 -Xllvm -aarch64-use-tbi -O -disable-llvm-optzns -module-name DKImagePickerController -o /Users/myname/Library/Developer/Xcode/DerivedData/Runner-faokyziihkhtwugbkjwfnzeicqgb/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/myname/Library/Developer/Xcode/DerivedData/Runner-faokyziihkhtwugbkjwfnzeicqgb/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DKImagePickerController.build/Objects-normal/arm64/DKPopoverViewController.bc -embed-bitcode -target arm64-apple-ios12.0 -Xllvm -aarch64-use-tbi -O -disable-llvm-optzns -module-name DKImagePickerController -o /Users/myname/Library/Developer/Xcode/DerivedData/Runner-faokyziihkhtwugbkjwfnzeicqgb/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/myname/Library/Developer/Xcode/DerivedData/Runner-faokyziihkhtwugbkjwfnzeicqgb/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           0x000000010503ef88 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x000000010503df9c llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x000000010503f618 SignalHandler(int) + 344
3  libsystem_platform.dylib 0x000000019e6914c4 _sigtramp + 56
4  swift-frontend           0x0000000102fbce8c 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           0x0000000102fcd878 (anonymous namespace)::ObjCARCContract::run(llvm::Function&, llvm::AAResults*, llvm::DominatorTree*) + 1024
6  swift-frontend           0x0000000104db2e24 llvm::FPPassManager::runOnFunction(llvm::Function&) + 1292
7  swift-frontend           0x0000000104db938c llvm::FPPassManager::runOnModule(llvm::Module&) + 60
8  swift-frontend           0x0000000104db35a8 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1088
9  swift-frontend           0x0000000100d7eee8 swift::performLLVMOptimizations(swift::IRGenOptions const&, llvm::Module*, llvm::TargetMachine*) + 3376
10 swift-frontend           0x0000000100d7fe28 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           0x0000000100d88364 swift::performLLVM(swift::IRGenOptions const&, swift::ASTContext&, llvm::Module*, llvm::StringRef) + 180
12 swift-frontend           0x00000001008e0ea0 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6976
13 swift-frontend           0x00000001008a8130 swift::mainEntry(int, char const**) + 808
14 dyld                     0x00000001078a1088 start + 516
error: Segmentation fault: 11 (in target 'DKImagePickerController' from project 'Pods')
[✓] Flutter (Channel stable, 2.10.3, on macOS 12.3 21E230 darwin-arm, locale
    en-SG)
    • Flutter version 2.10.3 at /Users/myname/Projects/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7e9793dee1 (13 days ago), 2022-03-02 11:23:12 -0600
    • Engine revision bd539267b4
    • Dart version 2.16.1
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/myname/Library/Android/sdk
    • Platform android-31, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • 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.11+0-b60-7772763)

[✓] VS Code (version 1.65.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.36.0

[✓] Connected device (2 available)
    • myiPhone (mobile) • 00008110-001938481E04801E • ios            • iOS 15.4 19E241
    • Chrome (web)     • chrome                    • web-javascript • Google Chrome 99.0.4844.51

[✓] HTTP Host Availability
    • All required HTTP hosts are available
iamshaunwu commented 2 years ago

Reference to #966 I also raised the issue at https://github.com/zhangao0086/DKImagePickerController/issues/695.

Not sure if repo maintenance is still active there but in the meantime, I will fall back to 13.2.1 when compiling.

Tpow99 commented 2 years ago

Also having this issue.

xellDart commented 2 years ago

Same issue after update to new Xcode version

Vakil-Parth commented 2 years ago

+1

samuelchanx commented 2 years ago

https://developer.apple.com/download/all/?q=xcode In case any of you needed, here's where you can download older version of XCode. Reverting to older version of XCode 13.2.1 works fine for me too.

abdulla-allaith commented 2 years ago

+1

vothanhduymy commented 2 years ago

+1

tranice commented 2 years ago

+1

miguelpruivo commented 2 years ago

Blocked by #695. You can upvote there since this is a dependency of file_picker.

Mocaris commented 2 years ago

+1

dmitry-kotorov commented 2 years ago

+1

FernandoUFS commented 2 years ago

+1

changleibox commented 2 years ago

+1

hemantshrm commented 2 years ago

+1

miguelpruivo commented 2 years ago

Please, upvote on the #695 since this plugin directly depends on it for some iOS features.

BatuhanGnday commented 2 years ago

+1

narendra02031997 commented 2 years ago

+1

szastavnyy commented 2 years ago

+1

FBisca commented 2 years ago

+1

phanbaohuy96 commented 2 years ago

+1 any update for this?

narendra02031997 commented 2 years ago

I think till now don't have any update so i decide to keep Xcode 13.3 and Xcode 13.0 both. Build archive from Xcode 13.0 problem will solve.

armandojimenez commented 2 years ago

Any update for this?

xiaomaxuetu commented 2 years ago

+1

MarnoDev commented 2 years ago

+1

miguelpruivo commented 2 years ago

This will be fixed as soon as #695 is fixed. Sorry for any inconvenience.

miguelpruivo commented 2 years ago

I'll try to fix this my own since the maintainer of the dependency (DKImagePickerController) is taking a while. I'll keep you updated. Might have to point the podspec to a fix fork until is merged into the official repo.

miguelpruivo commented 2 years ago

EDIT: It's now published on the pods repo. Just run a pod repo update inside your project's /ios folder and you should be good.


It's fixed and I already provided with #696 to the official repo.

As of now, you can use the workaround to point directly to the repo with the fix on your Podfile:

pod 'DKImagePickerController/PhotoGallery', :git => 'https://github.com/miguelpruivo/DKImagePickerController.git'

After that, don't forget to

cd ios && rm Podfile.lock && rm -rf Pods && pod install
iamshaunwu commented 2 years ago

Thanks boss!

Wackymax commented 2 years ago

https://github.com/zhangao0086/DKImagePickerController/pull/696 has been closed and merged into develop

AbMuneeb commented 2 years ago

When a new update of file_picker will be available on pub.dev with these changes

Bingbing0311 commented 2 years ago

+1 ,thank you

CalHoll commented 2 years ago

+1 this one tortured me for some time

theatulverma1 commented 2 years ago

+1 One of my app feature is on hold due to this issue. Please let us know when the update is coming?

gabrielginter commented 2 years ago

for those blocked by this issue.... you could install xcode 13.2.1 in parallel to 13.3 and archive without issue. That's what I've been doing. You can find the official download page here https://developer.apple.com/download/all/?q=Xcode

I hope it helps

rvndsngwn commented 2 years ago

App update delay due to this issue.

miguelpruivo commented 2 years ago

@rvndsngwn you can use the temporary workaround.

The owner of the DKImagePickerController will have to publish the updated Pod, merging only isn't enough. When it's done, you shouldn't require anything else other than a pod repo update.

alihassan143 commented 2 years ago

@rvndsngwn you can use the temporary workaround.

The owner of the DKImagePickerController will have to publish the updated Pod, merging only isn't enough. When it's done, you shouldn't require anything else other than a pod repo update.

not working

msangals commented 2 years ago

+1

Theunodb commented 2 years ago

PS. You need to add this to your iOs project's podfile inside the target 'Runner' do :

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))

  pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.11.0'
  pod 'DKImagePickerController/PhotoGallery', :git => 'https://github.com/miguelpruivo/DKImagePickerController.git'
end
ForceGT commented 2 years ago

I'm seeing the following issue in my terminal, any leads?

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `DKPhotoGallery-library` depends upon `SDWebImage-library`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
ForceGT commented 2 years ago

Got the fix finally, make sure you add the line pod 'DKImagePickerController/PhotoGallery', :git => 'https://github.com/miguelpruivo/DKImagePickerController.git' after the use_modular_headers! line so that the settings apply for this pod as well

I'm seeing the following issue in my terminal, any leads?

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `DKPhotoGallery-library` depends upon `SDWebImage-library`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
alihassan143 commented 2 years ago

PS. You need to add this to your iOs project's podfile inside the target 'Runner' do :

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))

  pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.11.0'
  pod 'DKImagePickerController/PhotoGallery', :git => 'https://github.com/miguelpruivo/DKImagePickerController.git'
end

this method is working fine now i can successfully create the archive for ios and publish my app

osamamohammed98 commented 2 years ago

this solve proplem with xcode 13.3

pod 'DKImagePickerController/PhotoGallery', :git => 'https://github.com/miguelpruivo/DKImagePickerController.git'

set it on your pod file and do pod update | pod install then make ipa it will work inshallah

gabrielginter commented 2 years ago

It seems the pod package DKImagePickerController has been updated to 4.3.3 (was 4.3.2), running pod update inside "ios" folder will update this package to the latest version.

After doing this I was able to archive my app on XCode 13.3 successfully. No extra change needed on your pod file.

miguelpruivo commented 2 years ago

So this is now fixed. I'm closing this. 🎉

akrambak commented 2 years ago

EDIT: It's now published on the pods repo. Just run a pod repo update inside your project's /ios folder and you should be good.

It's fixed and I already provided with #696 to the official repo.

As of now, you can use the workaround to point directly to the repo with the fix on your Podfile:

pod 'DKImagePickerController/PhotoGallery', :git => 'https://github.com/miguelpruivo/DKImagePickerController.git'

After that, don't forget to

cd ios && rm Podfile.lock && rm -rf Pods && pod install

THKS