Android之打开项目的经验(二)

若你的项目打开成功,但是在编译运行的时候报出这个错误:
annotations processors must be explicitly declared now
你只需要在gradle-defaultConfig中添加一句话就可以了:
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath = true
}
}

defaultConfig {
        applicationId "com.breakloop.httpurlconnectiondemo"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        javaCompileOptions {
            annotationProcessorOptions {
                includeCompileClasspath = true
            }
        }
    }

猜你喜欢

转载自blog.csdn.net/qq_37282683/article/details/83278728