[英]Build Android APK in Redhat using Gradle in Offline mode
我正在使用Gradle 2.13並嘗試在readhat中構建android apk,並且系統無法訪問互聯網。 我正在嘗試離線構建android apk。 但這引發了一些異常,無法找出問題所在。
主要build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
錯誤:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'PROJECT'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:2.1.0.
Required by:
:PROJECT:unspecified
> No cached version of com.android.tools.build:gradle:2.1.0 available for offline mode.
> No cached version of com.android.tools.build:gradle:2.1.0 available for offline mode.
* 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: 0.831 secs
版本號:
gradle -version
搖籃2.13
是否有任何教程可用於在redhat / linux機器上構建脫機apk?
編輯:更新問題。
這是因為android 2.13的gradle插件不存在 。
最新的穩定版本是2.1.0。 采用:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
}
}
不要混淆gradle分發和gradle的android插件 。
您可以在gradle/wrapper/gradle-wrapper.properties
文件中定義項目使用的gradle分布
例如:
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.