Answer the question
In order to leave comments, you need to log in
What could be causing the error after executing ionic build?
There are variables in .bashrc on android sdk
export ANDROID_HOME=/root/Android/Sdk
export PATH=$PATH:/root/Android/Sdk/tools
sudo ionic build android
Running command: /home/aiduryagin/Desktop/androidDev/test/hooks/after_prepare/010_add_platform_class.js /home/aiduryagin/Desktop/androidDev/test
add to body class: platform-android
ANDROID_HOME=/root/Android/Sdk
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
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:1.5.0.
Required by:
:android:unspecified
> Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/1.5.0/gradle-1.5.0.pom'.
> peer not authenticated
* 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: 1.615 secs
ERROR building one of the platforms: Error code 1 for command: /home/aiduryagin/Desktop/androidDev/test/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/aiduryagin/Desktop/androidDev/test/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
You may not have the required environment or OS to build this project
Error: Error code 1 for command: /home/aiduryagin/Desktop/androidDev/test/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/aiduryagin/Desktop/androidDev/test/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
Answer the question
In order to leave comments, you need to log in
Try in the build script instead of mavenCentral() to use
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
Orrepositories {
maven {
url "http://repo1.maven.org/maven2"
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question