В моем предыдущем посте член сообщества, касающийся использования базы данных firebase firestore, порекомендовал мне загрузить приложение под названием make-it-so, которое использует базу данных firestore, чтобы узнать, как это работает. Я несколько раз пытался заставить приложение работать, но я продолжаю получать эту ошибку, есть идеи, почему? Буду признателен за любую оказанную помощь!
Сообщение об ошибке: https://gyazo.com/8b8d41eddc9b176c376b3e98c2c249e7
error: InjectProcessingStep was unable to process 'AccountServiceImpl(com.google.firebase.auth.FirebaseAuth)' because 'User' could not be resolved.
Dependency trace:
=> element (CLASS): com.example.makeitso.model.service.impl.AccountServiceImpl
=> element (METHOD): getCurrentUser()
=> type (EXECUTABLE method): ()kotlinx.coroutines.flow.Flow<User>
=> type (DECLARED return type): kotlinx.coroutines.flow.Flow<User>
=> type (ERROR type argument): User
If type 'User' is a generated type, check above for compilation errors that may have prevented the type from being generated. Otherwise, ensure that type 'User' is on your classpath.
error: InjectProcessingStep was unable to process 'SplashViewModel(ConfigurationService,com.example.makeitso.model.service.AccountService,com.example.makeitso.model.service.LogService)' because 'ConfigurationService' could not be resolved.
Dependency trace:
=> element (CLASS): com.example.makeitso.screens.splash.SplashViewModel
=> element (CONSTRUCTOR): SplashViewModel(ConfigurationService,com.example.makeitso.model.service.AccountService,com.example.makeitso.model.service.LogService)
=> type (EXECUTABLE constructor): (ConfigurationService,com.example.makeitso.model.service.AccountService,com.example.makeitso.model.service.LogService)void
=> type (ERROR parameter type): ConfigurationService
If type 'ConfigurationService' is a generated type, check above for compilation errors that may have prevented the type from being generated. Otherwise, ensure that type 'ConfigurationService' is on your classpath.
error: InjectProcessingStep was unable to process 'TasksViewModel(com.example.makeitso.model.service.LogService,com.example.makeitso.model.service.StorageService,ConfigurationService)' because 'ConfigurationService' could not be resolved.
Dependency trace:
=> element (CLASS): com.example.makeitso.screens.tasks.TasksViewModel
=> element (FIELD): configurationService
=> type (ERROR field): ConfigurationService
If type 'ConfigurationService' is a generated type, check above for compilation errors that may have prevented the type from being generated. Otherwise, ensure that type 'ConfigurationService' is on your classpath.
error: ModuleProcessingStep was unable to process 'com.example.makeitso.model.service.module.ServiceModule' because 'ConfigurationServiceImpl' could not be resolved.
InjectProcessingStep was unable to process 'AccountServiceImpl(com.google.firebase.auth.FirebaseAuth)' because 'User' could not be resolved.
Dependency trace:
=> element (CLASS): com.example.makeitso.model.service.module.ServiceModule
=> element (METHOD): provideConfigurationService(ConfigurationServiceImpl)
=> type (EXECUTABLE method): (ConfigurationServiceImpl)ConfigurationService
=> type (ERROR parameter type): ConfigurationServiceImpl
If type 'ConfigurationServiceImpl' is a generated type, check above for compilation errors that may have prevented the type from being generated. Otherwise, ensure that type 'ConfigurationServiceImpl' is on your classpath.
error: BindingMethodProcessingStep was unable to process 'provideAccountService(com.example.makeitso.model.service.impl.AccountServiceImpl)' because 'ConfigurationServiceImpl' could not be resolved.
Dependency trace:
=> element (CLASS): com.example.makeitso.model.service.module.ServiceModule
=> element (METHOD): provideConfigurationService(ConfigurationServiceImpl)
=> type (EXECUTABLE method): (ConfigurationServiceImpl)ConfigurationService
=> type (ERROR parameter type): ConfigurationServiceImpl
If type 'ConfigurationServiceImpl' is a generated type, check above for compilation errors that may have prevented the type from being generated. Otherwise, ensure that type 'ConfigurationServiceImpl' is on your classpath.
error: BindingMethodProcessingStep was unable to process 'provideLogService(com.example.makeitso.model.service.impl.LogServiceImpl)' because 'ConfigurationServiceImpl' could not be resolved.
Dependency trace:
=> element (CLASS): com.example.makeitso.model.service.module.ServiceModule
=> element (METHOD): provideConfigurationService(ConfigurationServiceImpl)
=> type (EXECUTABLE method): (ConfigurationServiceImpl)ConfigurationService
=> type (ERROR parameter type): ConfigurationServiceImpl
If type 'ConfigurationServiceImpl' is a generated type, check above for compilation errors that may have prevented the type from being generated. Otherwise, ensure that type 'ConfigurationServiceImpl' is on your classpath.
error: BindingMethodProcessingStep was unable to process 'provideStorageService(com.example.makeitso.model.service.impl.StorageServiceImpl)' because 'ConfigurationServiceImpl' could not be resolved.
Dependency trace:
=> element (CLASS): com.example.makeitso.model.service.module.ServiceModule
=> element (METHOD): provideConfigurationService(ConfigurationServiceImpl)
=> type (EXECUTABLE method): (ConfigurationServiceImpl)ConfigurationService
=> type (ERROR parameter type): ConfigurationServiceImpl
If type 'ConfigurationServiceImpl' is a generated type, check above for compilation errors that may have prevented the type from being generated. Otherwise, ensure that type 'ConfigurationServiceImpl' is on your classpath.
error: BindingMethodProcessingStep was unable to process 'provideConfigurationService(ConfigurationServiceImpl)' because 'ConfigurationServiceImpl' could not be resolved.
Dependency trace:
=> element (CLASS): com.example.makeitso.model.service.module.ServiceModule
=> element (METHOD): provideConfigurationService(ConfigurationServiceImpl)
=> type (EXECUTABLE method): (ConfigurationServiceImpl)ConfigurationService
=> type (ERROR parameter type): ConfigurationServiceImpl
If type 'ConfigurationServiceImpl' is a generated type, check above for compilation errors that may have prevented the type from being generated. Otherwise, ensure that type 'ConfigurationServiceImpl' is on your classpath.
InjectProcessingStep was unable to process 'SplashViewModel(ConfigurationService,com.example.makeitso.model.service.AccountService,com.example.makeitso.model.service.LogService)' because 'ConfigurationService' could not be resolved.
InjectProcessingStep was unable to process 'TasksViewModel(com.example.makeitso.model.service.LogService,com.example.makeitso.model.service.StorageService,ConfigurationService)' because 'ConfigurationService' could not be resolved.
ModuleProcessingStep was unable to process 'com.example.makeitso.model.service.module.ServiceModule' because 'ConfigurationServiceImpl' could not be resolved.
BindingMethodProcessingStep was unable to process 'provideAccountService(com.example.makeitso.model.service.impl.AccountServiceImpl)' because 'ConfigurationServiceImpl' could not be resolved.
BindingMethodProcessingStep was unable to process 'provideLogService(com.example.makeitso.model.service.impl.LogServiceImpl)' because 'ConfigurationServiceImpl' could not be resolved.
BindingMethodProcessingStep was unable to process 'provideStorageService(com.example.makeitso.model.service.impl.StorageServiceImpl)' because 'ConfigurationServiceImpl' could not be resolved.
BindingMethodProcessingStep was unable to process 'provideConfigurationService(ConfigurationServiceImpl)' because 'ConfigurationServiceImpl' could not be resolved.
> Task :app:kaptDevDebugKotlin FAILED
Execution failed for task ':app:kaptDevDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
> java.lang.reflect.InvocationTargetException (no error message)
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
Большое спасибо! Ресурс, репозиторий и серия действительно полезны, теперь я могу углубиться в изучение firestore :) Большое спасибо! Кроме того, продолжайте выпускать видео на YouTube, чтобы я мог продолжать учиться и там! :)@Алекс Мамо
Отвечая как вики сообщества, как упоминал Алекс Мамо в комментариях выше.
Если вы хотите научиться создавать простые приложения с помощью Firestore и Jetpack Compose, я думаю, что этот ресурс обязательно вам поможет. Вот соответствующий репозиторий . Или вам может быть интересно прочитать эту серию.
Вы можете обратиться к этим Link1 и Link2, которые могут вам помочь.
зайдите в панель проекта и измените вид Android на проект
после этого проверьте, существует ли файл google-services.json, если его нет, попросите его у владельца проекта, и тогда он будет работать
Спасибо за комментарий! Я уже настроил проект в firebase, содержащий базу данных firestore, auth и realtime. Когда я загрузил этот проект kotlin, я добавил файл j-son в качестве стандартного (как вы уже описали выше) и подключил ключ SHA-1 к соответствующему проекту. Проблема возникает позже, когда я запускаю проект, затем возникает эта ошибка @Josue Muleshi
Если вы хотите научиться создавать простые приложения с помощью Firestore и Jetpack Compose, я думаю, что этот ресурс обязательно вам поможет. Вот соответствующий репозиторий . Или вам может быть интересно прочитать эту серию.