10

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?

Rohit Gupta
  • 1,368
  • 1
  • 14
  • 30
  • looks like some issue with their site.. maven downloads dependencies from the host.. – Suraj Rao Jan 30 '17 at 08:42
  • We experience the same thing. Have somebody idea who we can contact to solve the situation? – Jan Záruba Jan 30 '17 at 08:58
  • @JanZáruba If you need solution, I have posted one. – Rohit Gupta Jan 30 '17 at 09:11
  • 2
    When websites fail, one way to get some support is IRC. The Freenode IRC network is still very much alive and kicking especially for techies, and has e.g. a #crosswalk -channel. That is how I found out about this question, and the potential solution below. IRC etiquette takes some getting used to though. Please don't expect instant responses, you might have to hang around for a long while for someone who knows things to notice your message. So log on, post a question, and go do something else. – Janne Enberg Jan 30 '17 at 11:32

1 Answers1

9

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.

Rohit Gupta
  • 1,368
  • 1
  • 14
  • 30
  • It seems that at the moment their download servers are quite flaky, and even with this change you sometimes get 403 errors from them. The whole Intel Open Source Technology Center and everything they're hosting is quite unstable or simply unavailable as it is. After making this change I managed to make a successful build on the 3rd try. However I'm not sure if making this change helped at all or not. – Janne Enberg Jan 30 '17 at 11:23
  • 1
    Thanks - this works for us. 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: https://webcache.googleusercontent.com/search?q=cache:c5JSA2watLkJ:https://download.01.org/crosswalk/releases/crosswalk/android/maven2/org/xwalk/xwalk_core_library/maven-metadata.xml+&cd=1&hl=en&ct=clnk&gl=uk – Darshan Jan 30 '17 at 11:52
  • @Darshan I checked out the link you provided and I used 21.51.546.7. That worked for me. – hswner Jan 30 '17 at 13:59
  • This doesn't seem to work for my Cordova build... is this an Ionic only fix? – Matthew Jan 30 '17 at 14:57
  • 1
    @Matthew Now the issue with download servers of crosswalk has been resolved so there is no need to change anything and the build process is working fine now. – Rohit Gupta Jan 31 '17 at 04:40
  • @RohitGupta Thanks for the reply. – Matthew Jan 31 '17 at 18:30