随着'com.android.tools.build:gradle:1.5.0'
和'com.neenbedankt.gradle.plugins:android-apt:1.8'
,AndroidAnnotation在处理注释方面效果很好。但是在我更新到'com.android.tools.build:gradle:2.0.0-beta4'
以便即时运行后,似乎AndroidAnnotation无法生成@EApplication。有没有什么办法解决这一问题?Gradle 2.0.0-beta4使得AndroidAnnotation不起作用
3
A
回答
3
您必须为此使用AA 4.0-SNAPSHOT。为AA快照
添加存储库:
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
更改AA版本至4.0快照
dependencies {
compile "org.androidannotations:androidannotations-api:4.0-SNAPSHOT"
apt "org.androidannotations:androidannotations:4.0-SNAPSHOT"
}
添加library:true
到apt
说法:
apt {
arguments {
androidManifestFile variant.outputs[0].processResources.manifestFile
resourcePackageName android.defaultConfig.applicationId
//only for Android Annotations 4.0-SNAPSHOT
library 'true'
}
}
这样AA不验证EApplication
,的存在等在您的清单,因此它将与即时运行编译。原因是即时运行会在清单中更改您的应用程序类,这就是AA无法在其中找到生成的应用程序类的原因。
更新: AA 4.0快照是模块化的,这意味着你必须添加AA REST客户端模块,以及在你的build.gradle
org.androidannotations:rest-spring:4.0-SNAPSHOT
org.androidannotations:rest-spring-api:4.0-SNAPSHOT
而且你必须改变REST注释进口org.androidannotations.rest.spring.annotations.*
。
相关问题
- 1. gradle构建不起作用
- 2. AspectJ + Gradle + Lombok不起作用
- 3. Gradle - 删除不起作用
- 4. 如何在Kotlin中使用AndroidAnnotation @FragmentArg?
- 5. 测试AndroidAnnotation EBean使用JUnit
- 6. cd命令在gradle不起作用
- 7. GitLab Gradle运行缓存不起作用
- 8. Gradle任务dependsOn不起作用
- 9. gradle play-services aar依赖不起作用
- 10. Android Gradle - 任务覆盖不起作用
- 11. tasks.setupAll.dependsOn(copyJars)在gradle中不起作用?
- 12. gradle任务uploadArchives不起作用
- 13. 推断 - gradle构建不起作用
- 14. Jersey + Gradle与maven依赖不起作用
- 15. 使用$ buildDir.parent时,Gradle复制方法不起作用
- 16. 使用gradle添加支持库v7,v13不起作用
- 17. 使用AndroidAnnotation调用EBean类中的getChildFragmentManager
- 18. ViewGroup injection with AndroidAnnotation
- 19. 如何使用AndroidAnnotation @SharedPref与科特林
- 20. Gradle上传如何真正起作用?
- 21. AndroidAnnotation REST API列表不填充正确
- 22. Gradle不拿起黄瓜-jvm
- 23. 得到其余功能不起作用
- 24. 我觉得setcookie不起作用
- 25. 我得到$ .cookie但它不起作用?
- 26. 获得来自Xnode器不起作用
- 27. 排球得到方法不起作用
- 28. rvm使用不起作用
- 29. 使用document.getElementsByName()不起作用?
- 30. 使用mshtml不起作用
嗨。感谢您的答复。作为你的回答,这里是我得到的错误: '错误:(3,47)错误:包org.androidannotations.annotations.rest不存在 错误:(4,47)错误:package org.androidannotations.annotations。休息不存在 错误:(5,39)错误:程序包org.androidannotations.api.rest不存在 错误:(13,33)错误:找不到符号类RestClientErrorHandling 错误:(12,2)错误:找不到符号类休息 错误:(34,6)错误:无法找到符号类获取' – maohieng
我更新了答案。 – WonderCsabo