gpt4 book ai didi

java - 在 IntelliJ 中找不到符号变量 DaggerAppComponent

转载 作者:太空宇宙 更新时间:2023-11-04 11:13:18 28 4
gpt4 key购买 nike

我克隆了这个项目https://github.com/robohorse/RoboPOJOGenerator并尝试在 IntelliJ IDE 的帮助下进行构建。

它已成功导入并下载了必要的依赖项,但当我重建它时它失败了。

Error:(10, 24) java: cannot find symbol
symbol: variable DaggerAppComponent
location: class com.robohorse.robopojogenerator.injections.Injector

我已经尝试了许多 stackoverflow 线程,但对我不起作用。这是 gradle 还是 dagger 的东西。

buildscript {
repositories {
mavenCentral()
maven { url "http://dl.bintray.com/jetbrains/intellij-plugin-service" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath "net.ltgt.gradle:gradle-apt-plugin:0.9"
classpath "org.jetbrains.intellij.plugins:gradle-intellij-plugin:0.2.0-SNAPSHOT"
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.1'
}
}
apply plugin: "java"
apply plugin: "idea"
apply plugin: "org.jetbrains.intellij"
apply plugin: "net.ltgt.apt"
apply plugin: "jacoco"
apply plugin: 'com.github.kt3k.coveralls'

compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}

jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}

coveralls {
jacocoReportPath = "${buildDir}/reports/jacoco/test/jacocoTestReport.xml"
}

repositories {
mavenCentral()
}

group "com.robohorse.robopojogenerator"
version "1.8.3"

intellij {
pluginName "RoboPOJOGenerator"
intellij.updateSinceUntilBuild false
//intellij.localPath = "/Applications/IntelliJ IDEA CE.app/Contents"
}

ext.daggerVersion = '2.7'

dependencies {
testCompile "junit:junit:4.12"
testCompile 'org.mockito:mockito-core:2.0.86-beta'

compile "com.intellij:annotations:+@jar"
compile 'org.json:json:20160212'
compile 'commons-io:commons-io:2.4'
compile 'com.google.guava:guava:19.0'

compile "com.google.dagger:dagger:$daggerVersion"
apt "com.google.dagger:dagger-compiler:$daggerVersion"
compile "javax.annotation:jsr250-api:1.0"

compile 'com.fifesoft:rsyntaxtextarea:2.6.0'
}

最佳答案

**@Singleton**
@Component(modules = AppModule.class)
public interface AppComponent {
...
}

确保为您的组件添加了 @Singleton 注释。

关于java - 在 IntelliJ 中找不到符号变量 DaggerAppComponent,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45760431/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com