cocoapods-binary icon indicating copy to clipboard operation
cocoapods-binary copied to clipboard

CocoaPods 1.6.0 or above are not supported for resource-containing static frameworks

Open ikesyo opened this issue 5 years ago • 5 comments

I got an error when running with CocoaPods 1.7.0.beta.2:

TypeError - no implicit conversion of Array into String
/usr/local/lib/ruby/gems/2.6.0/gems/cocoapods-binary-0.4.2/lib/cocoapods-binary/Prebuild.rb:131:in `basename'
/usr/local/lib/ruby/gems/2.6.0/gems/cocoapods-binary-0.4.2/lib/cocoapods-binary/Prebuild.rb:131:in `block (2 levels) in prebuild_frameworks!'
/usr/local/lib/ruby/gems/2.6.0/gems/cocoapods-binary-0.4.2/lib/cocoapods-binary/Prebuild.rb:129:in `each'
/usr/local/lib/ruby/gems/2.6.0/gems/cocoapods-binary-0.4.2/lib/cocoapods-binary/Prebuild.rb:129:in `map'
/usr/local/lib/ruby/gems/2.6.0/gems/cocoapods-binary-0.4.2/lib/cocoapods-binary/Prebuild.rb:129:in `block in prebuild_frameworks!'
/usr/local/lib/ruby/gems/2.6.0/gems/cocoapods-binary-0.4.2/lib/cocoapods-binary/Prebuild.rb:118:in `each'
/usr/local/lib/ruby/gems/2.6.0/gems/cocoapods-binary-0.4.2/lib/cocoapods-binary/Prebuild.rb:118:in `prebuild_frameworks!'
/usr/local/lib/ruby/gems/2.6.0/gems/cocoapods-binary-0.4.2/lib/cocoapods-binary/Prebuild.rb:206:in `block in <class:Installer>'

Looks like this is due to the change for Pod::PodTarget#resource_paths

  • doc: https://www.rubydoc.info/gems/cocoapods/Pod%2FPodTarget:resource_paths
  • A PR which introduced the change: https://github.com/CocoaPods/CocoaPods/pull/7820
    • The method now returns [Hash{String=>Array<String>}] over [Array<String>]
    • Included since 1.6.0.beta.1.
  • Affected code: https://github.com/leavez/cocoapods-binary/blob/9f40c5df4149598b03b44c01d33b04e78ff38772/lib/cocoapods-binary/Prebuild.rb#L120-L130

Could you take a look? Thanks in advance!

ikesyo avatar Mar 25 '19 08:03 ikesyo

@leavez Thanks for the quick fix! 💖

ikesyo avatar Mar 27 '19 01:03 ikesyo

I found there's a change in copying resource files for static framework in cocoapods 1.7.

When building a pod with 'static_framework = true' and with cocoapods 1.6, it will generate a framework containing the resource files in framework bundle. But when use cocoapods 1.7, no resources will copied to the framework bundle.

This plugin cannot handle the change right not. So It doesn't work in cocoapods 1.7

leavez avatar Mar 27 '19 04:03 leavez

Hey @leavez , Thanks for your amazing work!

Is there any estimation for a fix for cocoapods 1.7 static frameworks with bundle?

reuvenlevitsky avatar Aug 30 '19 10:08 reuvenlevitsky

do we have a solution for this yet?

KPR7168 avatar Nov 23 '20 10:11 KPR7168

not support resources now?

bolee avatar Sep 16 '22 10:09 bolee