apt函数包含在最新的android gradle插件中。 它叫做annotationProcessor
但是我无法使用annotationProcessor
和androidTestAnnotationProcessor
看到生成的匕首类
这是我的傻瓜:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'realm-android'
....
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:25.0.1'
}
dependencies {
// Dagger
compile 'com.google.dagger:dagger:2.8'
annotationProcessor 'com.google.dagger:dagger-compiler:2.8'
androidTestAnnotationProcessor 'com.google.dagger:dagger-compiler:2.8'
}
....
主要的gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven { url "https://jitpack.io" }
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'me.tatarka:gradle-retrolambda:3.3.0-beta4'
classpath "io.realm:realm-gradle-plugin:1.2.0"
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
为什么“Gradle build”不会生成类?