question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Hilt 2.42] [Kotlin 1.7.10] Failed to build

See original GitHub issue
> Task :app:kaptDebugKotlin

/home/runner/work/Refresh-Token-Sample/Refresh-Token-Sample/app/build/generated/source/kapt/debug/com/hoc081098/refreshtokensample/data/local/UserLocalSourceImpl_Factory.java:10: error: package error does not exist
import error.NonExistentClass;
            ^
> Task :app:compileDebugJavaWithJavac FAILED
/home/runner/work/Refresh-Token-Sample/Refresh-Token-Sample/app/build/generated/source/kapt/debug/com/hoc081098/refreshtokensample/data/local/UserLocalSourceImpl_Factory.java:21: error: cannot find symbol
  private final Provider<DataStore<NonExistentClass>> dataStoreProvider;
                                   ^
  symbol:   class NonExistentClass
  location: class UserLocalSourceImpl_Factory
/home/runner/work/Refresh-Token-Sample/Refresh-Token-Sample/app/build/generated/source/kapt/debug/com/hoc081098/refreshtokensample/data/local/UserLocalSourceImpl_Factory.java:25: error: cannot find symbol
  public UserLocalSourceImpl_Factory(Provider<DataStore<NonExistentClass>> dataStoreProvider,
                                                        ^
  symbol:   class NonExistentClass
  location: class UserLocalSourceImpl_Factory
/home/runner/work/Refresh-Token-Sample/Refresh-Token-Sample/app/build/generated/source/kapt/debug/com/hoc081098/refreshtokensample/data/local/UserLocalSourceImpl_Factory.java:37: error: cannot find symbol
      Provider<DataStore<NonExistentClass>> dataStoreProvider,
                         ^
  symbol:   class NonExistentClass
  location: class UserLocalSourceImpl_Factory
/home/runner/work/Refresh-Token-Sample/Refresh-Token-Sample/app/build/generated/source/kapt/debug/com/hoc081098/refreshtokensample/data/local/UserLocalSourceImpl_Factory.java:42: error: cannot find symbol
  public static UserLocalSourceImpl newInstance(DataStore<NonExistentClass> dataStore,
                                                          ^
  symbol:   class NonExistentClass
  location: class UserLocalSourceImpl_Factory
/home/runner/work/Refresh-Token-Sample/Refresh-Token-Sample/app/build/generated/source/kapt/debug/com/hoc081098/refreshtokensample/data/DataModule_Companion_DataStoreFactory.java:12: error: package error does not exist
import error.NonExistentClass;
            ^
/home/runner/work/Refresh-Token-Sample/Refresh-Token-Sample/app/build/generated/source/kapt/debug/com/hoc081098/refreshtokensample/data/DataModule_Companion_DataStoreFactory.java:22: error: cannot find symbol
public final class DataModule_Companion_DataStoreFactory implements Factory<DataStore<NonExistentClass>> {
                                                                                      ^
  symbol: class NonExistentClass
/home/runner/work/Refresh-Token-Sample/Refresh-Token-Sample/app/build/generated/source/kapt/debug/com/hoc081098/refreshtokensample/data/DataModule_Companion_DataStoreFactory.java:25: error: cannot find symbol
  private final Provider<Serializer<NonExistentClass>> serializerProvider;
                                    ^
  symbol:   class NonExistentClass
  location: class DataModule_Companion_DataStoreFactory
/home/runner/work/Refresh-Token-Sample/Refresh-Token-Sample/app/build/generated/source/kapt/debug/com/hoc081098/refreshtokensample/data/DataModule_Companion_DataStoreFactory.java:28: error: cannot find symbol
      Provider<Serializer<NonExistentClass>> serializerProvider) {
                          ^
  symbol:   class NonExistentClass
  location: class DataModule_Companion_DataStoreFactory
/home/runner/work/Refresh-Token-Sample/Refresh-Token-Sample/app/build/generated/source/kapt/debug/com/hoc081098/refreshtokensample/data/DataModule_Companion_DataStoreFactory.java:34: error: cannot find symbol
  public DataStore<NonExistentClass> get() {
                   ^
  symbol:   class NonExistentClass
  location: class DataModule_Companion_DataStoreFactory
/home/runner/work/Refresh-Token-Sample/Refresh-Token-Sample/app/build/generated/source/kapt/debug/com/hoc081098/refreshtokensample/data/DataModule_Companion_DataStoreFactory.java:40: error: cannot find symbol
      Provider<Serializer<NonExistentClass>> serializerProvider) {
                          ^
  symbol:   class NonExistentClass
  location: class DataModule_Companion_DataStoreFactory
/home/runner/work/Refresh-Token-Sample/Refresh-Token-Sample/app/build/generated/source/kapt/debug/com/hoc081098/refreshtokensample/data/DataModule_Companion_DataStoreFactory.java:45: error: cannot find symbol
      Serializer<NonExistentClass> serializer) {
                 ^
  symbol:   class NonExistentClass
  location: class DataModule_Companion_DataStoreFactory
/home/runner/work/Refresh-Token-Sample/Refresh-Token-Sample/app/build/generated/source/kapt/debug/com/hoc081098/refreshtokensample/data/DataModule_Companion_DataStoreFactory.java:44: error: cannot find symbol
  public static DataStore<NonExistentClass> dataStore(Context applicationContext,
                          ^
  symbol:   class NonExistentClass
  location: class DataModule_Companion_DataStoreFactory
13 errors
  • Build with koltin 1.6.10 or 1.6.21 works fine.

  • I already tried adding

kapt {
  correctErrorTypes = true
}

, but still no success.


Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
simsekselimcommented, Jul 14, 2022

Actually just upgrade hilt version 2.42 and solved…

0reactions
hoc081098commented, Oct 7, 2022

Just Update to kotlin 1.7.20, and it works

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android + Kotlin + Hilt: Error building project - Stack Overflow
Your AppSettings1 is a class which is inherited from the Application class and Hilt doesn't know what exactly that is and how to...
Read more >
Unsupported metadata version" in KaptWithoutKotlincTask ...
And when upgrading Hilt to 2.42: Execution failed for task ':app:hiltAggregateDepsDebug'. > A failure occurred while executing dagger.hilt.android.plugin.task.
Read more >
Navigation | Android Developers
To generate Java language code suitable for Java or mixed Java and Kotlin modules, add this line to your app or module's build.gradle...
Read more >
What's new in Kotlin 1.7.0
Release date: 9 June 2022. Kotlin 1.7.0 has been released. It unveils the Alpha version of the new Kotlin/JVM K2 compiler, ...
Read more >
iT 邦幫忙::一起幫忙解決難題,拯救 IT 人的一天
[開發筆記] [Android][Update Kotlin Version] [Update SDK Version] 所遇到 Build 的 Error 與 Fix 步驟. rainbowt ( ㄚT ). 2 個月前 ‧ 1055 瀏覽....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found