Ionic 3项目crosswalk报错:Could not resolve org.xwalk:xwalk_core_library:23 .
启动Ionic 3项目:
ionic cordova run android --prod
报错信息:
> Could not resolve all dependencies for configuration ':_armv7DebugApkCopy'.
> Could not resolve org.xwalk:xwalk_core_library:23+.
Required by:
project :
> Could not resolve org.xwalk:xwalk_core_library:23+.
> Failed to list versions for org.xwalk:xwalk_core_library.
> Unable to load Maven meta-data from https://download.01.org/crosswalk/releases/crosswalk/android/maven2/org /xwalk/xwalk_core_library/maven-metadata.xml.
> Could not GET 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2/org/xwalk/xwalk\_core\_ library/maven-metadata.xml'. Received status code 503 from server: Service Unavailable* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Error: cmd: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.
解决方法:
这可能是01.org服务器的问题,可以让Gradle使用Crosswalk本地的副本。
获取Crosswalk版本的两种方法:
- 在platforms/android/build/intermediates/exploded-aar/org.xwalk/xwalk_core_library/目录下可以找到类似23.53.589.4的版本号
- 在 Google cache选对应的版本号
修改gradle
打开项目下的platforms\android\cordova-plugin-crosswalk-webview\*-xwalk.gradle,其中*为项目名,把
dependencies {
compile xwalkSpec
}
修改为指定Crosswalk的版本号
dependencies {
compile 'org.xwalk:xwalk_core_library:23.53.589.4'
}