我的库中有以下代码:
@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;
}
在图书馆的毕业典礼上,我有
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?