Baqar Gogia
Baqar Gogia

Reputation: 367

kapt3 build generated errors

enter image description here

this is how my gradle looks

//Dagger DI
implementation 'com.google.dagger:dagger:2.10'
kapt 'com.google.dagger:dagger-compiler:2.10'
compileOnly 'org.glassfish:javax.annotation:10.0-b28'

//Retrofit & OkHttp
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'io.reactivex.rxjava2:rxjava:2.1.12' 
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
implementation 'com.google.code.gson:gson:2.8.2'

after build it generates retrofit implementation classes with errors, there are too many of them and this is part of this error logs.

this is Dagger component

   @Singleton
   @Component(modules = [(RetrofitModule::class)])
   interface AppDependencyComponent {

   }

this is RetrofitModule.class

@Module
class RetrofitModule {

   @Provides
   @Singleton
   fun authenticateService(): AuthenticateService {
       return RetrofitConfig().authenticateService
   }
}

Upvotes: 3

Views: 139

Answers (2)

Neha Chauhan
Neha Chauhan

Reputation: 647

kapt deps.dagger.android_support_compiler
kapt deps.dagger.compiler

dagger.android_support_compiler = "com.google.dagger:dagger-android-processor:$versions.dagger"

Add this >> kapt "com.google.dagger:dagger-android-processor:$versions.dagger"

Upvotes: 0

Baqar Gogia
Baqar Gogia

Reputation: 367

Fixed Update, one of the packages name was "abstract" and after generateStubs it was generating "com.bla.bal.abstract.Class" where abstract is language modifier and because of it threw error

Upvotes: 3

Related Questions