Java 获取错误“;lombok包装不';“不存在”;使用Android Studio 3 RC2
我在尝试编译项目时遇到以下错误: 错误:包lombok不存在 还有一些人说找不到它的所有注释 在编译之前,我没有在代码中看到错误,并且在使用AndroidStudio 3 RC1时也没有出现此错误 以下是我的gradle脚本: 项目级:Java 获取错误“;lombok包装不';“不存在”;使用Android Studio 3 RC2,java,android,lombok,android-studio-3.0,Java,Android,Lombok,Android Studio 3.0,我在尝试编译项目时遇到以下错误: 错误:包lombok不存在 还有一些人说找不到它的所有注释 在编译之前,我没有在代码中看到错误,并且在使用AndroidStudio 3 RC1时也没有出现此错误 以下是我的gradle脚本: 项目级: // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositorie
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-rc2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
应用程序模块级别:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.mk.forum"
minSdkVersion 25
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile project (':util')
compile project (':forum_core')
compileOnly 'org.projectlombok:lombok:1.16.18'
annotationProcessor 'org.projectlombok:lombok:1.16.18'
compile group: 'com.github.javafaker', name: 'javafaker', version: '0.13'
}
我也有一些模块,但我认为这并不重要。我希望这是因为
编译的注释。这是文件:
- 在编译时需要依赖项,但在运行时从不需要依赖项,例如仅源代码注释或注释处理器
- 编译时需要依赖项,但只有在使用某些功能时才需要依赖项,也称为可选依赖项
- 其API在编译时是必需的,但其实现将由消费库提供的依赖项,应用程序
或运行时环境
它可能与jdk9有关。我知道IntelliJ、lombok 1.16.18和jdk9的组合目前不起作用。但这并不能解释您的错误消息。我们希望能在几天内(也许今晚)发布1.16.20来解决这个问题
披露:我是一名lombok开发人员。我实际上在使用Java 8,从app.gradle中可以看到这一点。