Reputation: 638
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?
Upvotes: 0
Views: 2096
Reputation: 814
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"
Upvotes: 0
Reputation: 271
After spending 2h on trying build apk with phonegap-plugin-push plugin I found solution.
In config.xml of your cordova project (in your main directory), just edit or add this line:
<preference name="android-targetSdkVersion" value="23"/>
Then remove android platform:
cordova platform add android
And add it again:
phonegap platform add android
Upvotes: 0
Reputation: 1458
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.
Upvotes: 2
Reputation: 638
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.
Upvotes: 1