我在我的代码库中有以下代码:
@Documented
@IntDef({OpacityAnimationType.NONE,
OpacityAnimationType.BLINKING,
OpacityAnimationType.SHINY,
OpacityAnimationType.AURA,
})
public @interface OpacityAnimationType {
int NONE = 0;
int BLINKING = 1;
int SHINY = 2;
int AURA = 3;
}
在Gradle中,我有一个库
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
arguments = ["library" : "true"]
}
}
}
}
并且
configurations {
javadocDeps
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.android.support:appcompat-v7:$supportLibraryVersion"
compile "com.android.support:support-annotations:$supportLibraryVersion"
javadocDeps "com.android.support:support-annotations:$supportLibraryVersion"
}
我将我的代码部署到JFrog BinTray,然后尝试在应用程序中使用它。我必须从库依赖项中排除appcompat-v7和support-annotations,但是构建仍然失败并出现以下错误:
“错误:未能解析:annotationProcessor”
现在我卡住了,尝试了很多方法,但都没有帮助。我无法使用此库构建主要项目。
我需要实现任何自定义AnnotationProcessor才能使用@IntDef吗?