AkshayChordiya / News

A sample News 🗞 app built using Modern Android Development [Architecture Components, Coroutines, Retrofit, Room, Kotlin, Dagger]
MIT License
848 stars 166 forks source link

javax annotation does not exist #32

Closed tonisives closed 4 years ago

tonisives commented 4 years ago

I downloaded the master project and tried to build after adding the credentials file. There is an error:

kapt/debug/com/akshay/newsapp/ui/viewmodel/NewsArticleViewModel_Factory.java:5: error: package javax.annotation.processing does not exist import javax.annotation.processing.Generated;

I tried following https://github.com/google/dagger/issues/1339 to add Java 1.8 as compileOptions. Also tried to add java 1.8 to gradle.properties. These didn't resolve the issue. I should be using Java 1.8 by default everywhere.

What worked in the end was adding extra dependency: compileOnly 'com.github.pengrad:jdk9-deps:1.0'

edit: This fix made the build work. Seems like a Dagger issue

AkshayChordiya commented 4 years ago

Can you please try the latest master and let me know if that works for you? Thanks

tonisives commented 4 years ago

Hi, it works with the latest master and clean install. I have to say I completely removed Java11 that comes with IntelliJ so this might have helped also.

AkshayChordiya commented 4 years ago

That's awesome. I'm closing the issue.