Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 1.09 KB

android-setup.md

File metadata and controls

42 lines (32 loc) · 1.09 KB

Android Setup

  1. 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
      );
    }
  };

  // ...
}
  1. Append the following lines to android/settings.gradle:
include ':react-native-alipay'
project(':react-native-alipay').projectDir = new File(rootProject.projectDir, '../node_modules/@0x5e/react-native-alipay/android')
  1. Insert the following lines inside the dependencies block in android/app/build.gradle:
    compile project(':react-native-alipay')
  1. Append the following lines to android/app/proguard-rules.pro
-keep class com.alipay.** { *; }