Playground does not execute on first chapter

Hello,

I’m trying to follow the first chapter of RxSwift book, but nothing happens on my playground when I try to execute the examples

Here’s what I’ve done:

  1. Downloaded the source code from the site
  2. Opened the RxSwift_v2.0_Source_Code/02-observable-pg/starter/RxSwiftPlayground folder on my terminal
  3. Executed pod install
  4. Opened RxSwiftPlayground.xcworkspace on Xcode
  5. Chose my Team on the project signing options
  6. Builded the project
  7. Typed the first two examples

But nothing happens on the terminal.

Is there anything else I have to do to see the console output?

So, I deleted everything in the playground and started from scratch.

I’ve typed this code:

import RxSwift

let one = 1
let two = 2
let three = 3

let observable = Observable.of(one, two, three)

And now the output gives me an error:

Playground execution failed:

error: Couldn't lookup symbols:
  __T07RxSwift14ObservableTypePAAE2ofAA0C0Cy1EQzGAHd_AA018ImmediateSchedulerD0_p9schedulertFZ
  __T07RxSwift10ObservableCyxGAA0C4TypeAAWa
  __T07RxSwift10ObservableCMa
  __T07RxSwift14ObservableTypePAAE2ofAA0C0Cy1EQzGAHd_AA018ImmediateSchedulerD0_p9schedulertFZfA0_
2 Likes

I found cocoapods version 1.3.1 was the solution to fix this issue.

if "pod _1.3.1_ --version" doesn't print 1.3.1, then it won't work and you will need to install the gem for this 1.3.1 version.

gem install cocoapods -v 1.3.1

I found I had to uninstall cocoapods v1.5 to get it to work (gems were not using the _1.3.1_)

Confirmed working on Xcode 9.2 and Xcode 9.3

2 Likes

Oh yes, my cocoapods is at version 1.5.0. I’ll try to go back to 1.3.1.

Still doesn’t work.

I uninstalled all cocoapods and installed the 1.3.1 version.

And then installed the RxSwift in the project but still couldn’t lookup symbols!!!

any insights into fixing this @scotteg ?

Could you make it work by going back to the version?

I don’t know if this simple trick will help, but at RWDevCon, a speaker was working with RxSwift, and found that simply deleting the import of RxSwift, saving, then adding it back and saving actually cleared up this/similar issues. Go figure!

1 Like

Unfortunately I tried this and it did not work :frowning:

Anyone found a way to fix this? Not working for me either…

Same error - but with “Realm” book - problem with dependencies in the playground.
Cocoapods 1.5.0
Xcode 9.3

Have tried Cocoapods 1.3.1 - didn’t help. Anyone have a solution?

1 Like

Hello,

i have very bad troubles with the source code for the RxSwift Book!?
Please can anyone update the source Code?

The playground for chapter Two(Observable) and chapter three(subjects) does not work!?

A bit off-topic, but using git submodules instead of cocoapods seems to be working fine with playgrounds.

Like here https://www.raywenderlich.com/155150/dependency-management-using-git-submodules.

Installing cocoapods version 1.3.1 worked for me too. This issue can be a real
pain in the ass

1 Like

@boyks I was able to get cocoapods 1.3.1 to work with the Realm book, After messing around a while. if you modify the bootstrap.sh file to be pod _1.3.1_ install you won’t need to uninstall 1.5

1 Like

None of the solutions mentioned worked for me, not even uninstalling CocoaPods 1.5.0 and installing 1.3.1. @scotteg, do you have any other option we can try? Thanks!

I tried the solution that @idiot mentioned, using git submodules. Worked like a charm. The link that @idiot mentioned was useful - in particular look at the section “Working With A 3rd Party Dependency”.

You should also refer to GitHub - ReactiveX/RxSwift: Reactive Programming in Swift where there are instructions for manually installing using git submodules. It is a simple process.

Note: The error goes away only after you build the project containing the playground.

1 Like

Hi @jcabrera, if nothing else has worked for you (including a complete nuke and repave), then maybe try using git submodules instead? I haven’t tried it because CocoaPods is working for me, but this solution seems to be working for others.

1 Like

cocoapods 1.4.0 should probably work too according to Playgrounds regression between CocoaPods 1.4.0 and CocoaPods 1.5.0 · Issue #7689 · CocoaPods/CocoaPods · GitHub

Doing the nuke and repave while being on Cocoapods 1.3.1 did the trick! Thank you very much!

2 Likes