Ionic 3项目和插件人行横道错误

asv*_*asv 15 ionic-framework crosswalk

我有一个Ionic 3项目,当我运行"ionic cordova run android --prod"时,我明白了

这个错误:

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).
Run Code Online (Sandbox Code Playgroud)

在运行Ionic之前我没有收到此错误.

hem*_*ntv 27

01.org服务器似乎已关闭.因此,在服务器重新联机之前,您可以要求Gradle使用Crosswalk的本地副本.

我在过去的一个小时内遇到了同样的问题.以下解决方案对我有用.

打开平台\ android\cordova-plugin-crosswalk-webview\* -项目目录中的xwalk.gradle文件,其中*是您的项目名称.

寻找部分 -

dependencies {
    compile xwalkSpec
}
Run Code Online (Sandbox Code Playgroud)

在开发人员工具控制台中输入window.navigator.userAgent,将其替换为您在Chrome开发者工具中找到的确切Crosswalk版本.

所以你的最终数据看起来像这样 -

dependencies {
    compile 'org.xwalk:xwalk_core_library:23.53.589.4'
}
Run Code Online (Sandbox Code Playgroud)

  • 作为补充,还有另外两种获取xwalk_core_library版本的方法,您可以使用其中任何一种: - 1.转到`platforms/android/build/intermediates/explosion-aar/org.xwalk/xwalk_core_library /`,然后就可以了看到像"19.49.514.5"这样的版本<br /> - 2.在[Google缓存]中(https://webcache.googleusercontent.com/search?q=cache:nAtp2KW5upYJ:https://download.01.org/ crosswalk/releases/crosswalk/android/maven2/org/xwalk/xwalk_core_library/+&cd = 1&hl = en&ct = clnk),你可以选择一个版本号 (2认同)

Zho*_*hou 8

1 获取人行横道版本

获取xwalk_core_library版本还有另外两种方法,您可以使用其中任何一种:

  • 转到platforms/android/build/intermediates/explosion-aar/org.xwalk/xwalk_core_library /,然后就可以看到版本了 19.49.514.5

  • Google缓存中,您可以选择版本号

2 更换平板

就像@hemantv所说,在文件平台\ android\cordova-plugin-crosswalk-webview*-xwalk.gradle

更改文件格式

dependencies {
    compile xwalkSpec
}
Run Code Online (Sandbox Code Playgroud)

dependencies {
    compile 'org.xwalk:xwalk_core_library:19.49.514.5'
}
Run Code Online (Sandbox Code Playgroud)

19.49.514.5是从第一步获得的版本.


另一种方法,你可以暂时使用这个插件:

cordova plugin add https://github.com/zhouzhongyuan/cordova-plugin-crosswalk-webview
Run Code Online (Sandbox Code Playgroud)

它只是解决了这个错误.