2017-10-22 2 views
1

で「パッケージロンボクが存在しない」入門プロジェクトをコンパイルしようとしたとき、私は次のエラーを取得しています:がエラーのAndroid Stuido 3 RC2

error: package lombok does not exist 

し、そこからすべての注釈ができないという他人見つけられた。

コンパイルする前にコードにエラーが表示されず、Android Studio 3 RC1を使用していたときにこのエラーが発生しませんでした。

プロジェクトレベル:

// 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 
} 

アプリケーションモジュールレベル:ここに

は私のGradleスクリプトです

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' 
    } 

私もモジュールを持っているが、私はそれが重要ではないと思います。

答えて

2

compileOnly注釈のためです。ここではドキュメントは、次のとおりです。 blog.gradle.org/introducing-compile-only-dependencies

  • 依存コンパイル時に必要ですが、このようなソースのみの注​​釈または注釈プロセッサとして、実行時に必要なことはありません。

  • コンパイル時には必須ですが、実行時には特定の機能を使用する場合にのみ必要です。

  • コンパイル時に必須ですが、消費ライブラリ、アプリケーション
    または実行時環境によって実装が提供される依存関係です。

0

それはjdk9に関連している可能性があります。 IntelliJ、lombok 1.16.18とjdk9の組み合わせは現在動作しません。しかし、それはあなたのエラーメッセージを説明していません。我々はこの問題に対処する数日(おそらく今夜)以内に1.16.20をリリースすることができると期待している。

開示:私はロンボクの開発者です。

+0

私は実際にJava 8を使用しています。これはapp.gradleで見ることができるためです。 – Scarass

関連する問題