码迷,mamicode.com
首页 > 移动开发 > 详细

AA 出现app:compileDebugJavaWithJavac

时间:2017-02-10 18:40:22      阅读:281      评论:0      收藏:0      [点我收藏+]

标签:androidannotation compiledebugjavawithjavac

当配置好androidanotation后,使用注释时会出现如题的错误。其中错误的原因网上有挺多的帖子了,列举些网上回答的问题。
1、因为版本不是最新的问题,更新最新的sdk
2、设置JDK为本地的jdk
3、也有的说要设置
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_6
};
4、有可能是资源文件的名字不符合安卓规则导致
5、有可能是重复引用了相同的库文件


上面那些都有可能引起,但是我是在使用androidannotation以后才出现。因此分析是这个库的问题,后来耐心看了官方文档,发现需要在build.gradle(moudel:app)中添加
apt {
arguments {
androidManifestFile variant.outputs[].processResources.manifestFile
}
}


如下

apply plugin: apply plugin: def AAVersion = android {
compileSdkVersion buildToolsVersion defaultConfig {
applicationId minSdkVersion targetSdkVersion versionCode versionName testInstrumentationRunner }
buildTypes {
release {
minifyEnabled proguardFiles getDefaultProguardFile()}
}

allprojects {
repositories {
maven { url }
}
}


}

apt {
arguments {
androidManifestFile variant.outputs[].processResources.manifestFile
}
}




这样 ,我的问题解决了。


AA 出现app:compileDebugJavaWithJavac

标签:androidannotation compiledebugjavawithjavac

原文地址:http://8065654.blog.51cto.com/8055654/1896757

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!