请使用它并再次清理和构建..
In /android/settings.gradle file check following -
include ':react-native-razorpay'
project(':react-native-razorpay').projectDir = new
File(rootProject.projectDir, '../node_modules/react-native-
razorpay/android/app/')
在 android/app/build.gradle 文件中
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
dependencies {
compile project(':react-native-razorpay')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:25.0.1"
compile "com.facebook.react:react-native:+"
}
MainApplication.java
package com.example;
import android.app.Application;
import android.util.Log;
import com.facebook.react.ReactApplication;
import com.razorpay.rn.RazorpayPackage;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements
ReactApplication {
private final ReactNativeHost mReactNativeHost = new
ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RazorpayPackage()
);
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
}