Skip to content

Commit 498c70c

Browse files
feat: add Android Multiple environment configuration to README (#22)
* feat: add Android Multiple environment configuration to README * Update README.md Co-authored-by: Chanaka Athurugiriya <[email protected]>
1 parent 0fbbd0e commit 498c70c

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ if(Platform.OS === 'android') {
100100

101101
#### Android
102102

103-
1. Open up `android/app/src/main/java/[...]/MainActivity.java`
103+
1. Open up `android/app/src/main/java/[...]/MainApplication.java`
104104
- Add `import com.reactlibrary.RNConfigReaderPackage;` to the imports at the top of the file
105105
- Add `new RNConfigReaderPackage()` to the list returned by the `getPackages()` method
106106
2. Append the following lines to `android/settings.gradle`:
@@ -113,6 +113,27 @@ if(Platform.OS === 'android') {
113113
compile project(':react-native-config-reader')
114114
```
115115

116+
##### Android advanced configurations with Multiple environments
117+
118+
If your app uses an `applicationIdSuffix` or a different `applicationId` depending on the build variants, you must append the following line inside the `buildTypes` block in your `android/app/build.gradle` file and specify your new package name.
119+
120+
```
121+
resValue "string", "rn_config_reader_custom_package", "com.yourNewPackage"
122+
```
123+
124+
Example
125+
126+
```
127+
buildTypes {
128+
...
129+
debug {
130+
...
131+
applicationIdSuffix ".dev"
132+
resValue "string", "rn_config_reader_custom_package", "com.yourNewPackage"
133+
}
134+
}
135+
```
136+
116137
#### Windows (Beta)
117138
[Read it!](https://github.com/ReactWindows/react-native)
118139

0 commit comments

Comments
 (0)