[Android Studio] Lombok 플러그인 사용시 Annotation 오류 질문드립니다.
조회수 2132회
안녕하세요 Lombok 사용중 에러가 발생하여 질문드립니다.
lombok을 사용하기위해 SDK 매니저를 이용해서 플러그인을 다운받았습니다.
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.0"
defaultConfig {
applicationId "com.firebase.xhdtn8070.free"
minSdkVersion 20
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnab led false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.google.firebase:firebase-database:11.6.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:27.0.0'
compile 'com.android.support:design:27.0.0'
compile 'com.jakewharton:butterknife:8.5.1'
compile 'com.github.bumptech.glide:glide:4.0.0-RC1'
compile 'com.google.firebase:firebase-auth:11.6.0'
compile 'com.google.android.gms:play-services-auth:11.6.0'
compile 'com.android.support:support-v4:27.0.0'
provided 'org.projectlombok:lombok:1.16.16'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC1'
}
apply plugin: 'com.google.gms.google-services'
build.gradle 파일은 이렇게 되어있습니다.
provided 'org.projectlombok:lombok:1.16.16'
이 부분이 lombok을 사용하기 위해 삽입한 구문입니다.
lombok.config 파일이 필요하다고 해서 루트 디렉토리에 lombok.config 를 만들고 안에 다음과 같은 코드를 작성하였습니다.
lombok.anyConstructor.suppressConstructorProperties = true
lombok.addGeneratedAnnotation = false
아래는 빌드할때 생기는 오류입니다.
Error:Execution failed for task ':app:javaPreCompileDebug'.
> Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor. Please add them to the annotationProcessor configuration.
- lombok-1.16.16.jar (org.projectlombok:lombok:1.16.16)
Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspat h = true to continue with previous behavior. Note that this option is deprecated and will be removed in the future.
See https://developer.android.com/r/tools/annotation-processor-error-message.html for more details.
오류를 해결하려면 어떤 것을 해야하나요? 도와주세요.추가 사진추가하겠습니다.
아래사진은 오류검출 메시지에 써있는 android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspat h = true 을 추가한 후 빌드한 사진입니다. 똑같은 에러가 검출됩니다.
댓글 입력