当我添加RoboBlender时,Gradle项目无法构建 [英] Gradle project does not build when I add RoboBlender

查看:91
本文介绍了当我添加RoboBlender时,Gradle项目无法构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将RoboGuice 3依赖项添加到我的gradle构建文件中,该文件可以编译并运行,但是由于NoClassDefFoundError:AnnotationDatabaseImpl,应用程序崩溃了。有研究表明,RoboBlender是生成该定义所必需的(我熟悉RoboGuice 2,它不需要RoboBlender),但是当我添加RoboBlender时,该项目将不再构建。

I have added RoboGuice 3 dependency into my gradle build file it compiles and runs, however the application crashes because of NoClassDefFoundError: AnnotationDatabaseImpl. Did some research that suggested that RoboBlender was necessary to generate the definition (I'm familiar with RoboGuice 2 which does not require RoboBlender) but when I add RoboBlender the project no longer builds.

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:cardview-v7:21.0.+'
compile 'com.android.support:recyclerview-v7:21.0.+'
compile 'com.koushikdutta.urlimageviewhelper:urlimageviewhelper:1.0.4'
compile 'de.hdodenhof:circleimageview:1.2.1'
compile 'com.getbase:floatingactionbutton:1.4.0'
compile 'de.hdodenhof:circleimageview:1.2.1'
compile 'org.twitter4j:twitter4j-core:4.0.2'
compile files('libs/json-me.jar')
compile files('libs/twitter_api_me-1.9.jar')
compile('ch.acra:acra:4.5.0') {
    exclude group: 'org.json'
}
compile 'org.roboguice:roboguice:3.0.1'
provided 'org.roboguice:roboblender:3.0.1'

}

Build错误:

 Error:Execution failed for task ':app:compileDebugJava'.




java.lang.ClassCastException:com.sun.tools.javac。无法将code.Type强制转换为javax.lang.model.type.DeclaredType
l>

  • Gradle的依赖项缓存可能已损坏(有时会在网络连接超时后发生。)
    重新下载依赖项并同步项目(需要网络)
  • Gradle构建过程(守护程序)的状态可能已损坏。停止所有Gradle守护程序可以解决此问题。
    Stop Gradle构建过程(需要重新启动)
  • 在Gradle进程损坏的情况下,您也可以尝试关闭IDE,然后终止所有Java进程。

    java.lang.ClassCastException: com.sun.tools.javac.code.Type cannot be cast to javax.lang.model.type.DeclaredType l>

  • Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)
  • The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires restart)
  • In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

    是什么原因造成的,我该如何解决?

    Whats causing this and how can I fix it?

    推荐答案

    我发现了一个解决方法,我只是禁用了AnnotationDatabase处理并删除了RoboBlender依赖性,从而解决了我的问题。我仍然想知道为什么我会首先遇到这个问题。

    Well I found a workaround, I just disabled AnnotationDatabase processing and removed RoboBlender dependency and that fix my problem. I would still like to know why I'm having this problem in the first place.

    这篇关于当我添加RoboBlender时,Gradle项目无法构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆