![](/img/trans.png)
[英]ionic - Could not resolve com.android.tools.build:gradle:2.2.3
[英]ionic build error: Could not resolve com.android.tools.build:gradle:1.5.0
我正在嘗試構建一個離子安卓應用程序。 我正在關注此教程Cordova和Ionic | Android HTML5應用程序開發教程來創建我的第一個離子應用程序。 雖然我在linux mint 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進行修復
但是它仍然給出相同的錯誤。
如何解決此錯誤..?
您正在遇到此問題,因為cordova在其最新版本中添加了遙測技術,以收集數據以進行數據驅動的開發以進行某些分析
錯誤回應:
CI
環境變量,這將防止出現提示。 --no-telemetry-flag
在單個命令上關閉遙測收集。 我遇到了一個小問題,並通過安裝最新的JDK進行了修復,請確保您已安裝64位和32位版本(盡管我是出於Windows的罪過)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.