32

The following error occurs when trying to build an android app with cordova and the cordova-crosswalk plugin:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_armv7DebugCompile'.
   > Could not find any version that matches com.android.support:support-v4:+.
     Searched in the following locations:
         https://repo1.maven.org/maven2/com/android/support/support-v4/maven-metadata.xml
         https://repo1.maven.org/maven2/com/android/support/support-v4/
         https://download.01.org/crosswalk/releases/crosswalk/android/maven2/com/android/support/support-v4/maven-metadata.xml
         https://download.01.org/crosswalk/releases/crosswalk/android/maven2/com/android/support/support-v4/
     Required by:
         :android:unspecified

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

BUILD FAILED

Total time: 2.918 secs

/home/remi/dev/git/gitlab/sirap-sas/tereo-mobile/platforms/android/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error code 1 for command: /home/remi/dev/git/gitlab/sirap-sas/tereo-mobile/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/remi/dev/git/gitlab/sirap-sas/tereo-mobile/platforms/android/build.gradle,-PcdvBuildArch=arm,-Dorg.gradle.daemon=true
ERROR running one or more of the platforms: Error: /home/remi/dev/git/gitlab/sirap-sas/tereo-mobile/platforms/android/cordova/run: Command failed with exit code 1
You may not have the required environment or OS to run this project
Rémi Becheras
  • 14,902
  • 14
  • 51
  • 81

6 Answers6

64

Please notice that section:

Could not resolve all dependencies for configuration ':_armv7DebugCompile'.

It can happen because building an android project with the crosswalk plugin try to build two apks : one for ARM, the other for x86.

The solution is to install Android Support Repository :

  • Open the SDK manager (from command line, type android).
  • Under Extras, Make sure you have Android Support Repository and Google Repository downloaded.
Rémi Becheras
  • 14,902
  • 14
  • 51
  • 81
  • Im getting `Failed to create directory /usr/local/Cellar/android-sdk/23.0.2/temp` any idea why? –  Feb 01 '16 at 00:29
  • Please create a new question on stackoverflow for your issue. You can link it here, as a new comment, and link this answer to your question to explain the context of your question. If you link your question here, I could navigate to it and help you. NB: in your question, please post the result of the folowing commands : `sudo ls -ld /usr/local/Cellar`, `sudo ls -l /usr/local/Cellar/`, `sudo ls -l /usr/local/Cellar/android-sdk/` and `sudo ls -l /usr/local/Cellar/android-sdk/23.0.2` – Rémi Becheras Feb 01 '16 at 09:58
  • 1
    I installed both `Android Support Repository` and `Google Repository` , but again the same error :( – Vahid Najafi Aug 15 '16 at 08:16
  • In that case, please open a new question, link this question and this answer as a resolution start, explain that in your case it's not enough, and add a screen shot of the window opened when you run `android`, with all checked/unchecked checkboxes. Put as many screenshot you should to show all the scrollable view. Also, add informations about the command you run for compilation – Rémi Becheras Aug 16 '16 at 10:13
  • @delboud, if anyone gets `Failed to create directory ~/android-sdk//temp` first use `sudo -i` to use root CLI, then launch your Android SDK Manager with `android` then continue with this answer. Thumbs up @Rémi Becheras – Ema4rl Oct 17 '16 at 07:52
13

Update answer

Seems starting from crosswalk 16, Android Support Repository and Google Repository is not enough.

You need to install Local Maven repository for Support Libraries from Extras as well.

Rémi Becheras
  • 14,902
  • 14
  • 51
  • 81
zhanghaili
  • 141
  • 1
  • 3
  • 1
    Why I don't see that? – FrancescoMussi Jun 16 '16 at 07:21
  • I stumbled upon this: http://stackoverflow.com/questions/12382555/android-support-library-manual-download#answer-23436671 --- using the console and some digging you find out the `Local Maven repository for Support Libraries` refers to `Android Support Repository` and `Google Repository`. So I just installed both of them and were able to compile. – Seika85 Jul 13 '16 at 09:28
  • Addendum: It seems like it was renamed back and forth during earlier releases. – Seika85 Jul 13 '16 at 09:43
3

for me Solution was: i updated crosswalk to @15.44.384.13

ionic browser add crosswalk@15.44.384.13

then i changed config.xml:

<preference name="xwalkVersion" value="15+" />

cuz versions "16+" - "18+" not work for me

Artem Lanovyy
  • 101
  • 1
  • 2
3

It may be the problem when you did not include google support respository and android support repository under extras. as well as when you not update the cordova with your cordova platform.because cordova and cordova platform must be use latest version.update your Cordova with npm update cordova -g --save and cordova platform with cordova platform update platform_name(like android).

himanshu
  • 31
  • 1
0
This worked for me 

1.goto platforms\android\cordova-plugin-crosswalk-webview folder

2.Open .gradle file

3.find


    dependencies { compile xwalkSpec }

and replace with 

dependencies {
compile 'org.xwalk:xwalk_core_library:22.52.561.4' 
}

**

note: 22.52.561.4 is version of crasswalk on your machine to know it , open ionic app , chrome://inspect then

window.navigator.userAgent

This will print some lines , copy xwalk details from there

ganesh
  • 2,024
  • 16
  • 17
0

I know it's a little late to add an answer. but I faced this issue for a long time and none of these steps fixed it. If your IP is from Iran, then you should build your project with VPN on. It seems that dependencies are banned for some countries.