- Open up
android/app/src/main/java/[...]/MainApplication.java
, add new AlipayPackage()
to the list returned by the getPackages()
method like this:
// ...
import com.reactlibrary.AlipayPackage;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
// ...
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new AlipayPackage() // Add this line
);
}
};
// ...
}
- Append the following lines to
android/settings.gradle
:
include ':@0x5e_react-native-alipay'
project(':@0x5e_react-native-alipay').projectDir = new File(rootProject.projectDir, '../node_modules/@0x5e/react-native-alipay/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:
compile project(':@0x5e_react-native-alipay')
- Insert the following lines inside allprojects => repositories in
android/build.gradle
:
flatDir {
dirs "$rootDir/../node_modules/@0x5e/react-native-alipay/android/libs"
}
- Append the following lines to
android/app/proguard-rules.pro
-keep class com.alipay.** { *; }