Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 匕首组件:错误:找不到符号kotlin类_Android_Kotlin_Dagger - Fatal编程技术网

Android 匕首组件:错误:找不到符号kotlin类

Android 匕首组件:错误:找不到符号kotlin类,android,kotlin,dagger,Android,Kotlin,Dagger,生成的dagger组件无法找到kotlin类的符号,即使该组件上并没有读取行 任务:应用程序:CompileStatingDebugJavaWithJavaC失败 当我用java键入代码时,它会成功运行,而这个问题只在windows中发生。它不会出现在mac或linux中 interface ISplashScreen : IView { fun gotoMainScreen() } @Module abstract class SplashModule { @Binds

生成的dagger组件无法找到kotlin类的符号,即使该组件上并没有读取行

任务:应用程序:CompileStatingDebugJavaWithJavaC失败

当我用java键入代码时,它会成功运行,而这个问题只在windows中发生。它不会出现在mac或linux中

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"

界面ISplashScreen:IView{
趣味大屏幕()
}
@模块
抽象类模块{
@束缚
抽象乐趣提供Splash(splashScreenActivity:splashScreenActivity):ISplashScreen
}
类SplashScreenActivity:BaseActivity(),ISplashScreen{
@注入
lateinit var splashScreenPresenter:splashScreenPresenter
覆盖趣味gotoMainScreen(){
Navigator.goToMainScreen(上下文)
}
重写FunonCreateInit(savedInstanceState:Bundle?){
}
重写fun getLayout():Int=R.layout.activity\u splash
重写initPresenter():SplashScreenPenter=SplashScreenPenter
}
类SplashScreenPresenter@Inject构造函数(视图:ISplashScreen,
环境:演示文稿(环境)
:BasePresenter(视图、环境){
//TODO:通过API加载项目数据
@SuppressLint(“检查结果”)
覆盖(savedInstance:Bundle?){
super.startLogic(保存状态)
可完成。计时器(3,时间单位。秒)
.compose(getTransformer())
.订阅{
view.gotoMainScreen()
}
}
}
@模块
公共抽象类活动模块{
@贡献Android喷油器(模块=飞溅模块.class)
抽象SplashScreenActivity bindSplashScreenActivity();
@ContributesAndroidInjector(模块={CartFragmentProvider.class,CategoryFragmentProvider.class})
抽象MainActivity bindMainActivity();
}
//格拉德尔
应用插件:“com.android.library”
应用插件:“kotlin平台android”
应用插件:“kotlin kapt”
应用插件:“kotlin android”
实现“com.google.dagger:dagger:2.23.1”
实现“com.google.dagger:dagger android支持:2.23.1”
kapt“com.google.dagger:dagger编译器:2.23.1”
kapt“com.google.dagger:dagger android处理器:2.23.1”
…\app\build\generated\source\kapt\stagingDebug\com\…\common\di\components\DaggerAppComponent.java:49:错误:找不到符号
导入com…features.Main.splash_screen.SplashScreenActivity;
^
符号:班级活动
位置:package com…features.Main.splash_屏幕
…\app\build\generated\source\kapt\stagingDebug\com\…\common\di\components\DaggerAppComponent.java:51:错误:找不到符号
导入com….features.Main.splash_screen.SplashScreenPresenter;
^
符号:课堂演示者
位置:package com…features.Main.splash_屏幕
…\app\build\generated\source\kapt\stagingDebug\com\…\common\di\modules\ActivityModule\u BindSplashScreenActivity.java:3:错误:找不到符号
导入com…features.Main.splash\u screen.splash模块;
^
符号:类别模块
位置:package com…features.Main.splash_屏幕
…\app\build\generated\source\kapt\stagingDebug\com\…\common\di\modules\ActivityModule\u BindSplashScreenActivity.java:4:错误:找不到符号
导入com…features.Main.splash_screen.SplashScreenActivity;
^
符号:班级活动
位置:package com…features.Main.splash_屏幕
…\app\build\generated\source\kapt\stagingDebug\com\…\common\di\modules\ActivityModule\u BindSplashScreenActivity.java:25:错误:找不到符号
公共界面SplashScreenActivity子组件扩展了AndroidJector{
^
符号:班级活动
位置:课堂活动模块
…\app\build\generated\source\kapt\stagingDebug\com\…\common\di\modules\ActivityModule\u BindSplashScreenActivity.java:27:错误:找不到符号
接口工厂扩展了Androidjector.Factory{}
^
符号:班级活动
位置:界面活动子组件
…\app\build\generated\source\kapt\stagingDebug\com\…\common\di\components\DaggerAppComponent.java:217:错误:找不到符号
(活动arg0){
^
符号:班级活动
位置:类别DaggerAppComponent.SplashScreenActivitySubcomponentFactory
…\app\build\generated\source\kapt\stagingDebug\com\…\common\di\components\DaggerAppComponent.java:224:错误:找不到符号
私人活动arg0;
^
符号:班级活动
位置:类别DaggerAppComponent.SplashScreenActivitySubcomponentImpl
…\app\build\generated\source\kapt\stagingDebug\com\…\common\di\components\DaggerAppComponent.java:226:错误:找不到符号
专用SplashScreenActivity子组件TIMPL(SplashScreenActivity arg0Param){
^
符号:班级活动
位置:类别DaggerAppComponent.SplashScreenActivitySubcomponentImpl
…\app\build\generated\source\kapt\stagingDebug\com\…\common\di\components\DaggerAppComponent.java:233:错误:找不到符号
私有SplashScreenPresenter getSplashScreenPresenter(){
^
符号:课堂演示者
位置:类别DaggerAppComponent.SplashScreenActivitySubcomponentImpl
…\app\build\generated\source\kapt\stagingDebug\com\…\common\di\components\DaggerAppComponent.java:237:错误:找不到符号
公共图书馆(Sp)
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.