Quick: Xcode 9 beta 4

Created on 28 Jul 2017  Â·  24Comments  Â·  Source: Quick/Quick

  • [√] I have read CONTRIBUTING and have done my best to follow them.

What did you do?

Created a new project using Xcode 9 beta 4, pod installed Nimble and Quick

What did you expect to happen?

Expected default (empty) tests to run and pass

What actually happened instead?

Quick fails to compile, therefore tests fail to build

Environment

  • Quick: 1.1.0
    pod Quick
  • Nimble: 7.0.1
    pod Nimble :git => 'https://github.com/Quick/Nimble.git', :branch => 'xcode9-beta'
  • Xcode Version: 9.0 beta 4 (9M189t)
  • Swift Version: 4.0 (swiftlang-900.0.54.11 clang-900.0.31)

Please also mention which package manager you used and its version. Delete the
other package managers in this list:

  • Cocoapods: 1.2.0 using Cocopods.app

screen shot 2017-07-27 at 4 57 34 pm
screen shot 2017-07-27 at 4 57 51 pm

question

Most helpful comment

On Xcode 9 Beta 6 here.

adding

 # Manually making Quick compiler version be swift 3.2
  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.name == 'Quick' || target.name == 'Nimble'
        print "Changing Quick swift version to 3.2\n"
        target.build_configurations.each do |config|
          config.build_settings['SWIFT_VERSION'] = '3.2'
        end
      end
    end
  end

as @kevinfez suggested fixed it for me. I've had a to add Nimble as well there.

All 24 comments

oh and I do have Defines Module set to yes.

screen shot 2017-07-27 at 5 13 52 pm

accidental close

related to #717


Idk if any of this is useful... but if you're interested...

Adding @interfaces for Example and Callsite in the Quickspec.m file (no idea if I wrote them correctly) and changing the called function in XCTestSuite+QuickTestSuiteBuilder.m file (not sure if it's the correct function) will enable compiling but results in a run time error (see image 3)

Quickspec.m added Example and Callsite
screen shot 2017-07-27 at 5 47 06 pm

XCTestSuite+QuickTestSuiteBuilder.m changed called function
screen shot 2017-07-27 at 5 49 07 pm

QuickConfiguration.m runtime error
screen shot 2017-07-27 at 5 51 20 pm

Quick fails to compile

I confirmed that current master successfully compiles with Xcode 9 beta 4.

Hmm, I specified the master branch in my podfile just to make sure it was getting it from master and it's still not working on my end.
I made another clean project, pod installed Nimble and Quick, tried running just the default test and it fails to run.

screenshot of error when trying to run the tests
screen shot 2017-07-27 at 10 12 56 pm

the zipped project
QuickProject.zip

Hmm so this should be a CocoaPod issue. This project is compatible with Swift 3.2 but not with Swift 4 syntax yet. Please check https://github.com/CocoaPods/CocoaPods/issues/6791 for the details.

ah I see, for those who also stumble into this issue here's a podfile example with a post_install that can change the swift versions of specified pods

thanks to xmartlabs/Eureka#1096

project 'QuickProject.xcodeproj'

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'QuickProject' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for QuickProject
  def testing_pods
    pod 'Quick'
    pod 'Nimble', :git => 'https://github.com/Quick/Nimble.git', :branch => 'xcode9-beta'
  end

  target 'QuickProjectTests' do
    testing_pods
    # Pods for testing
  end

  target 'QuickProjectUITests' do
    testing_pods
    # Pods for testing
  end

  # Manually making Quick compiler version be swift 3.2
  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.name == 'Quick'
        print "Changing Quick swift version to 3.2\n"
        target.build_configurations.each do |config|
          config.build_settings['SWIFT_VERSION'] = '3.2'
        end
      end
    end
  end

end

FYI 3.2 is not a valid value for SWIFT_VERSION build setting. You should use 3.0 which is backward compatible with Xcode 8.x.

do you happen to have a source that 3.2 is an invalid setting?

Suppling either 3.0 or 3.2 in the podfile results in the same thing for me: the swift version for Quick is set to Swift 3.2

set to 3.0
screen shot 2017-07-28 at 4 46 42 am

set to 3.2
screen shot 2017-07-28 at 4 47 47 am

I'm not concerned about backwards compatibility with Xcode 8, but maybe someone else will be.

I didn't know that, thanks for the tip.

@ikesyo What is the solution? Can you please add the information to the readme?

@ikesyo my comment above would most likely solve your problem since you're using Xcode 9. You need to specify that Quick should be using Swift 3.2 to compile since Xcode 9 only supports 3.2 and 4 but defaults to 4 which Quick does not support.

@kevinfez It didn't solve the issue for me. I don't even see references to Quick in the build settings of the Pods project.

@andrashatvani (sorry realized I tagged the wrong person in my previous comment... edited because I did it again)
I downloaded Xcode 9 beta 5, copy and pasted my stuff from above and now I see that Nimble got rid of their Xcode 9 beta branch and merged it into master; However, when I pod installed Nimble it downloads version 6, which is very weird since it should be downloading 7.0.1, but trying to specify '>= 7.0.1' will throw an error, so try pointing the pod file at the GitHub directly using this:

pod 'Nimble', :git => 'https://github.com/Quick/Nimble.git', :branch => 'master'

This successfully downloaded version 7.0.1 for me, and Nimble is now compiling.

@andrashatvani were you able to resolve your issue?

@kevinfez Still no luck, here's my Podfile:

platform :ios, '11.0'
use_frameworks!

target 'bcHealth' do
    use_frameworks!

    pod 'Kanna'
    pod 'SwiftLint'

    def testing_pods
        pod 'Quick', :git => 'https://github.com/Quick/Quick.git', :branch => 'master'
        pod 'Nimble', :git => 'https://github.com/Quick/Nimble.git', :branch => 'master'
    end

    target 'bcHealthTests' do
        testing_pods
    end

    target 'bcHealthUITests' do
        testing_pods
    end

    # Manually making Quick compiler version be swift 3.2
    post_install do |installer|
        installer.pods_project.targets.each do |target|
            if target.name == 'Quick'
                print "Changing Quick swift version to 3.2\n"
                target.build_configurations.each do |config|
                    config.build_settings['SWIFT_VERSION'] = '3.2'
                end
            end
        end
    end
end

@andrashatvani hm, well that pod file looks fine, I guess I should ask just to make sure, did you follow the set up directions and set the Defines Modules flag on both your project and pods project to "yes"?

screen shot 2017-08-16 at 12 50 32 am
screen shot 2017-08-16 at 12 56 15 am

@kevinfez Yes:
screen shot 2017-08-16 at 10 10 39

screen shot 2017-08-16 at 10 11 01

@kevinfez Also the framework search paths look good:
screen shot 2017-08-16 at 10 17 57

What else could it be?

@andrashatvani my framework search paths are not set to anything
screen shot 2017-08-16 at 1 35 51 am

also I tried using your pod file and I had to specify kanna's swift 4.0 feature branch
pod 'Kanna', :git => 'https://github.com/tid-kijyun/Kanna.git', :branch => 'feature/v4.0.0'

@kevinfez Well, embarrassing, but I just had to run the test (Command+U) phase of the project to build the frameworks…

On Xcode 9 Beta 6 here.

adding

 # Manually making Quick compiler version be swift 3.2
  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.name == 'Quick' || target.name == 'Nimble'
        print "Changing Quick swift version to 3.2\n"
        target.build_configurations.each do |config|
          config.build_settings['SWIFT_VERSION'] = '3.2'
        end
      end
    end
  end

as @kevinfez suggested fixed it for me. I've had a to add Nimble as well there.

I updated Defines module in both pods + app settings, ran the tests again and this did the trick.
Intellisense and no more module issues.

Thanks @kevinfez!

Was this page helpful?
0 / 5 - 0 ratings