Skip to content

Latest commit

 

History

History
116 lines (86 loc) · 3.34 KB

README.md

File metadata and controls

116 lines (86 loc) · 3.34 KB

react-native-starter-app

This is a demo app demonstrating how to make an app using react-native. This is still in development and you can make pull reaquests. Changes and suggestions are welcome.
You can use this template as a refrence to start react-native app.

To run this project first install react-native CLI
Run npm install -g create-react-native-app

Download or Clone this repo https://github.com/Ravi448/react-native-starter-app.git

Run npm install

To run this project for android, navigate to project directory then android and open local.properties file and change your sdk path

Run react-native run-android

To run on iOS, You must have to install Xcode on your mac.
Run rect-native run-ios

Android build issue

If you face issue to build in android due to camera component, please follow the steps to install camera component from npm install react-native-camera --save

Then link the component to react native: react-native link react-native-camera

Now:

Step 1

Navigate to android/build.gradle and add following code:

maven { url "https://jitpack.io" } maven { url "https://maven.google.com" }

Step 2

Navigate to node_modules/react-native-camera/android/build.gradle and remove or comment google()

Now your code will look like:

buildscript { repositories { jcenter() // google() maven { url 'https://maven.google.com' } }
dependencies {
  classpath 'com.android.tools.build:gradle:3.0.0'
}

}

Step 3

Now at the bottom of the above build.gradle file: Change compileOnly to provided & implementation to compile

Now this will look like:

dependencies { def googlePlayServicesVersion = rootProject.hasProperty('googlePlayServicesVersion') ? rootProject.googlePlayServicesVersion : DEFAULT_GOOGLE_PLAY_SERVICES_VERSION def supportLibVersion = rootProject.hasProperty('supportLibVersion') ? rootProject.supportLibVersion : DEFAULT_SUPPORT_LIBRARY_VERSION
provided 'com.facebook.react:react-native:+'
provided 'com.facebook.infer.annotation:infer-annotation:+'
compile "com.google.zxing:core:3.2.1"
compile "com.drewnoakes:metadata-extractor:2.9.1"
compile "com.google.android.gms:play-services-vision:$googlePlayServicesVersion"
compile "com.android.support:exifinterface:$supportLibVersion"
compile "com.android.support:support-annotations:$supportLibVersion"
compile "com.android.support:support-v4:$supportLibVersion"

}

Step 4

Navigate to android/app/build.gradle and set compileSdkVersion 26

Step 5

Add project.ext.react = [ entryFile: "index.js", bundleAssetName: "index.android.bundle", bundleInAlpha: true, bundleInBeta: true ] in build.gradle before line: apply from: "../../node_modules/react-native/react.gradle"

By following these steps, you can solve android build issue.

If you still face any issue, please add an issue.


Author :  Ravi KUMAR
Standard Licence:  MIT
Privacy : NONE
Usablity: Everyone