Ionic build apk android - android

I'm trying to build an apk from my ionic project.
When I launch ionic build android, i get this error
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/
Required by:
:android:unspecified
Could not find any version that matches com.google.android.gms:play-service
s-gcm:+.
Searched in the following locations:
//repo1.maven.org/maven2/com/google/android/gms/play-services-gcm
/maven-metadata.xml
BUILD FAILED
What is it?

This is an error related to android tools version.By executing the following commands will resolve your issue.
android list sdk
and
android update sdk --no-ui --filter extra

Related

Instruct gradle to use local files

I am trying to build an ionic 4 project for android with this command:
ionic cordova build android --verbose
The bulid fails with the following error:
Running command: /path/gradlew cdvBuildDebug -b /path/build.gradle
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:3.3.0.
Searched in the following locations:
- https://dl.google.com/path/gradle-3.3.0.pom
- https://dl.google.com/path/gradle-3.3.0.jar
...
When I do wget https://dl.google.com/path/gradle-3.3.0.pom I get 404.
When I paste the url into the addressbar of my browser however the file does get downloaded. So, I have been able to download the files gradle is having trouble downloading.
Is there a way I instruct gradle to use the local files instead of trying to download them?
i think this is for sanctions and if we can use vpn thats resolved

Ionic 3 prod release build issue with com.google.gms:google-services:3.2.0

I am creating release APK using the following versions : node - 8.12.0 gradle - 4.10.2 ionic CLI - 4.0.5 Cordova - 8.0.0
When I run the
ionic cordova build android --prod --release
I am getting the following error.
FAILURE: Build failed with an exception.
* Where:
Build file '/app/platforms/android/app/build.gradle' line: 94
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all files for configuration 'classpath'.
> Could not find com.google.gms:google-services:3.2.0.
Searched in the following locations:
https://jcenter.bintray.com/com/google/gms/google-services/3.2.0/google-services-3.2.0.pom
https://jcenter.bintray.com/com/google/gms/google-services/3.2.0/google-services-3.2.0.jar
https://repo1.maven.org/maven2/com/google/gms/google-services/3.2.0/google-services-3.2.0.pom
https://repo1.maven.org/maven2/com/google/gms/google-services/3.2.0/google-services-3.2.0.jar
Today there is a problem with repositories. It seems no one can build a project Could not find com.google.gms:google-services:4.1.0

Ionic android build issue in linux

I have successfully installed cordova v6.3.1, ionic v2.0.0 and Android Studio
OS: Virtualbox (Xubuntu)
when i run ionic build android
I get below error:
BUILD FAILED
Total time: 7.749 secs
Error: /var/lib/mymachine/ionic-01/platforms/android/gradlew: 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 ':classpath'.
> Could not resolve com.android.tools.build:gradle:2.1.0.
Required by:
:android:unspecified
> Could not resolve com.android.tools.build:gradle:2.1.0.
> Could not get resource 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.
> org.apache.http.ssl.SSLInitializationException: /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/cacerts (No such file or directory)
> Could not resolve com.android.tools.build:gradle:2.1.0.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.
> org.apache.http.ssl.SSLInitializationException: /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/cacerts (No such file or directory)
Few post suggested to install Android support repository and Google Repository. I installed it. But still i face the face problem.
I had the similar problem. In my case it was simple java webapp which was using gradle. This project used java 6. My java 6 was not installed properly. Thats why I had the below issue.
gradle was not able to find the /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/security/cacerts
This is a symlink to another file which was not present.
So I removed my jdk and re-installed it. That solved the problem.

Cordova error building after adding plugin

Hello I'm using latest version of Cordova 6.1.0 and Android SDK Tools.
when I add any admob plugins. the following error message returned after using build command.
A problem occurred configuring root project 'android'
how can I fix this?
BTW please don't send workarounds for Android Studio. I just need to be able to build APK files via cordova and I don't use Android Studio.
Full error details as following:
JAVA_HOME=C:\Program Files (x86)\java\jdk1.7.0_71
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:+.
Searched in the following locations:
https://repo1.maven.org/maven2/com/google/android/gms/play-services/maven-metadata.xml
https://repo1.maven.org/maven2/com/google/android/gms/play-services/
Required by:
:android:unspecified
BUILD FAILED
Total time: 11.78 secs
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Error: Error code 1 for command: cmd with args:
/s,/c,"C:\nm\tests\platforms\android\gradlew cdvBuildDebug -b
C:\nm\tests\platforms\android\build.gradle -Dorg.gradle.daemon=true
-Pandroid.useDeprecatedNdk=true"

occurred configuring root project 'android'

I got an error when i use cordova build --release android
and this is the error on command prompt:
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-ads:+.
Searched in the following locations:
https://repo1.maven.org/maven2/com/google/android/gms/play-services-ads/maven-metadata.xml
https://repo1.maven.org/maven2/com/google/android/gms/play-services-ads/
file:/C:/Users/arnold/Downloads/android-sdk_r24.3.4-windows/android-sdk-windows/extras/android/m2repository/com/google/android/gms/play-services-ads/maven-metadata.xml
file:/C:/Users/arnold/Downloads/android-sdk_r24.3.4-windows/android-sdk-windows/extras/android/m2repository/com/google/android/gms/play-services-ads/
Required by:
:android:unspecified
can someone help me? this is really frustating
i have search google but many people have different error on configuration
i have update all installed file in android sdk.
Try this
android update sdk --no-ui --all --filter "extra-android-m2repository"

Categories

Resources