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

Demo code can't run #2066

Closed
zip520123 opened this issue Jan 12, 2017 · 11 comments · Fixed by #2084
Closed

Demo code can't run #2066

zip520123 opened this issue Jan 12, 2017 · 11 comments · Fixed by #2084

Comments

@zip520123
Copy link

I clone demo code and try to run.
follow readme."Having trouble running the demo?"
Run

brew install carthage
carthage checkout

got

*** Cloning ios-snapshot-test-case
*** Cloning realm-cocoa
*** Checking out ios-snapshot-test-case at "da629211c17a4c507e2e866e8a19ed3122af770b"
*** Downloading realm-cocoa.framework binary at "v2.1.1"

And I try to run it on my iPhone then crash.

dyld: Library not loaded: @rpath/RealmSwift.framework/RealmSwift
  Referenced from: /private/var/containers/Bundle/Application/0261FA92-7A16-4656-9F80-CE4DDE658031/ChartsDemo.app/Frameworks/ChartsRealm.framework/ChartsRealm
  Reason: image not found
Message from debugger: Terminated due to signal 6
@smawpaw
Copy link

smawpaw commented Jan 12, 2017

Hey @zip520123 try this:

First copy the Cartfile from /Charts-master to /Charts-master/ChartsDemo

Then from /ChartsDemo instead of carthage checkout run:

carthage update

Now open the ChartsDemo project in Xcode, select the Target and under the General tab go to Embedded Binaries and delete the existing Realm.framework entry

Then drag Realm.framework and RealmSwift.framework from /Charts-master/ChartsDemo/Carthage/Builds/iOS into Embedded Binaries

(Don't check "copy if needed")

Build and run. Should work now!

@pmairoldi
Copy link
Collaborator

I thought I added a script that automatically downloads the dependencies for the demo. Maybe I only added it to the framework. I'll look into it.

@smawpaw
Copy link

smawpaw commented Jan 13, 2017

@petester42 Seems like RealmSwift.framework isn't embedded in the demo project. I realized too late but a simpler solution to my quick fix above might be just to drag RealmSwift.framework from /Charts-master/Carthage/Builds/iOS into Embedded Binaries

@zip520123
Copy link
Author

It work.
Thank you @Mossby :)

@Uonlyliveonce
Copy link

@Mossby bingo! good job :]

@liuxuan30
Copy link
Member

oops, reopen as @petester42 is looking into it

@liuxuan30 liuxuan30 reopened this Jan 16, 2017
@liuxuan30
Copy link
Member

I saw @danielgindi added RealmSwift in RealmBaseDataSet.swift, but currently ChartsDemo does not have that framework under frameworks.
I got one question: Does Realm and RealmSwift are both needed? @danielgindi

Simply drag RealmSwift.framework into that folder and re-embed it and things went well then:
image

@pmairoldi
Copy link
Collaborator

Realm swift is referenced in ChartsRealm.framework now

@liuxuan30
Copy link
Member

@petester42 I had a PR #2083 for adding RealmSwift into project settings.
Since carthage already downloaded RealmSwift, will this PR be enough to run?

@liuxuan30
Copy link
Member

😂 just saw yours, closing my poor one

@pmairoldi
Copy link
Collaborator

I just submitted mine. It also fixes the test target not running.

hhanesand added a commit to abellono/Charts that referenced this issue Jan 31, 2017
* commit '853237172914b276809d5a821455f76eea67c766':
  Adds NSPhotoLibraryUsageDescription to plist of ChartsDemo to prevent crash on iOS 10 on try to store shot of char to photo library.
  update rakefile for ios 10.x simulators
  close ChartsOrg#2066
  fix a typo, as orientation is horizontal by default
  update configurations for xcode 8.2
  Update RealmSwift Dependency
  Fix NSCopying implementation in CandleChartDataEntry
  Add support for extensions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants