evant / gradle-retrolambda

A gradle plugin for getting java lambda support in java 6, 7 and android
Apache License 2.0
5.3k stars 449 forks source link

Could not resolve net.orfijacal.retrolambda: #186

Open khajievN opened 8 years ago

khajievN commented 8 years ago

Error:Execution failed for task ':app:compileRetrolambdaDebug'.

Could not resolve all dependencies for configuration ':app:retrolambdaConfig'. Could not resolve net.orfjackal.retrolambda:retrolambda:2.1.0. Required by: ishow-android:app:unspecified

No cached version of net.orfjackal.retrolambda:retrolambda:2.1.0 available for offline mode. No cached version of net.orfjackal.retrolambda:retrolambda:2.1.0 available for offline mode. No cached version of net.orfjackal.retrolambda:retrolambda:2.1.0 available for offline mode.

khajievN commented 8 years ago

there is my gradle

buildscript { repositories { maven { url 'https://maven.fabric.io/public' } }

dependencies {
    classpath 'io.fabric.tools:gradle:1.+'
}

}

buildscript { repositories { mavenCentral() }

dependencies {
    classpath 'me.tatarka:gradle-retrolambda:3.2.5'

}

}

// Required because retrolambda is on maven central repositories { mavenCentral() }

apply plugin: 'me.tatarka.retrolambda' apply plugin: 'com.android.application' apply plugin: 'io.fabric'

repositories { maven { url 'https://maven.fabric.io/public' } }

android {

compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
    applicationId "uz.ishow.android"
    minSdkVersion rootProject.ext.minSdkVersion as Integer
    targetSdkVersion rootProject.ext.targetSdkVersion as Integer
    versionCode rootProject.ext.versionCode as Integer
    versionName rootProject.ext.versionName as String
    multiDexEnabled true

}

signingConfigs {
    release {
        storeFile file("ishow.jks")
        storePassword 'Sb7gdA28'
        keyAlias 'ishow'
        keyPassword 'Sb7gdA28'
    }

    debug {
        storeFile file("ishow.jks")
        storePassword 'Sb7gdA28'
        keyAlias 'ishow'
        keyPassword 'Sb7gdA28'
    }
}

buildTypes {
    release {
        zipAlignEnabled true;
        minifyEnabled false
        signingConfig signingConfigs.release
    }

    debug {
        debuggable true
        jniDebuggable true
        zipAlignEnabled true
        minifyEnabled false
        signingConfig signingConfigs.debug
    }
}

packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/services/javax.annotation.processing.Processor'
}

dexOptions {
    incremental true
    maxProcessCount 2
    javaMaxHeapSize "2g"
}

}

dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') // testCompile 'junit:junit:4.12'

//    provided 'org.projectlombok:lombok:1.16.2'
compile "com.android.support:appcompat-v7:" + rootProject.ext.supportLibraryVersion
compile "com.android.support:design:" + rootProject.ext.supportLibraryVersion
compile "com.android.support:recyclerview-v7:" + rootProject.ext.supportLibraryVersion
compile 'com.google.code.gson:gson:2.4'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.squareup.dagger:dagger:1.2.2'
compile 'com.squareup.dagger:dagger-compiler:1.2.2'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
compile 'com.cocosw:bottomsheet:1.1.1'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.googlecode.libphonenumber:libphonenumber:7.2.2'
compile 'io.reactivex:rxjava:1.1.5'
compile 'io.reactivex:rxandroid:1.2.0'
compile 'com.jakewharton.rxbinding:rxbinding:0.2.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.tonicartos:superslim:0.4.13'
compile project(':dialog')
compile project(':crop')
compile project(':gcm')
compile('com.digits.sdk.android:digits:1.9.3@aar') {
    transitive = true;
}
compile('com.crashlytics.sdk.android:crashlytics:2.5.2@aar') {
    transitive = true;
}
retrolambdaConfig 'net.orfjackal.retrolambda:retrolambda:2.1.0'

}

retrolambda { jdk "c:\Program Files (x86)\Java\jdk1.8.0_40\" oldJdk "c:\Program Files (x86)\Java\jdk1.7.0_45\" javaVersion JavaVersion.VERSION_1_6 jvmArgs '-arg1', '-arg2' defaultMethods false incremental true

}

evant commented 8 years ago

You are running in offline mode. Disable it so it can download the retrolambda jar

khajievN commented 8 years ago

No I'm online mode always but i always come up with this problem. Please give me solution for this one

evant commented 8 years ago

No cached version of net.orfjackal.retrolambda:retrolambda:2.1.0 available for offline mode. Your log begs to differ...

khajievN commented 8 years ago

I don't know why i have this error "No cached version of net.orfjackal.retrolambda:retrolambda:2.1.0 available for offline mode." I swear i was online

evant commented 8 years ago

Hey I noticed you posted your release keystore password, you might want to change that.

    release {
        storeFile file("ishow.jks")
        storePassword 'Sb7gdA28'
        keyAlias 'ishow'
        keyPassword 'Sb7gdA28'
    }
rf43 commented 8 years ago

@Nizomjon1994 and you shouldn't need your release password for your debug builds. Android Studio will default to using the debug creds when it builds.

khajievN commented 8 years ago

Thanks @rf43 and @evant you saved me. Retrolambda is great !!!!

adityaladwa commented 8 years ago

+1 I got the same error even if I'm online

Error:Execution failed for task ':app:compileRetrolambdaDevDebug'.

Could not resolve all dependencies for configuration ':app:retrolambdaConfig'. Could not resolve net.orfjackal.retrolambda:retrolambda:2.3.0. Required by: com.ladwa.aditya:app:unspecified

No cached version of net.orfjackal.retrolambda:retrolambda:2.3.0 available for offline mode. No cached version of net.orfjackal.retrolambda:retrolambda:2.3.0 available for offline mode.

gmale commented 8 years ago

I had the same problem and I don't use gradle-retrolambda rather, I landed here from a google search. I got this working so I figured I'd return and post the fix:

This is related to retrolambda, itself which adds the original retrolambda dependency (from Esko Luontola) to the "retrolambdaConfig" configuration. So I simply dropped out of offline mode (which can be done by either not passing --offline to the gradle command or through Android Studio's gradle options) and this allowed gradle to download the dependency.

The trick was you have to run a task that ultimately relies on the retrolambdaConfig configuration. At first, I was running clean like I normally do when I exit offline mode to grab dependencies but in this case, I needed to at least compile. So running installDebug did the trick.

tl;dr: exit offline mode and rebuild your APK

aolphn commented 7 years ago

I encounter this issue too,my problem is "--offline" in Command-line Options.And I figure out it after deleting that params . @LadwaAditya you can check compiler 's Command-line Options in your IDE's settings,whether you had set "--offline".

jeremyclee commented 7 years ago

I just encountered this as well, my 'offline mode' check box was unchecked, but i had the --offline flag in the command line options, as @zhangkehu said. I think this issue can be closed @evant

reyanshmishra commented 7 years ago

How to solve this issue ? I am in online mode on command line as well as the checkbox is unchecked stuck with it since two days.

stephenithub commented 7 years ago

I have the same problem, have you solved it?

Error:Unknown host 'jcenter.bintray.com'. You may need to adjust the proxy settings in Gradle. <a href="toggle.offline.mode">Enable Gradle 'offline mode' and sync project</a><br><a href="https://docs.gradle.org/current/userguide/userguide_single.html#sec:accessing_the_web_via_a_proxy">Learn about configuring HTTP proxies in Gradle</a> @Nizomjon1994

aolphn commented 7 years ago

@stephenithub This problem maybe occur when opening a new android studio project by clicking project folder,you can open it by clicking build.gradle(project's root directory),maybe you will not encounter this issue again.

reyanshmishra commented 7 years ago

Agree @zhangkehu I deleted my Android Studio entirely and downloaded it again and problem went As I had installed it new on my mac so the problem came while installing.

jiancchen commented 6 years ago

I had a similar issue however offline was not enabled, funny enough the solution was to restart Android Studio.