0

After I update my Android Studio to 1.3.1 and use gradle build tool 1.3.0, I can't run any Java module in Android Studio! At first I really was in offline mode, but when i dependent libraries , I closed it.I sync gradle after I execute clean --refresh-dependencies, but it doesn't work. Even I put the lombok-ast-0.2.3.jarin C:\Users\.AndroidStudio1.3\system\jars\, the problem still exists. Thank you for your help!

LogCat

Error:Gradle: A problem occurred configuring root project 'SimpleWeather'. Could not resolve all dependencies for configuration ':classpath'. Could not download lombok-ast.jar (com.android.tools.external.lombok:lombok-ast:0.2.3): No cached version available for offline mode

build.gradle(Module:root project)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
        classpath 'com.android.tools.external.lombok:lombok-ast:0.2.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

build.gradle(Module:app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "23.0.0 rc2"

    defaultConfig {
        applicationId "me.rorschach.simpleweather"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main {
            java.srcDirs = ['src/main/java', 'src/main/java-gen']
        }
    }

}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'de.greenrobot:greendao:2.0.0'
}

build.gradle(Module:java module)

apply plugin: 'java'

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'de.greenrobot:greendao-generator:2.0.0'
}
3
  • make sure you are connected to internet while building your app Commented Aug 24, 2015 at 10:20
  • I'm sure that the network connection is available Commented Aug 24, 2015 at 11:58
  • try adding jar as library in your project/module Commented Aug 24, 2015 at 12:00

1 Answer 1

1

Check your Android Studio preferences. It may be that you have checked Offline Work.

Android Studio > Preferences > Build, Execution, Deployment > Gradle > Offline Work.

Make sure that the checkbox is unchecked.

Sign up to request clarification or add additional context in comments.

2 Comments

At first I really was in offline mode, but when i dependent libraries , I closed it.
Did you restart Android Studio after unchecking it?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.