zoukankan      html  css  js  c++  java
  • 记Dagger2使用过程中的一个BUG--compileGoogleDebugJavaWithJavac

      项目编译可以通过,不过没有生成Dagger2的类,导致无法运行项目。。

    错误提示

    Error:(14, 41) 错误: 找不到符号
    符号:   类 DaggerAppComponent
    位置: 程序包 com.codeest.geeknews.di.component

    Error:Execution failed for task ':geeknews:compileGoogleDebugJavaWithJavac'.
    > Compilation failed; see the compiler error output for details.

    在 Terminal 调试:gradlew compileGoogleDebugJavaWithJavac -stacktrace 可以跟踪问题所在具体位置。

    我的解决方式把 xxx-compiler 的引入方式都改为:annotationProcessor 。

      改前,不通过:

    //di
    compile rootProject.ext.dependencies["dagger"]
    compile rootProject.ext.dependencies["dagger-compiler"]
    compile rootProject.ext.dependencies["butterknife"]
    apt rootProject.ext.dependencies["butterknife-compiler"]

      改后,完美运行:

    //di
    compile rootProject.ext.dependencies["dagger"]
    annotationProcessor  rootProject.ext.dependencies["dagger-compiler"]
    compile rootProject.ext.dependencies["butterknife"]
    annotationProcessor rootProject.ext.dependencies["butterknife-compiler"]

     

    annotationProcessor 
  • 相关阅读:
    linux下配置java环境
    CentOS6 配置静态IP
    数据库的事务
    MySQL总论
    JDBC面试题
    scp命令
    大数据练习题
    Linux下的Mysql安装 & 配置
    Hive的安装配置 & 基础指令
    本地存储localStorage以及它的封装接口store.js的使用
  • 原文地址:https://www.cnblogs.com/jooy/p/9074463.html
Copyright © 2011-2022 走看看