tôi sử dụng Lombok trên một số dự án, và với sự mới Android Studio 2.4 Update now (Preview) Tôi nhận được lỗi này lạ:Android Studio 2.4 + Lombok annotationProcessor nhầm lẫn cấu hình
What went wrong: Execution failed for task ':core:javaPreCompileRelease'. 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 Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = 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.
Tôi đã cố gắng:
annotationProcessor "org.projectlombok:lombok:1.16.16"
nhưng không có hiệu lực.
Tôi cũng đã thử nghiệm:
android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true
Nhưng cũng không có tác dụng.
Đồng thời kiểm tra trang hỗ trợ để biết thêm thông tin nhưng không may mắn, có ai trong số các bạn có thể không? https://developer.android.com/studio/preview/features/index.html?utm_source=android-studio#annotationProcessor_config
Có cùng vấn đề. Tôi đã sử dụng Lombok trong một mô-đun lib Android và một mô-đun lib Java. Tôi chỉ phải cập nhật build.gradle trong mô-đun Android. Mô-đun Java có thể ở dạng 'compileOnly 'org.projectlombok: lombok: [PHIÊN BẢN CỦA BẠN]" ' – tir38
Với Android Studio 3.0 canary 1 ngoài các hàng được cung cấp/chú thíchĐối với các hàngProcessor tôi cũng phải thêm ' javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } } ' bên trong ' android { defaultConfig { } } '. – DSoldo
'annotationProcessor' phải là' kapt' – Diolor