Quick: Request for more documentation on how to install with cocoapods?

Created on 29 Nov 2016  Â·  11Comments  Â·  Source: Quick/Quick

I went through the following tutorial on how to install with cocoapods Quick with the correct version and Nimble. However it doesn't let us know how to configure when we are using different build schemes and their confirugration? Are there missing steps to the process??

Could you please let us know why I keep getting an error say:

No module named Nimble or Quick

I would really appreciate it if we could get a more detailed tutorial on this matter. Thanks!

Reference:
https://github.com/Quick/Quick/blob/master/Documentation/en-us/InstallingQuick.md

question

Most helpful comment

Hi @istx25 Thanks for your effort!!!

I'm also running into the following problem when I do pod install:
I'm not sure if this has anything to do with how quick and nimble is installed in cocoapods....

[!] The `MyAppTests [Debug]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-MyAppTests/Pods-MyAppTests.debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `MyAppTests [Development]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-MyAppTests/Pods-MyAppTests.development.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `MyAppTests [Development-iMac]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-MyAppTests/Pods-MyAppTests.development-imac.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `MyAppTests [Release]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-MyAppTests/Pods-MyAppTests.release.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `MyAppTests [Production]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-MyAppTests/Pods-MyAppTests.production.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

All 11 comments

Hi @rlam3! Thanks for reaching out for support. I'm currently settling in from moving to Canada from Europe so I'll try to get a video and some instructions by today or tomorrow (unless someone else can step up for this). Just wanted to let you know that I've seen this. :)

Hi @istx25 Thanks for your effort!!!

I'm also running into the following problem when I do pod install:
I'm not sure if this has anything to do with how quick and nimble is installed in cocoapods....

[!] The `MyAppTests [Debug]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-MyAppTests/Pods-MyAppTests.debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `MyAppTests [Development]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-MyAppTests/Pods-MyAppTests.development.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `MyAppTests [Development-iMac]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-MyAppTests/Pods-MyAppTests.development-imac.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `MyAppTests [Release]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-MyAppTests/Pods-MyAppTests.release.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `MyAppTests [Production]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-MyAppTests/Pods-MyAppTests.production.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

From what you've provided me with, I think there's an issue with your setup. I recommend updating to the newest version of CocoaPods and/or uninstalling and trying again. In any case, I've recorded a video paired with an example project that demonstrates me setting up Quick and Nimble with CocoaPods in an iOS Swift project.

If you can't download those, here's a written guide of what you need to do as well. 😸

  1. Create a new Xcode project with a unit test target.
  2. Run pod init in your project directory.
  3. Open your Podfile and replace the content with the following ~
platform :ios, '9.0'
use_frameworks!

def testing_pods
    pod 'Quick'
    pod 'Nimble'
end

target 'Example' do
  testing_pods

  target 'ExampleTests' do
    inherit! :search_paths
    testing_pods
  end

end
  1. Replace Example and ExampleTests with your target names.
  2. Run pod install in your project directory.
  3. Open the generated .xcworkspace file.
  4. Open a tests file or create a new Swift (or Objective-C) file.
  5. Add the following to the file ~
// @testable import Example
import Quick
import Nimble

class ExampleSpec: QuickSpec {

    override func spec() {
        // Write your spec.
    }

}
  1. Build and run (⌘+R). You may see errors at first but let it run.
  2. Then build and run your tests (⌘+U).

I hope this helps. Please let me know if anything else comes up or if you need more help. I'll gladly record another video or supply any other info.

@istx25 Thanks for the update! I'm curious as to why you included testing_pods in botht the main target and test target. Is this required? Or should it only be within the exampletests target?

In your video I see you getting the same error I did with the ALWAYS_EMBED_SWIFT_STANDARD_LIBARARIES... is there a way to resolve this issue in cocoapods?

Also I downloaded your video and saw at the very end, that import Quick still had an error

In addition, I'd like to know how you configure your Spec so that the test navigator would show the proper details of the test.

Really appreciate your help!

Afaik it's not required but some people prefer to use Quick/Nimble in both targets and others prefer it segregated to the test target. So whichever floats your boat. :)

Regarding the error, try building and running it again. The error went away on its own on my setup. I really recommend reinstalling CocoaPods and whatnot. I imagine that's the issue. What version of Xcode are you using btw?

And for your second question, I'd appreciate it if you filed another issue with the question on its own. So future people can find the answer or comments easily too.

@istx25

I downgraded my cocoapods to 1.0.0 and it seems to have gotten rid of error after a pod install.

However, I think I need further confirmation from you as well on which version of cocoapods you are are using. I think there is something that might be crashing when we upgrade to cococapods 1.1.1.... Do you mind confirming this? Thanks!

I'm running swift 3 on xcode 8.1.

Also, I just opened up #647

Hey @rlam3,

Could you try using cocoa pods 1.1.0 again?

ALWAYS_EMBED_SWIFT_STANDARD_LIBARARIES is the setting cocoa pods needs (and probably most swift libraries) to set to YES to allow Quick + Nimble to integrate properly. Go to your project build settings and set that to YES for all your targets. That setting is needed for test bundles and frameworks to allow swift code to execute in them (which Quick + Nimble need since they include Swift code).Cocoapods is indicating that your project has that overridden and it won’t override that setting for you.

If you want to restore ALWAYS_EMBED_SWIFT_STANDARD_LIBARARIES to the default (inherited) value from Cocoapods, you can select that build setting in your targets and hit the delete key.

I don’t have a lot of time right now, but if you’re still having trouble, I’ll see if I can elaborate a bit more in a few days.

@rlam3: I'm using 1.2.0.beta.1. I recommend following @jeffh's instructions and see if that helps. Though I'm wondering why this is happening to you. Are you trying to do this in an project that existed before the current versions of Xcode? That could be it. I recommend trying it in a new project to see if the problem is contained to that Xcode project.

Hi @jeffh & @istx25

I've tried re-building for the following environment:
Xcode 8.1
Cocoapods 1.1.1

@jeffh Setting the ALWAYS_EMBED_SWIFT_STANDARD_LIBARARIES to YES within the build settings still produces cocoapods errors. The only way I was able to get rid of it was to add $(inherited) in the other flag...
My ALWAYS_EMBED_SWIFT_STANDARD_LIBARARIES error has dissappeared now.. after i set the it to $(inherit) in my build settings.

I would also like to mention that I'm using different build schemes on my project. Would it be possible that you could provide some feedback on how to configure the build schemes properly?
I've been following the following tutorial to create different build schemes for Development, Production, etc... to deal with multiple environmental variables....

http://limlab.io/swift/2016/02/22/xcode-working-with-multiple-environments.html

I have noticed something is different between how QuickSpec is highlighted when toggled between different configurations....

image

image

Also I've tried trouble shooting the app as well...
https://github.com/Quick/Quick/blob/master/Documentation/en-us/Troubleshooting.md

Reference:
http://stackoverflow.com/questions/30102976/how-to-add-custom-project-configurations-to-xcode-when-using-cocoapods
http://pengguo.xyz/tutorial/2016/09/18/Quick-01.html
http://kennethjiang.blogspot.com/2015/07/configure-xcode-to-build-for-different.html

I would like to second @rlam3's original post here, after the pod install it isn't exactly intuitive, especially for beginners.

I wanted to give Quick and Nimble a shot and sure, adding to the pod file was easy enough but when I went to import Quick in my test it wasn't resolving immediately. With my schema on the main target I would run a build (Cmd+B) but it still wouldn't resolve in my test target. Finally I went to manage schema and added a schema for the test target then, poof, the import started to resolve. To test the schema theory I then removed the test target schema however it continued to resolve. I don't get it.

I am using Xcode 8.1 and Cocoapods 1.1.1. I also had a ton of ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES warnings about YES vs $(inherited). If I'm not mistaken setting to $(inherited) will result in a YES value. If you have a look in __your__ Xcode project, under Pods/ folder there should be a few <your-target>.xcconfig files which set the $(inherited) to YES.

Finally I've noticed if you change to $(inherited) as Cocoa Pods suggest, exit Xcode, re-open the project. Xcode will warn you to set suggested settings and happily change all of your $(inherited)'s back to YES's prompting Cocoa Pods to barf the warnings at you next time you install or update.

2 cents.

Closing due to inactivity. Feel free to comment below if any additional help is necessary.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ivanruizscm picture ivanruizscm  Â·  7Comments

nandin-borjigin picture nandin-borjigin  Â·  6Comments

Jtango18 picture Jtango18  Â·  7Comments

modocache picture modocache  Â·  6Comments

donnywals picture donnywals  Â·  6Comments