Crosswalk's WebView for React Native on Android.
- From the root of your React Native project
npm install react-native-webview-crosswalk --save
mkdir android/app/libs
cp node_modules/react-native-webview-crosswalk/libs/xwalk_core_library-18.48.477.13.aar android/app/libs/
- In
android/setting.gradle
...
include ':CrosswalkWebView', ':app'
project(':CrosswalkWebView').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview-crosswalk')
- 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
...
dependencies {
...
compile (name: "xwalk_core_library-18.48.477.13", ext: "aar") // <--- add this line
compile project(':CrosswalkWebView') // <--- add this line
}
- Register package in MainActivity.java
import com.jordansexton.react.crosswalk.webview.CrosswalkWebViewPackage; // <--- add this line
public class MainActivity extends ReactActivity {
......
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new CrosswalkWebViewPackage(this) // <--- add this line
);
}
......
}
MIT