It is a template that you can clone and reuse for every project. It is starting point for React Native application.
consist of:
- react-native": "0.64.0"
- react-navigation and its dependencies
- redux, redux persist and redux thunk
- react native vector icons
- react-native async storage
-
Clone this repo,
git clone https://github.com/handi-dev/react-native-boilerplate.git <your project name>
-
Go to project's root directory,
cd <your project name>
-
Remove
.git
folder,rm -rf .git
-
Use React Native Rename to update project name
$ npx react-native-rename <newName>
-
Run
npm install
to install dependencies -
Run
npx pod-install
from root of your project.If you got error like:
The version of CocoaPods used to generate the lockfile (x.x.x) is higher than the version of the current executable (x.x.x)
, then you can upgrade your cocoapods version.If you install cocoapods using homebrew, you can using this command:
brew upgrade cocoapods
if that does not work, trybrew install cocoapods
.If you previously install using
gem
, then use this command and run on your terminal:sudo gem install cocoapods
.make sure your cocoapods version is updated after run that command.
To check your current version of cocoapods, run
pod --version
.After that, don't forget to execute in your terminal
pod repo update
And, finally, run
npx pod-install
. Those methods must be solved that problem.Last method: If All the above steps not work, remove
Podfile.lock
in folderios
, and then runnpx pod-install
. -
Start the packager with
npm start
-
Connect your device or use emulator that's installed in your pc
-
Run the test application:
- On Android:
- Run
npx react-native run-android
- Run
- On iOS:
- Open
npx react-native run-ios
- Open
- Enjoy!!!
Run this command chmod 755 android/gradlew
from your root project directory
I got error Error: SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
-
Go to your Project -> Android
-
Create a file local.properties
-
Open the file
-
Paste your Android SDK path depending on the operating system:
- Windows:
sdk.dir=C:/Users/
USERNAME
/AppData/Local/Android/sdk - Linux or MacOS
sdk.dir=/home/
USERNAME
/Android/sdk
- Windows:
sdk.dir=C:/Users/
-
Replace
USERNAME
with your PC username