[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.
- Full stacktrace: https://github.com/hoc081098/Refresh-Token-Sample/runs/7231374595?check_suite_focus=true
- Source code (build successfully with kotlin 1.6.21): https://github.com/hoc081098/Refresh-Token-Sample
- PR updates to Kotlin 1.7.x (failed to build): https://github.com/hoc081098/Refresh-Token-Sample/pull/149
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Actually just upgrade hilt version 2.42 and solved…
Just Update to kotlin 1.7.20, and it works