Ionic 3 project and plugin crosswalk error

馋奶兔 提交于 2019-12-03 05:18:41

The 01.org server seems to be down. So till the servers are back online, you can ask Gradle to use the local copy of Crosswalk.

I was having the same issue from last one hour. The following solution worked for me.

Open platforms\android\cordova-plugin-crosswalk-webview\*-xwalk.gradle file in your project directory, where * is your project name.

Look for the section -

dependencies {
    compile xwalkSpec
}

Replace it with your exact Crosswalk version which you find in Chrome Developer Tools by typing window.navigator.userAgent in your Developer Tools console.

So your final data would look something like this -

dependencies {
    compile 'org.xwalk:xwalk_core_library:23.53.589.4'
}

1 Get crosswalk version

There are another two ways to get xwalk_core_library version, you can use either of them:

  • Go to platforms/android/build/intermediates/exploded-aar/org.xwalk‌​/xwalk_core_library/‌​, then you can see version like 19.49.514.5

  • In the Google cache, you can select a version number

2 Change the gradle

Just like @hemantv said, in file platforms\android\cordova-plugin-crosswalk-webview*-xwalk.gradle

Change the file form

dependencies {
    compile xwalkSpec
}

to

dependencies {
    compile 'org.xwalk:xwalk_core_library:19.49.514.5'
}

19.49.514.5 is the version get from the step one.


Another way, you can use this plugin temporarily:

cordova plugin add https://github.com/zhouzhongyuan/cordova-plugin-crosswalk-webview

It just fixed this error.

Get Crosswalk version

As answered by Zhongyuan Zhou, there are ways to get locally saved Crosswalk library on your project, but I prefer the following:

Go to platforms/android/build/intermediates/exploded-aar/org.xwalk‌​/xwalk_core_library/‌​, then you can see version like 22.52.561.4

Modify config.xml

Add the following into your config.xml

<preference name="xwalkVersion" value="xwalk_core_library:22.52.561.4" />

Compile the Android build

Do the usual ionic cordova build android to build the Android APK or ionic cordova run android to build and run / install the Android app on an emulator or device.

Reference: https://forum.ionicframework.com/t/server-error-with-crosswalk-when-running-ionic-run-android/104009/15

This is follow up to hemantv's answer. I was panicking but his answer saved my day, and I was able to successfully compile the app using the locally stored xwalk.

This is what I did and i hope it helps someone out there who's stuck with the same predicament.

I found out the Crosswalk version I have stored locally by running a search (including sub directorys) for "xwalk_core_library" in my app directory and found the file "org.xwalk-xwalk_core_library-17.46.448.10_9bf812c8b76a44fdb31553d48df45b60d1362adc.jar" and figured out the version I had was "org.xwalk-xwalk_core_library-17.46.448.10" (everything after the underscore "_" is irrelevant)

I followed the instructions and opened up the platforms\android\cordova-plugin-crosswalk-webview*-xwalk.gradle in a text editor

found

dependencies {
    compile xwalkSpec
}

replaced with

dependencies {    
    compile 'org.xwalk:xwalk_core_library:17.46.448.10'
}

reattempted to compile and it worked like a charm.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!