google / dagger

A fast dependency injector for Android and Java.
https://dagger.dev
Apache License 2.0
17.43k stars 2.01k forks source link

Hilt gradle plugin doesn't pick classes from custom android sdk-addon #2151

Open allaudin opened 4 years ago

allaudin commented 4 years ago

We are using a custom Android SDK-Addon for developing our app. Including hilt gradle plugin resulted in a strange issue where classes from our sdk can no longer be found when referenced from hilt generated code. Running gradlew build task ends with cannot find symbol error (although all referenced classes from code are available in sdk-addon)

However, setting a standard compileSdkVersion and providing our sdk classes at compile time works fine.

silentnuke commented 3 years ago

@allaudin looks like this is related to https://github.com/google/dagger/issues/1991

Chang-Eric commented 3 years ago

Can you add the full error for the cannot find symbol error?

allaudin commented 3 years ago
symbol:  class ISystemDevice
  location: class BjDevice/com/sample/bluetooth/SystemDevice.java:485: error: cannot find symbol
    ISystemDevice internalDevice, @org.jetbrains.annotations.NotNull()

This is the sample error message we get where ISystemDevice comes from our Sdk Addon.