rattleshirt
06/04/2017, 7:27 AMtrevjones
08/25/2017, 4:19 AM@Component
on it?trevjones
08/25/2017, 1:54 PMjuliocbcotta
10/02/2017, 4:56 PMdave08
01/31/2018, 3:45 AM@Provides
, only when I ran in terminal, I saw it, now everything works! Your 'did you see `kaptGenerateStubs`' question made me look there ... 😊dave08
01/31/2018, 11:41 AMjava.lang.NoClassDefFoundError: javax/inject/Provider
, when running?dave08
01/31/2018, 1:42 PM@Provides @Singleton fun provideOdooClient(xmlRpcCoroutineClient: XmlRpcCoroutineClient): OdooClient =
OdooClientImpl(
xmlRpcCoroutineClient,
System.getenv("ODOO_HOST"),
System.getenv("ODOO_PORT")?.toInt(),
System.getenv("ODOO_DB")
)
@Provides @Named("isOdooClientReady") fun provideOdooClientStatus(odooClient: OdooClient): Deferred<Boolean> =
odooClient.login(
System.getenv("ODOO_USER"),
System.getenv("ODOO_PASS")
)
And (in main verticle):
@Inject @Named("isOdooClientReady") lateinit var isOdooClientReady: Deferred<Boolean>
Is there any reason I should be getting
ModelComponent.java:10: error: kotlinx.coroutines.experimental.Deferred<java.lang.Boolean> cannot be provided without an @Provides- or @Produces-annotated method.
public abstract void inject(@org.jetbrains.annotations.NotNull()
?hmole
06/08/2018, 10:13 AMtamas.barta
07/03/2018, 7:54 AMkapt
tasks running for long minutes. We only use kapt
for Dagger. Is there any known issues, that I couldn't find with my hours of googling on the topic? We use parallel task execution for many modules (of an Android app), and the result is still 10 minutes, which is made up mostly from dexing and kapt
. We tried upgrading every library including Dagger, and the issue persists. Do you have any suggestions?cvmocanu
08/06/2018, 4:35 PM<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<executions>
<execution>
<id>kapt</id>
<phase>compile</phase>
<goals>
<goal>kapt</goal>
</goals>
<configuration>
<sourceDirs>
<sourceDir>src/main/kotlin</sourceDir>
<sourceDir>src/main/java</sourceDir>
</sourceDirs>
<annotationProcessorPaths>
<!-- Specify your annotation processors here. -->
<annotationProcessorPath>
<groupId>com.google.dagger</groupId>
<artifactId>dagger-compiler</artifactId>
<version>2.16</version>
</annotationProcessorPath>
</annotationProcessorPaths>
</configuration>
</execution>
</executions>
</plugin>
This works from maven, but IntelliJ is completely clueless. By this, I mean that no additional files are generated in my target directory when I press Ctrl+F9 (or choose to rebuild the module). There is only a "classes" directory there.
(3) as a quick test I also tried a small gradle project. The only way I could get it to work was to delegate compile to gradle (Settings > Build, Execution, Deployment > Build Tools > Gradle > Runner -> enable: "Delegate build/run actions to gradle")
But this means it's gradle that compiles & runs kapt, not IntelliJ.
So now I'm out of ideas.
Is there a way to make IntelliJ automatically run kapt as part of building (Ctrl+F9)?
Or is basically dagger 2 useless on a maven + Kotlin project? If I have to do "mvn clean package" every time I change a class, that makes dagger 2 useless for me (and for anyone that cares about development productivity).
Also, if you use gradle + dagger 2 + kotlin and you delegate build/run actions to gradle, doesn't this make the whole compilation unbearably slow? Especially given the fact that apparently kapt cannot run in gradle incremental mode (https://youtrack.jetbrains.com/issue/KT-11978).trevjones
08/09/2018, 3:13 AMDon’t use raw types
neuber
08/23/2018, 8:32 PMSlackbot
08/24/2018, 3:30 AMlocke
10/12/2018, 1:59 PMActivity
refactor, and now am running into these issues where the DataBinding is failing. After a lot of debugging, I discovered that if I remove: implementation 'com.google.dagger:dagger-android:$project.daggerVersion'
it successfully builds the DataBinding components (while failing on the Android-Dagger specific ones, obviously.) It is worth noting that DataBinding builds fine with the standard Dagger 2 include implementation "com.google.dagger:dagger:$project.daggerVersion"
, it is only the Android specific module that is failing me
I'm not receiving large blocks of errors, but I appreciate that suggestion either way.hmole
10/22/2018, 12:33 PMSam
10/25/2018, 6:50 PMSam
10/26/2018, 12:26 AMDavid
10/27/2018, 6:59 PMhmole
10/28/2018, 3:52 PM@Binds
bindings and then just include it via submodules
, so you don't have to do @JvmStatic
nonsense.Sam
10/29/2018, 4:32 PMdarkmoon_uk
10/30/2018, 8:48 PMkapt
, lack of which is currently preventing Kotlin projects benefiting from the latest incremental features in both Gradle and Dagger2:
https://youtrack.jetbrains.com/issue/KT-23880Sangeet
10/31/2018, 6:38 AMafterEvaluate {
extensions.findByName('kapt')?.arguments{
arg("dagger.formatGeneratedSource","disabled")
arg("dagger.gradle.incremental","enabled")
}
}
gradle is giving warning The following options were not recognized by any processor: '[dagger.gradle.incremental, kapt.kotlin.generated, dagger.formatGeneratedSource]'
Sudhir Singh Khanger
11/01/2018, 9:53 AMclass DetailViewModelFactory(private val id: Int) : ViewModelProvider.Factory {
private val movieRepository: MovieRepository = Injector.getAppComponent().getMovieRepository()
I was wondering if this piece of code could be rewritten in primary and secondary constructor form where MovieRepository
injected via Dagger 2. (Code:- https://github.com/sudhirkhanger/Genius)Paul Woitaschek
11/19/2018, 5:27 PMwilliam
11/23/2018, 8:21 PMsujin
11/25/2018, 5:31 AMwilliam
12/12/2018, 1:11 AMbodo
12/13/2018, 8:56 AM@ContributesAndroidInjector(modules = [FooFragmentModule::class])
abstract fun bindFooFragment(): FooFragment -> FooFragment can not be accessed
Does someone have an solution for this issue?juliocbcotta
12/21/2018, 4:28 PMkapt {
arguments {
arg('dagger.gradle.incremental')
arg('dagger.formatGeneratedSource', 'disabled')
arg('dagger.fastInit', 'enabled')
}
}
Should I place it in all gradle modules that uses dagger ?hmole
01/09/2019, 4:11 PMmethod does not override or implement a method from a supertype
. Ide doesn't show any errors in my generated component, but javac
can't compile it and fails with this message. First time i'm seeing it and nothing on google.