0
我正在使用Gradle 2.13並嘗試在readhat中構建Android apk並且系統沒有Internet訪問權限。 我正在嘗試構建Android離線版。但是它拋出了一些異常,無法弄清楚出了什麼問題。使用Gradle在離線模式下在Redhat中構建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
Gradle 2.13
是否有可用的任何教程構建在redhat/linux下的離線APK機?
編輯:更新問題。
謝謝加布裏埃萊,我會嘗試。 它會影響正常的android studio構建? 我正在簽出Linux環境中的代碼並進行構建。 我能否將distributionURL指向本地路徑? –
不能正常工作:( –
@MadhukarHebbar當然,您不能更改該插件的離線工作方式,您至少需要連接一次。 –