隨着'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