Skip to content

Commit 1567d31

Browse files
iamxicoralvaromb
authored andcommitted
Added Manual Installation Steps for Android (#23)
* Added Manual Installation Steps for Android Added descriptive manual linking process for android * Update README.md * Update README.md
1 parent 0fa9975 commit 1567d31

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,48 @@ Link
2727

2828
`$ react-native link`
2929

30+
#### Manual installation
31+
32+
**Android:**
33+
34+
1. In your android/settings.gradle file, make the following additions:
35+
```java
36+
include ':react-native-version-number'
37+
project(':react-native-version-number').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-version-number/android')
38+
```
39+
40+
2. In your android/app/build.gradle file, add the `:react-native-version-number` project as a compile-time dependency:
41+
42+
```java
43+
...
44+
dependencies {
45+
...
46+
compile project(':react-native-version-number')
47+
}
48+
```
49+
50+
3. Update the MainApplication.java file to use `react-native-version-number` via the following changes:
51+
52+
```java
53+
import com.apsl.versionnumber.RNVersionNumberPackage;
54+
55+
public class MainApplication extends Application implements ReactApplication {
56+
57+
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
58+
...
59+
@Override
60+
protected List<ReactPackage> getPackages() {
61+
return Arrays.<ReactPackage>asList(
62+
new MainReactPackage(),
63+
new RNVersionNumberPackage(), // here
64+
);
65+
}
66+
};
67+
...
68+
}
69+
```
70+
71+
3072
## Usage
3173
```javascript
3274
import VersionNumber from 'react-native-version-number';

0 commit comments

Comments
 (0)