Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift pods cannot yet be integrated as static libraries

I am building a app by Flutter. I have got this error message when doing "pod install" and the pod install failed and stopped.

The error message:

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

The Swift pod DKPhotoGallery depends upon SDWebImage and SDWebImageFLPlugin, which do 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.

Where should I set "use_modular_headers!" in the Podfile? thanks!

like image 643
dreamkast Avatar asked Jul 25 '20 15:07

dreamkast


1 Answers

I tried out the solution. "use_frameworks!" should be added here in 'ios/Podfile':

.
.
.
target 'Runner' do
      # Flutter Pod
    
      use_frameworks! #add here
    
      copied_flutter_dir = File.join(__dir__, 'Flutter')
      copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
      copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
.
.
.
like image 135
dreamkast Avatar answered Oct 04 '22 00:10

dreamkast