Skip to content

Initial setup clarification  #125

@berrymat

Description

@berrymat

Apologies, but I am a total beginner and had some issues getting set up. I started by creating a new React Native project using:

react-native init TestProject

This created the initial TestProject folder with sub-folders for ios and android. I went ahead and did:

cd TestProject
npm install --save react-native-sqlite-storage

I then wanted to setup my iOS project with CocoaPods and so:

cd ios
pod init

I then wanted to add the entry for this pod to my PodFile, but the line in the ReadMe seems incorrect because the node_modules folder is in my parent directory. I needed to use:

pod 'react-native-sqlite-storage', :path => '../node_modules/react-native-sqlite-storage'

Then on doing pod install I received a deprecated warning about React 0.11. What was worse was that running react-native run-ios failed with duplicate package issues. Indeed, from what I could see I had a React folder under react-native in my node_modules folder and another one under the Pods folder in ios.

After looking through the issues here I found this #84 which gave me a hint!

I started over and this time after npm installing react-native-sqlite-storage I edited the podspec file and removed:

  s.dependency 'React'

I then added both these lines to my PodFile:

  pod 'React', :path => '../node_modules/react-native'
  pod 'react-native-sqlite-storage', :path => '../node_modules/react-native-sqlite-storage'

As I know very little(!) I wanted to confirm that this is a correct approach and also wanted to put this information out there for others who might run into this.

I'm also happy to submit a pull request if that would help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions