question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Follow-up to adding a Podspec

See original GitHub issue

Once https://github.com/realm/realm-js/pull/2586 merge, we still have a few outstanding changes to the codebase and docs:

  • Remove the hint about running “react-native link realm”.
  • Read CONTRIBUTING.md to ensure nothing is outdated and write https://github.com/realm/realm-js/blob/master/CONTRIBUTING.md#how-to-debug-react-native-podspec
  • Update docs to ensure it’s not mentioning running “react-native link realm”, including instructions to manually link.
  • ~Run “pod lib lint --verbose” on CI (from node_modules/realm of a React Native app)~ As we pod install in the integration tests, this is probably not needed.
  • Write about the caveats of the “use_frameworks!” support.
  • Consider using a global to make Realm JS depend on the React framework, instead of reading the users Podfile (which is a hack).
  • GCDWebServer is now a CocoaPod dependency and since Android uses NanoHttpd we can remove the GCDWebServer submodule from the repository.
  • Depend on a specific major version of GCDWebServer.
  • Investigate if we could provide a way of building Realm JS with the debug version of the shared library.
  • Update the example app by unlinking Realm JS.
  • Setup an install test on CI (with and without use_frameworks! - see https://blog.cocoapods.org/CocoaPods-0.36/).

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
davidnuvolarcommented, Jan 15, 2020

@ioveracker found the root cause of the issue! If you just care about the solution, upgrading your realm dependency to 3.6.0 should fix this. It was fixed in this PR https://github.com/realm/realm-js/pull/2623/

If someone is curious and wants to know more: What is the checksum we see in the Podfile.lock? It is just the SHA1 from the Podfile.lock.json You can get the hash by running from the command line: cat /path/to/your/react-native/project/ios/Pods/Local\ Podspecs/RealmJS.podspec.json | openssl sha1

So if different computers are producing different hashes, it means the content of that json file must be different. That’s exactly what’s happening here. In the Podspec from version 3.4.2, line 78, https://github.com/realm/realm-js/blob/6e28389898a6276459b95e1c861a4166e87a69d0/RealmJS.podspec#L78 the code generates an absolute path when building your local json podspec. Because of this, different computers with the project in different locations will generate different checksum for this pod.

In version 3.6.0 this has been changed to https://github.com/realm/realm-js/blob/13a6fc834a656c1d0551fea3ca82318aa61fb28e/RealmJS.podspec#L86 and now it uses an environment variable. Because of this, the checksum will match even if the location of the project is different.

3reactions
kraenhansencommented, Jan 15, 2020

Awesome @davidnuvolar! Thanks for getting to the bottom of this, its a nice side-effect of not having absolute paths produced by the Podspec.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Specs and the Specs Repo - CocoaPods Guides
A Podspec, or Spec, describes a version of a Pod library. One Pod, over the course of time, will have many Specs. It...
Read more >
add a User Header Search Path to a podspec - Stack Overflow
Add this code to your .podspec file: s.xcconfig = { 'USER_HEADER_SEARCH_PATHS' => '"${PROJECT_DIR}/.."' } To set path recursive :
Read more >
Creating a Private CocoaPod | Grio Blog
To add the private Podspec to your local CocoaPods installation, run the following command: [code gutter=”false”] pod repo add [REPO_NAME] ...
Read more >
Distributing Compiled Swift Frameworks via Cocoapods
This is a followup post to Distributing Swift Frameworks via Cocoapods. In my previous post, we learnt how to distribute a Swift Framework ......
Read more >
How to Fix Cocoapods Install Errors on an Apple Silicon Macs
This is a followup tutorial on how to fix and correctly install Cocoapods on your Apple Silicon machine(M1,M2).MacOS comes preinstalled with ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found