0
votes

There are lots of issues talking about Phonegap push notification plugin. May be it's updating time to time, some working solutions for some people not work for others.
I just created a fresh phonegap project(CLI 5.1.1) and added android platform and above plugin. When trying to compile it's failing with below error

Could not find any version that matches com.android.support:support-v13:23+

Below is the detailed compile error

Running command: cmd "/s /c "C:\Users\me\Documents\PhoneGap_Apps\hello\plat forms\android\cordova\build.bat""

ANDROID_HOME=F:\Softwares\Android\adt-bundle-windows-x86_64-20140702\sdk

JAVA_HOME=C:\Program Files\Java\jdk1.7.0_45

Running: C:\Users\me\Documents\PhoneGap_Apps\hello\platforms\android\gradle w cdvBuildDebug -b C:\Users\me\Documents\PhoneGap_Apps\hello\platforms\andr oid\build.gradle -Dorg.gradle.daemon=true

FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring root project 'android'.

    Could not resolve all dependencies for configuration ':_debugCompile'. Could not find any version that matches com.android.support:support-v13:23+ . Searched in the following locations:

    https://repo1.maven.org/maven2/com/android/support/support-v13/maven-me tadata.xml

    https://repo1.maven.org/maven2/com/android/support/support-v13/

    file:/F:/Softwares/Android/adt-bundle-windows-x86_64-20140702/sdk/extra s/android/m2repository/com/android/support/support-v13/maven-metadata.xml

    file:/F:/Softwares/Android/adt-bundle-windows-x86_64-20140702/sdk/extra s/google/m2repository/com/android/support/support-v13/maven-metadata.xml

    file:/F:/Softwares/Android/adt-bundle-windows-x86_64-20140702/sdk/extra s/google/m2repository/com/android/support/support-v13/ 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

How to overcome this issue?

4

4 Answers

2
votes

Update you Android SDK.

The Cordova Plugin named "phonegap-plugin-push" needs "Android Support Library version 23"

Process is explain in here

Compiling

As of version 1.3.0 the plugin has been switched to using Gradle/Maven for building. You will need to ensure that you have installed the Android Support Library version 23 or greater.

1
votes

According to the error message, it's looking for a support-v13 version in the location of <my_sdk>/extras/android/m2repository/com/android/support/support-v13
And this happens because of my plugin.xml (at my_phonegap_app/plugins/phonegap-plugin-push) having below line

<framework src="com.android.support:support-v13:23+" />

But I noticed that I don't have any 23+ versions in my above sdk path and I do have a folder 22.2.0 as the latest. Inside that folder there are support-v13-22.2.0 files. So update the plugin.xml file so that it refers to one of existing.

<framework src="com.android.support:support-v13:22.2.0" />

To be safe enough, remove android platform and re add it before compiling

phonegap platform remove android
phonegap platform add android

Then try compile. Now it refers for the correct, existing file and compile will get success.

0
votes

After spending 2h on trying build apk with phonegap-plugin-push plugin I found solution.

  1. In config.xml of your cordova project (in your main directory), just edit or add this line:

    <preference name="android-targetSdkVersion" value="23"/>
    
  2. Then remove android platform:

    cordova platform add android
    
  3. And add it again:

    phonegap platform add android
    
0
votes

I had a similar/the same problem when running cordova 6.0.0 project in Visual Studio 2015

Debugging in VS Emulator and Ripple works but not on the device (Sony Xperia Z5 Compact) Build error output contained the error "Could not find any version that matches com.android.support:support-v13:23+."

Severity Code Description Project File Line Suppression State Error > Could not find any version that matches com.android.support:support-v13:23+.

I checked that I had the correct SDK tools etc installed on my machine (Windows 10) but still couldnĀ“t build debug to my device.

My solution was to install the adb and fastboot drivers for my phone following this guide (page 2 and 3). http://www.teamandroid.com/2012/07/30/how-to-set-up-adb-fastboot-with-android-sdk/

install driver for adb interface http://www.teamandroid.com/2012/07/30/how-to-set-up-adb-fastboot-with-android-sdk/2/

install driver for fastboot bootloader interface http://www.teamandroid.com/2012/07/30/how-to-set-up-adb-fastboot-with-android-sdk/3/ !note: I have a Xperia z5 and to get it in the fastboot mode the easy way is to (instead of steps 26-28) just run the adb command "adb reboot bootloader"