Problem setting up retrolambda in build.gradle files
See original GitHub issueHi,I have a problem. I’m using retrolambda on Android Studio because lambda expression are not supported on it and I need them for my app. Here’s my build.gradle file (about the project)
'buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
}
}
allprojects {
repositories {
jcenter()
}
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'me.tatarka:gradle-retrolambda:3.4.0'
}
}
// Required because retrolambda is on maven central
repositories {
mavenCentral()
}
apply plugin: 'com.android.application' //or apply plugin: 'java'
apply plugin: 'me.tatarka.retrolambda'`
When I try to synchronize the project with gradle files it shows this error: “Gradle sync failed: Cause: buildToolsVersion is not specified.”
I’ll post also the build.gradle file for the specific app module,maybe the problem is that I use another external library:
`apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.example.android.sip"
minSdkVersion 21
targetSdkVersion 21
jackOptions {
enabled true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compile files('src/main/java/libs/spark-core-2.3.jar')
}`
Thanks everyone.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
Android, Gradle : RetroLambda not working - Stack Overflow
I am working on an Android application and I came up with RetroLambda tool, with which I can use Lambda expressions in Android...
Read more >Setting up Retrolambda - Anders Murphy
Retrolambda requires that Java 7 and Java 8 are installed on your machine. ... Add the following to your app build.gradle file: android...
Read more >Retrolambda stop workin, seems that Path Variables ... - Issue Tracker
to setup the environment variables at all the company laptops without hardcoding the path into the code. I've been using the 2.5.0 version...
Read more >Lambda Expressions | CodePath Android Cliffnotes
Take a look at the code below for creating an Observable and subscribing an ... the app module build.gradle file to apply the...
Read more >Use Java 8 language features and APIs - Android Developers
Java 8 language feature support (Android Gradle Plugin 3.0.0+) ... properly configure your project to use them, and any known issues you may ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah, I had the same problem - if I added the stuff to the beginning of my app/build.gradle, though, rather than my root build.gradle, gradle completes successfully. (If that’s the file that’s SUPPOSED to be modified, it would be nice if the docs said so. Hint hint, developers.) However, though gradle finishes the “Rebuild project”, if I actually try to debug it, Android Studio says:
It may be worth noting that I was unable to get ordinary retrolambda working with my dependee eclipse project library thing, and thankfully I was able to just use plain java 7 for it.