I use Android Studio 2.2
and Gradle
in offline mode. The value of Gradle Home
is /path/to/gradle/gradle-2.14.1
. I can run Android project but now I want to run a Java standard class to test some Java code before using them in Android project. So I followed this answer. But when I run class, I got an error like this:
Error:Gradle: A problem occurred configuring root project 'demo'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:2.2.2.
Required by:
:demo:unspecified
> No cached version of com.android.tools.build:gradle:2.2.2 available for offline mode.
Also here is content of build.gradle
of Java library:
apply plugin: 'java'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
sourceCompatibility = "1.7"
targetCompatibility = "1.7"
How I can solve this problem? (I do not want to use another IDE or enabling online mode for Gradle)