uber / okbuck

OkBuck is a gradle plugin that lets developers utilize the Buck build system on a gradle project.
Other
1.54k stars 168 forks source link

cannot find symbol #754

Closed tesla1984 closed 6 years ago

tesla1984 commented 6 years ago

when i run ./buckw install, it builds success, but raise 'cannot find symbol'

If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

> Configure project :data
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to /Users/leon/Library/Android/sdk/ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

WARNING: The specified Android SDK Build Tools version (27.0.3) is ignored, as it is below the minimum supported version (28.0.2) for Android Gradle Plugin 3.2.0.
Android SDK Build Tools 28.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '27.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Configure project :permission:permission-lib
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to /Users/leon/Library/Android/sdk/ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

WARNING: The specified Android SDK Build Tools version (27.0.3) is ignored, as it is below the minimum supported version (28.0.2) for Android Gradle Plugin 3.2.0.
Android SDK Build Tools 28.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '27.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

BUILD SUCCESSFUL in 53s
37 actionable tasks: 37 executed

PROCEEDING WITH BUCK

Build failed: Command failed with exit code 1.
stderr: /data/com/room/MyClassDatabase_Impl.java:25: error: 找不到符号
@Generated("android.arch.persistence.room.RoomProcessor")
 ^
   符号:   类 Generated
  位置: 程序包 javax.annotation

Errors: 100. Warnings: 0.

    When running <javac>.
    When building rule //data:src_debug.
Parsing buck files: finished in 10.0 sec (100%)
Building: finished in 15.4 sec (100%) 841/886 jobs, 15 updated
  Total time: 25.1 sec

error cannot find symbol: Generated and all the get method generated by lombok

MyClassDatabase.java

@Dao
public interface MyClassDatabase {

}

buck-out/data/str_debug_source/com/room/MyClassDatabase_Impl.java

@Generated("android.arch.persistence.room.RoomProcessor")
@SuppressWarnings("unchecked")
public class MyClassDatabase_Impl implements MyClassDatabase {
  private final RoomDatabase __db;
}

and the build.gradle of module data

apply plugin: 'com.android.library'

android {
    compileSdkVersion versions.compileSdk
    buildToolsVersion versions.buildTools

    defaultConfig {
        minSdkVersion versions.minSdk
        targetSdkVersion versions.targetSdk
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        javaCompileOptions {
            annotationProcessorOptions {
                arguments = ["room.schemaLocation":
                                 "$projectDir/schemas".toString()]
            }
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')

    // Framework
    implementation deps.lombok
    annotationProcessor deps.lombok
    implementation deps.annotations
    annotationProcessor deps.annotations

    implementation deps.roomRuntime
    annotationProcessor deps.roomCompiler

}
kageiit commented 6 years ago

You are missing an implementation dependency on javax.annotation package

tesla1984 commented 6 years ago

@kageiit thanks

tesla1984 commented 6 years ago

@kageiit the method generated by lombok can not find. is the lombok does not support?