【Ionic】Ionic Android 打包 Crosswalk报错问题的解决方案

时间:2022-02-12 22:58:36

问题描述:

使用

ionic build android

打包编译时,遇到报错说crosswalk的有个文件访问不到了,具体如下

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_armv7DebugApkCopy'.
   > Could not resolve org.xwalk:xwalk_core_library:22+.
     Required by:
         :android:unspecified
      > Could not resolve org.xwalk:xwalk_core_library:22+.
         > Failed to list versions for org.xwalk:xwalk_core_library.
            > Unable to load Maven meta-data from https://download.01.org/crosswalk/releases/crosswa
lk/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 Unav
ailable

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more l
og output.


解决方案:

修改android平台下的文件配置,具体为

{project_path}/platforms/android/cordova-plugin-crosswalk-webview/

下的文件,文件名应该是xxx-xwalk.gradle

找到下面这一段

dependencies {
compile xwalkSpec
}

替换为

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

其中冒号之后的数字为Google上的cache的地址(可能会变化,如果需要参考下面的xml缓存的文件链接做替换)


Note to anyone else: if you are not on the latest version, you need to use the version of xwalk you are using (e.g. 15.44.384.13) You can get this from the cached version of the .xml page:


如果你不需要最新的版本,你需要使用你使用的xwalk的版本。你可以从缓存的xml文件中获取到:

http://webcache.googleusercontent.com/search?q=cache:c5JSA2watLkJ:https://download.01.org/crosswalk/releases/crosswalk/android/maven2/org/xwalk/xwalk_core_library/maven-metadata.xml&num=1&hl=en&gl=uk&strip=0&vwsrc=0

(此地址需要FQ,google地址你懂的)


原文问答地址:

https://*.com/questions/41931585/android-build-error-in-crosswalk?answertab=votes#tab-top