Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] Errors with version 0.4.0 #52

Closed
neilt opened this issue Oct 26, 2018 · 1 comment
Closed

[QUESTION] Errors with version 0.4.0 #52

neilt opened this issue Oct 26, 2018 · 1 comment
Labels

Comments

@neilt
Copy link

neilt commented Oct 26, 2018

After updating my project to the 0.4.0 version I get the following errors after cleaning build folder and building:

  1. header "PickerView-Swift.h" not found. This file name is not referenced in my project. Also indicates: Could not build Objective-C module 'PickerView'. Which seems to be related to the header file not found. Note that my project is Swift 4.2 not Objc, except for one pod which is objc.

  2. Showing All Messages
    Pods/PickerView/Pod/Classes/PickerView.swift:397:76: 'orientationDidChangeNotification' has been renamed to 'NSNotification.Name.UIDeviceOrientationDidChange'

  3. Pods/PickerView/Pod/Classes/PickerView.swift:399:76: 'orientationDidChangeNotification' has been renamed to 'NSNotification.Name.UIDeviceOrientationDidChange'

Xcode Version 10.0 (10A254a).
pod version 1.5.3

Update all pods
Analyzing dependencies
Downloading dependencies
Installing AMPopTip 3.5.0 (was 3.4.0 and source changed to https://github.com/CocoaPods/Specs.git from https://github.com/cocoapods/specs.git)
Using CSV.swift (2.2.1)
Installing DeviceGuru 5.0.0 (was 4.0.4 and source changed to https://github.com/CocoaPods/Specs.git from https://github.com/cocoapods/specs.git)
Installing Google-Mobile-Ads-SDK 7.35.1 (was 7.33.1 and source changed to https://github.com/CocoaPods/Specs.git from https://github.com/cocoapods/specs.git)
Using ObjcExceptionBridging (1.0.1)
Installing PickerView 0.4.0 (was 0.3.4 and source changed to https://github.com/CocoaPods/Specs.git from https://github.com/cocoapods/specs.git)
Using SVProgressHUD (2.2.5)
Using SwiftyStoreKit (0.13.3)
Using TPInAppReceipt (1.2.1)
Using XCGLogger (6.1.0)
Generating Pods project
Integrating client projects
Sending stats
Pod installation complete! There are 9 dependencies from the Podfile and 10 total pods installed.

@neilt neilt changed the title Errors with version 4.0.0 Errors with version 0.4.0 Oct 26, 2018
@filipealva
Copy link
Owner

filipealva commented Nov 17, 2018

Hi @neilt,

This is happening because you are installing libraries built with different Swift versions.

Take a look at this issue in the CocoaPods repo and at this blog post and you'll have an idea of what's going on.

TL;DR you'll need to add a post installer script to your Podfile in order to support multiple Swift version dependencies. You'll end up with something like that at the end of your Podfile:

post_install do |installer|
  swift42Targets = ['PickerView']
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '4.1'
    end
    if swift42Targets.include? target.name
      target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '4.2'
      end
    end
  end
end

Please note that the script for your specific case might change based on the versions of Swift that your dependencies are using.

@filipealva filipealva changed the title Errors with version 0.4.0 [QUESTION] Errors with version 0.4.0 Nov 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants