Playground does not execute on first chapter

On Xcode 9.2, Swift 4.1 toolchain running, I cleared the error by adding this inside Podfile, then pod install again

# Workaround for Cocoapods issue #7606
post_install do |installer|
    installer.pods_project.build_configurations.each do |config|
        config.build_settings.delete('CODE_SIGNING_ALLOWED')
        config.build_settings.delete('CODE_SIGNING_REQUIRED')
    end
end

From Playgrounds regression between CocoaPods 1.4.0 and CocoaPods 1.5.0 · Issue #7689 · CocoaPods/CocoaPods · GitHub

4 Likes

@vinamelody Thanks! Finally working! (nuke did not work, did not try the submodule workaround)
Being on xcode 9.3, pod 1.5.0 (sooo glad I don’t need to downgrade cocoa pods, breaking other projects), seeing swift 4.1.2 being used with the source bundled in v2.0 of the book did the trick.

As there’s already a post_install hook and pod install complained on this. I added these lines just below the existing line post_install do |installer|:

installer.pods_project.build_configurations.each do |config|
    config.build_settings.delete('CODE_SIGNING_ALLOWED')
    config.build_settings.delete('CODE_SIGNING_REQUIRED')
end
2 Likes

I downgraded to 1.3.1, didn’t work. After that …

  1. I deleted the line ‘import RxSwift’
  2. Clean
  3. Build (with error)
  4. put back ‘import RxSwift’

Works!

Thanks for that! (also works for Realm BTW) - too bad v1.5 causes that much trouble …

The script looks like this then (just to make sure - this one works):

platform :ios, ‘11.0’

target ‘RxSwiftPlayground’ do
use_frameworks!

Pods for RxSwiftPlayground

pod ‘RxSwift’, ‘~> 4.0’
end

post_install do |installer|

installer.pods_project.build_configurations.each do |config|
config.build_settings.delete(‘CODE_SIGNING_ALLOWED’)
config.build_settings.delete(‘CODE_SIGNING_REQUIRED’)
end

installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings[‘CONFIGURATION_BUILD_DIR’] = ‘$PODS_CONFIGURATION_BUILD_DIR’
end
end
end

4 Likes

This solution works for me. Thanks

it works like a charm, thanks so much

I can confirm that this works with Xcode version Version 9.3 (9E145) and Pod version 1.5.2. Thank you so much!

Couldn’t get this to work with any of the solutions, then noticed my active scheme was an actual device. Set it to a simulator and everything worked!

1 Like

Thanks! This worked for me!

Works like a charm. Thanks.

Yeah, run pod install with 1.3.1 version works for me. And the trick mentioned by scotteg is not working.

Thanks! It worked for me.

Worked for me, thanks

Even though CocoaPods 1.3.1 and nuking and repaving worked for me on the first playground for Chapter 2, it was a real hassle to do that for all the following playgrounds from the book.

I decided to use Carthage instead, and followed this tutorial to create a workspace with a playground that has RxSwift integrated via Carthage. Worked flawlessly.

@scotteg It might be a good idea to switch to Carthage on the next edition considering Cocoapods isn’t supporting playgrounds :slight_smile:

nuke project
Recopy over
uninstall
install
install RxSwift
Clean
Build

Worked for me the 5th time trying. Could be a lot better and much easier.
Would be wonderful to have an update for this so we don’t have to do this

Thanks,~! This worked for me~!!
And, raywender unkind!!!

I am having the same issues. Spent $54 on the book and so far chapters 1 and 2 have been totally useless as i’ve spent all my time trying to get the playgrounds to work to no avail. Haven’t actually been able to learn any RxSwift unfortunately. I’ve been a huge RW advocate but this is a terrible experience and so far a waste of money. My only options seems to skip to chapter 4 where it begins “By this point in the book, you understand how observables and different types of subjects work…” but actually I barely understand much at all as I’ve only been able to read the examples and not have any hands on practice whatsoever. This RxSwift book is a huge disappointment.

2 Likes

Keep calm bro. You can try change your Podfile like below and run pod install again.

platform :ios, '11.0'

target 'RxSwiftPlayground' do
  use_frameworks!
  
  # Pods for RxSwiftPlayground
  pod 'RxSwift', '~> 4.0'
end

post_install do |installer|
    
    installer.pods_project.build_configurations.each do |config|
        config.build_settings.delete('CODE_SIGNING_ALLOWED')
        config.build_settings.delete('CODE_SIGNING_REQUIRED')
    end
    
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['CONFIGURATION_BUILD_DIR'] = '$PODS_CONFIGURATION_BUILD_DIR'
        end
    end
end

This worked for me, using Xcode 9.4.1 and Swift 4.1.3

I also uninstalled cocoapods v1.5

I’ve got this problem again using Xcode 10 and Swift 4.2

The solution was:

Go to Manage Schemes .
and check shared of RxSwift scheme.
Then build RxSwift scheme with target simulator(not device).
Finally, open playground.(keep select target simulator on build).

I’ve found it in No such module 'RxSwift' · Issue #51 · asmallteapot/cocoapods-playgrounds · GitHub

2 Likes

This topic was automatically closed after 166 days. New replies are no longer allowed.