mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-05-19 19:39:54 +08:00
25
README.md
25
README.md
@@ -282,7 +282,7 @@ After installing the plugin and syncing your Android Studio project with Gradle,
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Plugin Configuration (Android - React Native v0.18.0+)
|
||||
|
||||
*NOTE: These instructions are specific to apps that are using React Native v0.18.0+. If you are using v0.15.0-v0.17.0, then refer to the previous section.*
|
||||
@@ -324,8 +324,29 @@ After installing the plugin and syncing your Android Studio project with Gradle,
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
2. If you used RNPM to install/link the CodePush plugin, there are two additional changes you'll need to make due to the fact that RNPM makes some assumptions about 3rd party modules that we don't currently support. If you're not using RNPM then simply skip to step #3:
|
||||
|
||||
2. Ensure that the `android.defaultConfig.versionName` property in your `android/app/build.gradle` file is set to a semver compliant value. Note that if the value provided is missing a patch version, the CodePush server will assume it is `0`, i.e. `1.0` will be treated as `1.0.0`.
|
||||
```java
|
||||
...
|
||||
// 1. Remove the following import statement
|
||||
import com.microsoft.codepush.react.CodePushReactPackage;
|
||||
...
|
||||
public class MainActivity extends ReactActivity {
|
||||
...
|
||||
@Override
|
||||
protected List<ReactPackage> getPackages() {
|
||||
return Arrays.<ReactPackage>asList(
|
||||
...
|
||||
new CodePushReactPackage() // 2. Remove this line
|
||||
...
|
||||
);
|
||||
}
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
3. Ensure that the `android.defaultConfig.versionName` property in your `android/app/build.gradle` file is set to a semver compliant value. Note that if the value provided is missing a patch version, the CodePush server will assume it is `0`, i.e. `1.0` will be treated as `1.0.0`.
|
||||
|
||||
```gradle
|
||||
android {
|
||||
|
||||
Reference in New Issue
Block a user