Сгенерированному компоненту кинжала не удалось найти символ классов котлина, даже если на этом компоненте нет строк чтения.
Задача: app: compileStagingDebugJavaWithJavac FAILED
\app\build\generated\source\kapt\stagingDebug\...\DaggerAppComponent.java:49: error: cannot find symbol
import com...features.Main.splash_screen.SplashScreenActivity;
^
symbol: class SplashScreenActivity
location: package com...features.Main.splash_screen
Когда я набираю код в Java, он запускается успешно, и эта проблема возникает только в Windows. Это не появляется в Mac или Linix.
interface ISplashScreen : IView {
fun gotoMainScreen()
}
@Module
abstract class SplashModule {
@Binds
abstract fun provideISplash(splashScreenActivity: SplashScreenActivity): ISplashScreen
}
class SplashScreenActivity : BaseActivity<SplashScreenPresenter>(), ISplashScreen {
@Inject
lateinit var splashScreenPresenter: SplashScreenPresenter
override fun gotoMainScreen() {
Navigator.goToMainScreen(context)
}
override fun onCreateInit(savedInstanceState: Bundle?) {
}
override fun getLayout(): Int = R.layout.activity_splash
override fun initPresenter(): SplashScreenPresenter = splashScreenPresenter
}
class SplashScreenPresenter @Inject constructor(view: ISplashScreen,
environment: PresenterEnvironment)
: BasePresenter<ISplashScreen>(view, environment) {
// TODO : load project data by API
@SuppressLint("CheckResult")
override fun startLogic(savedInstance: Bundle?) {
super.startLogic(savedInstance)
Completable.timer(3, TimeUnit.SECONDS)
.compose(getDestroyIoTransformer<Unit>())
.subscribe {
view.gotoMainScreen()
}
}
}
@Module
public abstract class ActivityModule {
@ContributesAndroidInjector(modules = SplashModule.class)
abstract SplashScreenActivity bindSplashScreenActivity();
@ContributesAndroidInjector(modules = { CartFragmentProvider.class, CategoryFragmentProvider.class})
abstract MainActivity bindMainActivity();
}
//Gradle
apply plugin: 'com.android.library'
apply plugin: 'kotlin-platform-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android'
implementation "com.google.dagger:dagger:2.23.1"
implementation "com.google.dagger:dagger-android-support:2.23.1"
kapt "com.google.dagger:dagger-compiler:2.23.1"
kapt "com.google.dagger:dagger-android-processor:2.23.1"
...\app\build\generated\source\kapt\stagingDebug\com\...\common\di\components\DaggerAppComponent.java:49: error: cannot find symbol
import com....features.Main.splash_screen.SplashScreenActivity;
^
symbol: class SplashScreenActivity
location: package com....features.Main.splash_screen
...\app\build\generated\source\kapt\stagingDebug\com\...\common\di\components\DaggerAppComponent.java:51: error: cannot find symbol
import com....features.Main.splash_screen.SplashScreenPresenter;
^
symbol: class SplashScreenPresenter
location: package com....features.Main.splash_screen
...\app\build\generated\source\kapt\stagingDebug\com\...\common\di\modules\ActivityModule_BindSplashScreenActivity.java:3: error: cannot find symbol
import com....features.Main.splash_screen.SplashModule;
^
symbol: class SplashModule
location: package com....features.Main.splash_screen
...\app\build\generated\source\kapt\stagingDebug\com\...\common\di\modules\ActivityModule_BindSplashScreenActivity.java:4: error: cannot find symbol
import com....features.Main.splash_screen.SplashScreenActivity;
^
symbol: class SplashScreenActivity
location: package com....features.Main.splash_screen
...\app\build\generated\source\kapt\stagingDebug\com\...\common\di\modules\ActivityModule_BindSplashScreenActivity.java:25: error: cannot find symbol
public interface SplashScreenActivitySubcomponent extends AndroidInjector<SplashScreenActivity> {
^
symbol: class SplashScreenActivity
location: class ActivityModule_BindSplashScreenActivity
...\app\build\generated\source\kapt\stagingDebug\com\...\common\di\modules\ActivityModule_BindSplashScreenActivity.java:27: error: cannot find symbol
interface Factory extends AndroidInjector.Factory<SplashScreenActivity> {}
^
symbol: class SplashScreenActivity
location: interface SplashScreenActivitySubcomponent
...\app\build\generated\source\kapt\stagingDebug\com\...\common\di\components\DaggerAppComponent.java:217: error: cannot find symbol
SplashScreenActivity arg0) {
^
symbol: class SplashScreenActivity
location: class DaggerAppComponent.SplashScreenActivitySubcomponentFactory
...\app\build\generated\source\kapt\stagingDebug\com\...\common\di\components\DaggerAppComponent.java:224: error: cannot find symbol
private final SplashScreenActivity arg0;
^
symbol: class SplashScreenActivity
location: class DaggerAppComponent.SplashScreenActivitySubcomponentImpl
...\app\build\generated\source\kapt\stagingDebug\com\...\common\di\components\DaggerAppComponent.java:226: error: cannot find symbol
private SplashScreenActivitySubcomponentImpl(SplashScreenActivity arg0Param) {
^
symbol: class SplashScreenActivity
location: class DaggerAppComponent.SplashScreenActivitySubcomponentImpl
...\app\build\generated\source\kapt\stagingDebug\com\...\common\di\components\DaggerAppComponent.java:233: error: cannot find symbol
private SplashScreenPresenter getSplashScreenPresenter() {
^
symbol: class SplashScreenPresenter
location: class DaggerAppComponent.SplashScreenActivitySubcomponentImpl
...\app\build\generated\source\kapt\stagingDebug\com\...\common\di\components\DaggerAppComponent.java:237: error: cannot find symbol
public void inject(SplashScreenActivity arg0) {
^
symbol: class SplashScreenActivity
location: class DaggerAppComponent.SplashScreenActivitySubcomponentImpl
...\app\build\generated\source\kapt\stagingDebug\com\...\common\di\components\DaggerAppComponent.java:240: error: cannot find symbol
private SplashScreenActivity injectSplashScreenActivity(SplashScreenActivity instance) {
^
symbol: class SplashScreenActivity
location: class DaggerAppComponent.SplashScreenActivitySubcomponentImpl
...\app\build\generated\source\kapt\stagingDebug\com\...\common\di\components\DaggerAppComponent.java:240: error: cannot find symbol
private SplashScreenActivity injectSplashScreenActivity(SplashScreenActivity instance) {
^
symbol: class SplashScreenActivity
location: class DaggerAppComponent.SplashScreenActivitySubcomponentImpl
...\app\build\generated\source\kapt\stagingDebug\com\...\features\Main\splash_screen\SplashScreenActivity_MembersInjector.java:14: error: cannot find symbol
public final class SplashScreenActivity_MembersInjector implements MembersInjector<SplashScreenActivity> {
^
symbol: class SplashScreenActivity
...\app\build\generated\source\kapt\stagingDebug\com\...\features\Main\splash_screen\SplashScreenActivity_MembersInjector.java:25: error: cannot find symbol
private final Provider<SplashScreenPresenter> splashScreenPresenterProvider;
^
symbol: class SplashScreenPresenter
location: class SplashScreenActivity_MembersInjector
...\app\build\generated\source\kapt\stagingDebug\com\...\features\Main\splash_screen\SplashScreenActivity_MembersInjector.java:33: error: cannot find symbol
Provider<SplashScreenPresenter> splashScreenPresenterProvider) {
^
symbol: class SplashScreenPresenter
location: class SplashScreenActivity_MembersInjector
...\app\build\generated\source\kapt\stagingDebug\com\...\features\Main\splash_screen\SplashScreenActivity_MembersInjector.java:48: error: cannot find symbol
Provider<SplashScreenPresenter> splashScreenPresenterProvider) {
^
symbol: class SplashScreenPresenter
location: class SplashScreenActivity_MembersInjector
...\app\build\generated\source\kapt\stagingDebug\com\...\features\Main\splash_screen\SplashScreenActivity_MembersInjector.java:42: error: cannot find symbol
public static MembersInjector<SplashScreenActivity> create(
^
symbol: class SplashScreenActivity
location: class SplashScreenActivity_MembersInjector
...\app\build\generated\source\kapt\stagingDebug\com\...\features\Main\splash_screen\SplashScreenActivity_MembersInjector.java:52: error: cannot find symbol
public void injectMembers(SplashScreenActivity instance) {
^
symbol: class SplashScreenActivity
location: class SplashScreenActivity_MembersInjector
...\app\build\generated\source\kapt\stagingDebug\com\...\features\Main\splash_screen\SplashScreenActivity_MembersInjector.java:61: error: cannot find symbol
public static void injectSplashScreenPresenter(SplashScreenActivity instance,
^
symbol: class SplashScreenActivity
location: class SplashScreenActivity_MembersInjector
...\app\build\generated\source\kapt\stagingDebug\com\...\features\Main\splash_screen\SplashScreenActivity_MembersInjector.java:62: error: cannot find symbol
SplashScreenPresenter splashScreenPresenter) {
^
symbol: class SplashScreenPresenter
location: class SplashScreenActivity_MembersInjector
...\app\build\generated\source\kapt\stagingDebug\com\...\features\Main\splash_screen\SplashScreenPresenter_Factory.java:8: error: cannot find symbol
public final class SplashScreenPresenter_Factory implements Factory<SplashScreenPresenter> {
^
symbol: class SplashScreenPresenter
...\app\build\generated\source\kapt\stagingDebug\com\...\features\Main\splash_screen\SplashScreenPresenter_Factory.java:9: error: cannot find symbol
private final Provider<ISplashScreen> viewProvider;
^
symbol: class ISplashScreen
location: class SplashScreenPresenter_Factory
...\app\build\generated\source\kapt\stagingDebug\com\...\features\Main\splash_screen\SplashScreenPresenter_Factory.java:13: error: cannot find symbol
public SplashScreenPresenter_Factory(Provider<ISplashScreen> viewProvider,
^
symbol: class ISplashScreen
location: class SplashScreenPresenter_Factory
...\app\build\generated\source\kapt\stagingDebug\com\...\features\Main\splash_screen\SplashScreenPresenter_Factory.java:20: error: cannot find symbol
public SplashScreenPresenter get() {
^
symbol: class SplashScreenPresenter
location: class SplashScreenPresenter_Factory
...\app\build\generated\source\kapt\stagingDebug\com\...\features\Main\splash_screen\SplashScreenPresenter_Factory.java:24: error: cannot find symbol
public static SplashScreenPresenter_Factory create(Provider<ISplashScreen> viewProvider,
^
symbol: class ISplashScreen
location: class SplashScreenPresenter_Factory
...\app\build\generated\source\kapt\stagingDebug\com\...\features\Main\splash_screen\SplashScreenPresenter_Factory.java:29: error: cannot find symbol
public static SplashScreenPresenter newInstance(ISplashScreen view,
^
symbol: class ISplashScreen
location: class SplashScreenPresenter_Factory
...\app\build\generated\source\kapt\stagingDebug\com\...\features\Main\splash_screen\SplashScreenPresenter_Factory.java:29: error: cannot find symbol
public static SplashScreenPresenter newInstance(ISplashScreen view,
^
symbol: class SplashScreenPresenter
location: class SplashScreenPresenter_Factory
...\app\src\main\java\com\...\common\di\modules\ActivityModule.java:3: error: cannot find symbol
import com....features.Main.splash_screen.SplashModule;
^
symbol: class SplashModule
location: package com....features.Main.splash_screen
...\app\src\main\java\com\...\common\di\modules\ActivityModule.java:4: error: cannot find symbol
import com....features.Main.splash_screen.SplashScreenActivity;
^
symbol: class SplashScreenActivity
location: package com....features.Main.splash_screen
...\app\src\main\java\com\...\common\di\modules\ActivityModule.java:16: error: cannot find symbol
abstract SplashScreenActivity bindSplashScreenActivity();
^
symbol: class SplashScreenActivity
location: class ActivityModule
...\app\build\generated\source\kapt\stagingDebug\com\...\common\di\modules\ActivityModule_BindSplashScreenActivity.java:24: error: cannot find symbol
@Subcomponent(modules = SplashModule.class)
^
symbol: class SplashModule
location: class ActivityModule_BindSplashScreenActivity
...\app\build\generated\source\kapt\stagingDebug\com\...\common\di\modules\ActivityModule_BindSplashScreenActivity.java:20: error: cannot find symbol
@ClassKey(SplashScreenActivity.class)
^
symbol: class SplashScreenActivity
location: class ActivityModule_BindSplashScreenActivity
...\app\src\main\java\com\...\common\di\modules\ActivityModule.java:15: error: cannot find symbol
@ContributesAndroidInjector(modules = SplashModule.class)
^
symbol: class SplashModule
location: class ActivityModule
...\app\build\generated\source\kapt\stagingDebug\com\...\common\di\components\DaggerAppComponent.java:143: error: cannot find symbol
return MapBuilder.<Class<?>, Provider<AndroidInjector.Factory<?>>>newMapBuilder(2).put(SplashScreenActivity.class, (Provider) splashScreenActivitySubcomponentFactoryProvider).put(MainActivity.class, (Provider) mainActivitySubcomponentFactoryProvider).build();}
^
symbol: class SplashScreenActivity
location: class DaggerAppComponent
...\app\build\generated\source\kapt\stagingDebug\com\...\common\di\components\DaggerAppComponent.java:234: error: cannot find symbol
return new SplashScreenPresenter(arg0, DaggerAppComponent.this.providePresenterEnvironmentProvider.get());}
^
symbol: class SplashScreenPresenter
location: class DaggerAppComponent.SplashScreenActivitySubcomponentImpl
...\app\build\generated\source\kapt\stagingDebug\com\...\common\di\components\DaggerAppComponent.java:271: error: cannot find symbol
return MapBuilder.<Class<?>, Provider<AndroidInjector.Factory<?>>>newMapBuilder(4).put(SplashScreenActivity.class, (Provider) DaggerAppComponent.this.splashScreenActivitySubcomponentFactoryProvider).put(MainActivity.class, (Provider) DaggerAppComponent.this.mainActivitySubcomponentFactoryProvider).put(CartFragment.class, (Provider) cartFragmentSubcomponentFactoryProvider).put(CategoriesFragment.class, (Provider) categoriesFragmentSubcomponentFactoryProvider).build();}
^
symbol: class SplashScreenActivity
location: class DaggerAppComponent.MainActivitySubcomponentImpl
...\app\build\generated\source\kapt\stagingDebug\com\...\features\Main\splash_screen\SplashScreenPresenter_Factory.java:21: error: cannot find symbol
return new SplashScreenPresenter(viewProvider.get(), environmentProvider.get());
^
symbol: class SplashScreenPresenter
location: class SplashScreenPresenter_Factory
...\app\build\generated\source\kapt\stagingDebug\com\...\features\Main\splash_screen\SplashScreenPresenter_Factory.java:31: error: cannot find symbol
return new SplashScreenPresenter(view, environment);
^
symbol: class SplashScreenPresenter
location: class SplashScreenPresenter_Factory
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
39 errors
FAILURE: Build failed with an exception.
Что пошло не так:
Не удалось выполнить задачу ': app: compileStagingDebugJavaWithJavac'.
Компиляция не удалась; подробности смотрите в сообщении об ошибке компилятора.
Попытка:
Запустите с параметром --stacktrace, чтобы получить трассировку стека. Запустите с параметром --info или --debug, чтобы получить больше вывода журнала. Запустите --scan, чтобы получить полное представление.
Получите дополнительную помощь по номеру https://help.gradle.org
В этой сборке использовались устаревшие функции Gradle, что делает его несовместимым с Gradle 6.0.
Используйте '--warning-mode all', чтобы показать отдельные предупреждения об устаревании.
См https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
СТРОИТЬ ОШИБКА в 23 с
50 выполняемых задач: 9 выполненных, 41 актуальных