Forked from jordansexton. Not contributed for two years. Some bugs fixed and added dynamic build.gradle(which taking android compile and sdk versions from ext object)
react-native >=0.59.8
,react >= 16.8.3
- From the root of your React Native project
npm install react-native-crosswalk-do --save
node_modules/react-native-crosswalk-do/libs/xwalk_core_library-23.53.589.4-arm.aar
to your
android/app/libs
- In
android/setting.gradle
...
include ':CrosswalkWebView', ':app'
project(':CrosswalkWebView').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-crosswalk-do')
- In
android/build.gradle
...
allprojects {
repositories {
mavenLocal()
jcenter()
flatDir { // <--- add this line
dirs 'libs' // <--- add this line
} // <--- add this line
}
}
- In
android/app/build.gradle
(I guess in latest version you don't need to add)
...
dependencies {
...
implementation (name: "xwalk_core_library-23.53.589.4-arm", ext: "aar") // <--- add this line
implementation project(':CrosswalkWebView') // <--- add this line
}
- Register package, sdd code into MainApplication.java:
import com.rafaelhovhannisyan.react.crosswalk.webview.CrosswalkWebViewPackage; // <--- add this line
public class MainApplication extends Application implements ReactApplication {
......
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new CrosswalkWebViewPackage() // <--- add this line
);
}
......
}
MIT