Subito-it / PodBuilder

A tool to precompile CocoaPods pods
Other
284 stars 28 forks source link

Found different Swift versions in targets. #3

Closed iKleMiX closed 4 years ago

iKleMiX commented 4 years ago

When I run pod_builder build_all I get an error: Found different Swift versions in targets. Expecting one, got [] I'm not using Swift in a project, nor any pod I use have Swift code.

I tried to add supports_swift_versions '>= 5.0' to the Frameworks/Podfile, but it didn't change anything.

Bundle versions:

Using CFPropertyList 3.0.1
Using concurrent-ruby 1.1.5
Using i18n 0.9.5
Using minitest 5.13.0
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 4.2.11.1
Using httpclient 2.8.3
Using json 2.2.0
Using algoliasearch 1.27.1
Using atomos 0.1.3
Using bundler 2.0.2
Using claide 1.0.3
Using fuzzy_match 2.0.4
Using nap 1.1.0
Using cocoapods-core 1.8.4
Using cocoapods-deintegrate 1.0.4
Using cocoapods-downloader 1.3.0
Using cocoapods-plugins 1.0.0
Using cocoapods-search 1.0.0
Using cocoapods-stats 1.1.0
Using netrc 0.11.0
Using cocoapods-trunk 1.4.1
Using cocoapods-try 1.1.0
Using colored2 3.1.2
Using escape 0.0.4
Using fourflusher 2.3.1
Using gh_inspector 1.1.3
Using molinillo 0.6.6
Using ruby-macho 1.4.0
Using nanaimo 0.2.6
Using xcodeproj 1.13.0
Using cocoapods 1.8.4
Using cocoapods-rome 1.0.1
Using colored 1.2
Using highline 2.0.3
Using pod-builder 0.9.0

Full error output:

Found different Swift versions in targets. Expecting one, got `[]`
/Library/Ruby/Gems/2.6.0/gems/pod-builder-0.9.0/lib/pod_builder/podfile.rb:305:in `project_swift_version'
        /Library/Ruby/Gems/2.6.0/gems/pod-builder-0.9.0/lib/pod_builder/podfile.rb:42:in `block in from_podfile_items'
        /Library/Ruby/Gems/2.6.0/gems/pod-builder-0.9.0/lib/pod_builder/podfile.rb:31:in `each'
        /Library/Ruby/Gems/2.6.0/gems/pod-builder-0.9.0/lib/pod_builder/podfile.rb:31:in `from_podfile_items'
        /Library/Ruby/Gems/2.6.0/gems/pod-builder-0.9.0/lib/pod_builder/command/build.rb:75:in `block in call'
        /Library/Ruby/Gems/2.6.0/gems/pod-builder-0.9.0/lib/pod_builder/command/build.rb:73:in `each'
        /Library/Ruby/Gems/2.6.0/gems/pod-builder-0.9.0/lib/pod_builder/command/build.rb:73:in `call'
        /Library/Ruby/Gems/2.6.0/gems/pod-builder-0.9.0/lib/pod_builder/command/build_all.rb:11:in `call'
        /Library/Ruby/Gems/2.6.0/gems/pod-builder-0.9.0/exe/pod_builder:320:in `block in parse_commandline'
        /Library/Ruby/Gems/2.6.0/gems/pod-builder-0.9.0/exe/pod_builder:319:in `each'
        /Library/Ruby/Gems/2.6.0/gems/pod-builder-0.9.0/exe/pod_builder:319:in `parse_commandline'
        /Library/Ruby/Gems/2.6.0/gems/pod-builder-0.9.0/exe/pod_builder:337:in `<top (required)>'
        /usr/local/bin/pod_builder:23:in `load'
        /usr/local/bin/pod_builder:23:in `<top (required)>'
        /Library/Ruby/Gems/2.6.0/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `load'
        /Library/Ruby/Gems/2.6.0/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
        /Library/Ruby/Gems/2.6.0/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:28:in `run'
        /Library/Ruby/Gems/2.6.0/gems/bundler-2.0.2/lib/bundler/cli.rb:465:in `exec'
        /Library/Ruby/Gems/2.6.0/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
        /Library/Ruby/Gems/2.6.0/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
        /Library/Ruby/Gems/2.6.0/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
        /Library/Ruby/Gems/2.6.0/gems/bundler-2.0.2/lib/bundler/cli.rb:27:in `dispatch'
        /Library/Ruby/Gems/2.6.0/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
        /Library/Ruby/Gems/2.6.0/gems/bundler-2.0.2/lib/bundler/cli.rb:18:in `start'
        /Library/Ruby/Gems/2.6.0/gems/bundler-2.0.2/exe/bundle:30:in `block in <top (required)>'
        /Library/Ruby/Gems/2.6.0/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
        /Library/Ruby/Gems/2.6.0/gems/bundler-2.0.2/exe/bundle:22:in `<top (required)>'
        /usr/local/bin/bundle:23:in `load'
        /usr/local/bin/bundle:23:in `<main>'
iKleMiX commented 4 years ago

In the meantime I found and commented out line:

build_settings['SWIFT_VERSION'] = item_build_settings["SWIFT_VERSION"] || item.swift_version || project_swift_version(analyzer)

Maybe there should be an option to ignore setting Swift version? Globally and overriding per-pod?

tcamin commented 4 years ago

I run into this issue yesterday while playing with a sandbox project. I’ll check out how to handle and fix this issue ASAP, seems trivial

tcamin commented 4 years ago

Should be fixed in 0.9.1, let me know if it is working now

iKleMiX commented 4 years ago

It works now 👍