Eu não estou conseguindo dar um build em qualquer projeto simples para android.
Meu sdk está em ~/Android e tenho o Android Studio instalado em ~/android-studio.
#onde está meu android sdk
export ANDROID_HOME/home/felipe/Android/Sdk/
#Primeiro dava erro que não encontrava o gradle, então fiz como alguma repsosta do stack overflow. Ele acha agora o gradle porque está no path, mas
export GRADLE_ANDROID_HOME=/home/felipe/android-studio/gradle/gradle-3.2/bin
#Também atualizei cordova e ionic
npm install -g cordova@latest
npm install -g ionic@latest
criei um app simples com
ionic start sidemenu sidemenu --type ionic1
cd sidemenu
ionic cordova platform add android
ionic cordova build android
Então tive a seguinte mensagem de erro:
> ionic cordova prepare
> cordova prepare
✔ Running command - done!
Running command: /home/felipe/ionic-testes/sidemenu/hooks/after_prepare/010_add_platform_class.js /home/felipe/ionic-testes/sidemenu
add to body class: platform-android
> cordova build android
✖ Running command - failed!
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova build android (exit code 1):
Running command: /home/felipe/ionic-testes/sidemenu/hooks/after_prepare/010_add_platform_class.js
/home/felipe/ionic-testes/sidemenu
add to body class: platform-android
ANDROID_HOME=/home/felipe/Android/Sdk/
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
Subproject Path: CordovaLib
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.2.3.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:2.2.3.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom'.
> Could not HEAD 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested
target
* 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: 9.241 secs
Error: /home/felipe/ionic-testes/sidemenu/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.2.3.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:2.2.3.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom'.
> Could not HEAD 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested
target
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Agradeço qualquer ajuda!