Closed adantart closed 9 years ago
I went to Android Studio and update everything and it's working ;-) easy !
If you're installing only the neccessary sdk tools by hand like me, this did the trick for me:
android update sdk --no-ui --all --filter "extra-android-m2repository"
After run SDK manager and update for Android Support Repository, Android Support Library then it's work :)
I looked at the place where it specifying in the error message for available support-v13
versions(folders). In my case latest one was 22.2.0
. So in the package.xml file(root/plugins/phonegap-plugin-push/package.xml) I replaced the
<framework src="com.android.support:support-v13:23+" />
into
<framework src="com.android.support:support-v13:22.2.0" />
Working as expected
You shouldn't change the version of the dependencies of a plugin, that could lead to unexpected behaviour if that plugin expects a feature only available in newer versions. You should instead update your android
sdk, more specifically Android Support Repository
and Android Support Library
as pictured here.
You're fine on this one, however, as this plugin (phonegap-plugin-push) doesn't use any of the new features on 23+ (yet).
After removing this plugin it still leaves residual garbage in plugins/android.json, platforms/android/AndroidManifest.xml, platforms/android/build.gradle and platforms/android/project.properties. Removing all references to com.android.support:support-v13:23+ in platforms/android/project.properties and platforms/android/build.gradle fixed the issue with not being able to build project.
@autonomous1 That's an issue with cordova-cli by the way, you might want to create an issue at https://issues.apache.org/jira/browse/CB.
This did the trick for me too :
android update sdk --no-ui --all --filter "extra-android-m2repository"
exact solution i found for me is that:
you need to install Android Support Library Android Support Repository Google Play Services
means you need to install/update your SDK extra facilities whic you can do with command line its easy.
android update sdk --no-ui --filter extra.
Updating still didn't solve my problem.
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.google.android.gms:play-services-gcm:+.
Searched in the following locations:
https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/maven-metadata.xml
https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/
file:/home/user/android/extras/android/m2repository/com/google/android/gms/play-services-gcm/maven-metadata.xml
file:/home/user/android/extras/android/m2repository/com/google/android/gms/play-services-gcm/
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
@NaurozAhmad I assume you've already found the solution. But for others to see as well. After installing: Android Support Library Android Support Repository Google Play Services
as noted above, try installing "Google Repository" as well. This solved the issue for me.
After spending 2h on trying build apk with phonegap-plugin-push plugin I found solution.
<preference name="android-targetSdkVersion" value="23"/>
cordova platform add android
phonegap platform add android
Thank you @alexbuijs
This did the trick for me too : android update sdk --no-ui --all --filter "extra-android-m2repository"
I have run this command on the android sdk root folder
In case anyone still finds this thread with the same issue and is like "but it still won't compile!" my problem was that I was updating my android sdk via Program Files rather than Program Files x86, which is where Cordova was looking for the sdks.
Thank you @alexbuijs
For me next worked:
Google Repositories
from extras - actually install all extras :smile: android update sdk --no-ui --all --filter "extra-android-m2repository"
ionic build android
workedthanks @alexbuijs
If any of these didn't solve the problem, try to recreate android platform. Make sure you back up the important stuff, and simply cordova platform rm android
, then cordova platform add android
.
This worked for me.
I think installing Android Support Library (Obsolete)
from SDK manager while there is a platform already causes the problem in my case.
Run android update sdk --no-ui --all --filter "extra-android-m2repository"
and installing Google Repository
, solved the issue for me
Running android update sdk --no-ui --all --filter "extra-android-m2repository"
and install every Extras solved the issue for me.
I ran into the same issue and did the following to resolve it.
android update sdk --no-ui --all --filter "extra-android-m2repository"
Note: Instead of running the command above, you can install "Android Support Repository" by opening Android SDK Manager.
My problem was a little bit different so fixing the SDK didn't solve the issue, I tried fixing the JDK and it worked for me. On Ubuntu terminal type:
sudo apt-get remove oracle-java8-installer
sudo apt-get install oracle-java8-installer
android update sdk --no-ui --all --filter "extra-android-m2repository" Worked for me as well Thankyou
I had to do not only
android update sdk --no-ui --all --filter "extra-android-m2repository"
but also
android update sdk --no-ui --filter extra
to make it work like said by @imVinayPandya
and finally in my case: to set a min-sdk preference in my config.xml file
@cristovao-trevisan Thanks!!! no one tells you but apparently you CAN'T use openjdk with cordova, or at least it need more configuration. My problem was obtaining a certificate from sun that make the whole platform add fail.
For those looking how to install oracle java on ubuntu, https://help.ubuntu.com/community/Java
@DNAngeluS This is (part of) the docker file I use for installing OpenJDK 8 and the Android tools necessary for building APK's with Cordova:
FROM node:7.2.0
ENV SDK_HOME /opt/android-sdk
ENV ANDROID_SDK_VERSION 25.2.2
ENV ANDROID_API_LEVEL 25
ENV ANDROID_BUILD_TOOLS_VERSION 25.0.0
ENV ANDROID_SDK_DIST tools_r${ANDROID_SDK_VERSION}-linux.zip
ENV ANDROID_SDK_TOOLS android-${ANDROID_API_LEVEL},build-tools-${ANDROID_BUILD_TOOLS_VERSION},extra-android-m2repository,extra-google-m2repository
ENV PATH $PATH:$SDK_HOME/tools
RUN echo "deb http://ftp.de.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/openjdk.list
RUN apt-get update
RUN apt-get install -y openjdk-8-jdk lib32stdc++6 lib32z1 unzip
RUN wget http://dl.google.com/android/repository/${ANDROID_SDK_DIST}
RUN mkdir -p $SDK_HOME
RUN unzip $ANDROID_SDK_DIST -d $SDK_HOME
RUN rm $ANDROID_SDK_DIST
RUN echo y | android update sdk -u -a -t $ANDROID_SDK_TOOLS
Thanks @alexbuijs !!! I was building my own just to avoid dealing with these again. I think I'll use part of that code.
How can i run this code, it is not working from command prompt - android update sdk --no-ui --all --filter "extra-android-m2repository"
@jessicastorm1986 Make sure your path variables are correct for your android SDK.
@BradyLiles , i am ableto make an export without this plugin, but after adding this it is giving me error, my paths are correct though [see attached file]
ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk JAVA_HOME=C:\Program Files\Java\jdk1.8.0_111 Subproject Path: CordovaLib Starting a new Gradle Daemon for this build (subsequent builds will be faster). Incremental java compilation is an incubating feature.
error- FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring root project 'android'.
Could not resolve all dependencies for configuration ':_debugApkCopy'. Could not find any matches for com.google.firebase:firebase-core:+ as no versions of com.google.firebase:firebase-core are available. Required by: :android:unspecified Could not find any matches for com.google.firebase:firebase-messaging:+ as no versions of com.google.firebase:firebase- messaging are available. Required by: :android:unspecified Could not find any matches for com.google.firebase:firebase-crash:+ as no versions of com.google.firebase:firebase-cras h are available. Required by: :android:unspecified Could not find any matches for com.google.firebase:firebase-config:+ as no versions of com.google.firebase:firebase-con fig are available. 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
i've just restarted my machine and problem solved :P
This did the trick for me too in git console.
android.bat update sdk --no-ui --all --filter "extra-android-m2repository"
cordova-plugin-camera
* 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-v4:24.1.1+.
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/
Required by:
:android:unspecified
Hello guys i am new on IONIC 2 I implemented native facebook login in my ionic 2 app. for this i add cordova-plugin-facebook4. and follow all the instruction from this link: https://ionicthemes.com/tutorials/about/ionic2-facebook-login after follow all the instruction when i run command to make android apk it give me error build faild. for this i update my android. but till now this error do not solve and not make apk file please help me.
This thread has been automatically locked.
It says:
I tried to change config.xml since I heard in other issue it can be about minsdk, but my Cordova is 5.3.1 and I set minsdk to 20, 21, 22 ... but again the same problems.
BTW, I read about #136 and:
1) I don't have any file in android named "android-support-*.jar" 2) I already have in my build-extras.gradle at /platforms/android/ the: dependencies { compile "com.android.support:support-v13:23+" }
Thank you