我正在尝试构建一个离子安卓应用。我正在关注本教程Cordova and Ionic | Android HTML5 App Development Tutorial 创建我的第一个离子应用程序。虽然我在linux中操作系统薄荷17.3。
除了最后一个命令,即sudo ionic build android之外,一切正常。我收到以下错误日志:
abc@abc-PC14 ~/workspace/public_html/ionic/hellowWorld $ sudo ionic build android
You have been opted out of telemetry. To change this, run: cordova telemetry on.
Running command: /home/scoders/workspace/public_html/ionic/hellowWorld/hooks/after_prepare/010_add_platform_class.js /home/scoders/workspace/public_html/ionic/hellowWorld
add to body class: platform-android
ANDROID_HOME=/home/scoders/android-sdk-linux
JAVA_HOME=/usr/lib/jvm/java-7-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'.
> hostname in certificate didn't match: <repo1.maven.org> != <199.27.79.209>
* 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: 2.364 secs
Error: Error code 1 for command: /home/scoders/workspace/public_html/ionic/hellowWorld/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/scoders/workspace/public_html/ionic/hellowWorld/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
首先我假设它可能是SSL gradle错误,并尝试使用gradle-trust-all
进行修复但它仍然会出现同样的错误。
如何解决此错误..?
答案 0 :(得分:1)
您在latest release添加的遥测技术中遇到了这个问题,为某些分析收集了数据驱动开发的数据
错误回复:
CI
环境变量
阻止提示出现。 --no-telemetry-flag
答案 1 :(得分:0)
我有一个熟悉的问题,并通过安装最新的JDK来修复它,确保你安装了64位和32位版本(虽然我在Windows上为我的罪过)。