问题描述
我有一个Ionic 3项目,当我运行ionic cordova run android --prod时,我看到
I have a Ionic 3 project, when I run "ionic cordova run android --prod" I see
此错误:
ANDROID_HOME=C:\Users\asus\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_86b8k75dm7qqz7n5jyg9xp8kh.run(D:\project\ionic\MyProject\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 TaskInp uts.file(Object).skipWhenEmpty() instead.
FAILURE: Build failed with an exception.
* What went wrong:
BUILD FAILED
Total time: 15.644 secs 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
* 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.
* 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
* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova run android (exit code 1).
在运行Ionic之前我没有收到此错误。
I did not recieve this error before running Ionic.
推荐答案
01.org服务器似乎已关闭。因此,在服务器重新联机之前,您可以要求Gradle使用Crosswalk的本地副本。
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.
打开 platforms\android\cordova-plugin-crosswalk-webview \ * -xwalk.gradle 文件在项目目录中,其中*是您的项目名称。
Open platforms\android\cordova-plugin-crosswalk-webview\*-xwalk.gradle file in your project directory, where * is your project name.
查找部分 -
dependencies {
compile xwalkSpec
}
将其替换为您在Chrome开发者工具中找到的确切Crosswalk版本在开发人员工具控制台中输入 window.navigator.userAgent 。
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'
}
这篇关于Ionic 3项目和插件人行横道错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!