2016-05-03 24 views
0

私はGradle 2.13を使用していて、readhatにAndroid APKを構築しようとしていますが、システムにはインターネットアクセスがありません。 私はAndroidのapkをオフラインで構築しようとしています。しかし、それは何らかの例外を投げていて、何がうまくいかなかったか把握できません。オフラインモードで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を構築するために利用可能なチュートリアルがあります機械?

編集:質問を更新してください。

答えて

1

android 2.13 のgradleプラグインが存在しないために発生します

最新の安定版は2.1.0です。用途:

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.1.0' 
    } 
} 

Gradleの配布とのGradleためアンドロイドプラグインを混同しないでください。

あなたは、例えばファイルに gradle/wrapper/gradle-wrapper.properties

をプロジェクトで使用Gradleの分布を定義することができます。

distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip 
+0

おかげガブリエル、私はそれをしようとします。 通常のアンドロイドスタジオのビルドに影響しますか? 私はLinux環境でコードをチェックしてビルドを行っています。 distributionURLをローカルパスにポイントできますか? –

+0

まだ動作していません:( –

+0

@MadhukarHebbarもちろん、オフラインでプラグインを変更することはできません。少なくとも1回はオンラインに接続する必要があります。 –

関連する問題