Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android build error in Crosswalk

I am working on an ionic 2 app for few weeks and it was working fine yesterday but today when I am trying to build and test it on my android device using following command:

ionic run android

I am getting following error in crosswalk:

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: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/crossw alk/releases/crosswalk/android/maven2/org/xwalk/xwalk_core_library/maven-metadat a.xml. Could not GET 'https://download.01.org/crosswalk/releases/cross walk/android/maven2/org/xwalk/xwalk_core_library/maven-metadata.xml'. Received s tatus code 403 from server: Forbidden

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

I haven't changed anything in code since yesterday.

It is trying to fetch some data from following url: https://download.01.org/crosswalk/releases/crosswalk/android/maven2/org/xwalk/xwalk_core_library/maven-metadata.xml

Which at this moment in time is giving a 403. I had even tried it without internet connection but it didn't work.

I had tried to go to cross-walk website for any solution but I couldn't even get access to www.crosswalk-project.org

Does anyone know any way around of this issue?

like image 885
Rohit Gupta Avatar asked Jan 30 '17 08:01

Rohit Gupta


1 Answers

After some research and changes with gradle file, I have found a solution:

"Define fixed cross-walk version in android gradle file" as followed:

In your platforms\android\cordova-plugin-crosswalk-webview folder, there is a gradle file. -> Open the file and find following code:

dependencies {
compile xwalkSpec
}

-> replace the code with following:

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

And try to build it with

ionic run android

It is working for me.

Updated:

If simply replacing the code,as i have suggested, is not working for you then this is exactly what I have done:

As most of you know, when we specify dependency in gradle file, It downloads that dependency from some server and use it in the project but if the "exact" dependency is already used in same/other project in our pc, It reuses the previously downloaded dependency instead of going out to server.

So I have opened my ionic app(by previously installed or generated apk) and inspected it using Chrome-Developer-Tool. Then I have typed following command in Console:

window.navigator.userAgent

And i have got :

"Mozilla/5.0 (Linux; Android 5.1; genymotion_vbox86p_5.1_150609_195503 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Crosswalk/23.53.589.4 Mobile Safari/537.36"

The response contains the latest Crosswalk version that my gradle build was using so I just used that specific version in the gradle file because I know that It has been already downloaded and it worked.

I hope these steps will be helpful to some of you to solve this issue.

like image 55
Rohit Gupta Avatar answered Sep 27 '22 17:09

Rohit Gupta