我在 Android Studio 2.1.3 (Windows 7) (plugin) 中配置了我的项目 (Module:app classpath 'com.android.tools.build:gradle:2.1.3'
)
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
classpath 'me.tatarka:gradle-retrolambda:3.3.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'me.tatarka.retrolambda'
retrolambda {
jdk System.getenv("JAVA8_HOME")
oldJdk System.getenv("JAVA7_HOME")
javaVersion JavaVersion.VERSION_1_7
}
android {
compileSdkVersion 23
buildToolsVersion '24.0.2'
defaultConfig {
applicationId "com.enterprise"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
signingConfig signingConfigs.config
jackOptions {
enabled true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
....
我得到了
Error:A problem occurred configuring project ':app'.
我使用 Facebook 和 Twitter (fabric) 依赖项。
我删除apply plugin: 'me.tatarka.retrolambda'
了它运行正常但没有retrolambda。
我试过:
- https://stackoverflow.com/questions/35251071/retrolambda-error-when-adding-facebook-sdk-4-android-studio
- 我删除了 Facebook。同样的问题。
- Android Studio gradle 2.1.3 问题
- 我添加了
classpath 'com.android.tools.build:gradle-experimental:0.7.3'
- 我添加了
- 在 Android Studio 2.1.3 中,实验 gradle 不起作用?
- https://github.com/evant/gradle-retrolambda/issues/17
我在 IDE 日志中得到了这个
Caused by: org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'.
at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:79)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:74)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:61)
.....
Caused by: java.lang.NullPointerException
at me.tatarka.RetrolambdaPluginAndroid.configureCompileJavaTask(RetrolambdaPluginAndroid.groovy:74)
at me.tatarka.RetrolambdaPluginAndroid.access$3(RetrolambdaPluginAndroid.groovy)
at me.tatarka.RetrolambdaPluginAndroid$_apply_closure5.doCall(RetrolambdaPluginAndroid.groovy:64)
at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
at org.gradle.listener.ActionBroadcast.execute(ActionBroadcast.java:39)
at org.gradle.api.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.java:165)