Skip to content

Commit 40e8c0b

Browse files
rommyarbkrizzu
authored andcommitted
chore(docs): Adds Android manual linking
1 parent b3da569 commit 40e8c0b

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

docs/Linking.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,38 @@
22

33
## iOS
44

5-
## Android
5+
## Android
6+
1. Add project to `android/settings.gradle`:
7+
```diff
8+
rootProject.name = 'MyApp'
9+
10+
include ':app'
11+
12+
+ include ':@react-native-community_async-storage'
13+
+ project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android')
14+
```
15+
16+
2. In `android/app/build.gradle` add to dependencies:
17+
```diff
18+
dependencies {
19+
...
20+
+ implementation project(':@react-native-community_async-storage')
21+
}
22+
```
23+
24+
3. Then, in `MainApplication.java`:
25+
```diff
26+
package com.myapp;
27+
28+
+ import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
29+
30+
...
31+
32+
@Override
33+
protected List<ReactPackage> getPackages() {
34+
return Arrays.<ReactPackage>asList(
35+
new MainReactPackage(),
36+
+ new AsyncStoragePackage()
37+
);
38+
}
39+
```

0 commit comments

Comments
 (0)