构建 android 应用程序时出错 (cordova-plugin-crosswalk-webview)
Posted
技术标签:
【中文标题】构建 android 应用程序时出错 (cordova-plugin-crosswalk-webview)【英文标题】:Error with building android app (cordova-plugin-crosswalk-webview) 【发布时间】:2018-02-12 01:10:49 【问题描述】:λ cordova build android
ANDROID_HOME=C:\Users\yiiwe\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131
Subproject Path: CordovaLib
null
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_a8zaoms8z5a2cue9ld42c2tqy.run(C:\Users\yiiwe\Desktop\crypt2\platforms\android\build.gradle:138)
org.xwalk:xwalk_core_library:23+
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
BUILD FAILED
Total time: 10.564 secs
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: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
问题从昨天开始。
https://download.01.org/crosswalk/releases/crosswalk/android/maven2/org/xwalk/xwalk_core_library/maven-metadata.xml 不可用。
更新插件 cordova-plugin-crosswalk-webview 没有帮助。 在 config.xml 中写入变量 name="XWALK_VERSION" value="17+" 没有帮助。 已安装 Android 支持存储库和 Google 存储库。当我删除该插件时,移动设备上的应用程序会无限加载。
【问题讨论】:
【参考方案1】:-
在您的项目根目录中运行
find . -name "*xwalk_core_library*"
。
打开preview-xwalk.gradle
并将compile xwalkSpec
行替换为compile 'org.xwalk:xwalk_core_library:VERSION'
,其中VERSION
是第1步命令返回的版本。
示例:
当我运行find . -name "*xwalk_core_library*"
时,我得到结果:
./android/.idea/libraries/xwalk_core_library_20_50_533_12.xml
基于此,我在preview-xwalk.gradle
中的行将如下所示:
compile 'org.xwalk:xwalk_core_library:20.50.533.12'
【讨论】:
【参考方案2】:在 android 项目 *.gradle 中更改你的 gradle 文件 ...
在 xWALK 部分..
dependencies
compile 'org.xwalk:xwalk_core_library:23.53.589.4'
【讨论】:
【参考方案3】:我收到了相同的错误消息,并按照本指南进行了修复:https://forum.ionicframework.com/t/server-error-with-crosswalk-when-running-ionic-run-android/104009/7
【讨论】:
以上是关于构建 android 应用程序时出错 (cordova-plugin-crosswalk-webview)的主要内容,如果未能解决你的问题,请参考以下文章
生成签名的 APK:构建 APK Android Studio 时出错
值-lddtr-v21.xml错误+ AAPT2尝试在Android中构建时出错
Eclipse / Android:“在项目上运行构建器'Android Pre Compiler'时出错......”