Open lk666 opened 4 years ago
aspectjx版本2.0.10,目前发现主要有两个兼容问题: 1、同kotlin 1.4.10 zip file is empty; 2、Hilt版本2.28-alpha,使用aspectjx插件后,生成的Hilt_Application类不会被替换成项目的application的基类
/** * 怀疑是不是aspectJ影响了下面这段执行的问题 * A generated base class to be extended by the @dagger.hilt.android.HiltAndroidApp annotated class. If using the Gradle plugin, this is swapped as the base class via bytecode transformation. */ @Generated("dagger.hilt.android.processor.internal.androidentrypoint.ApplicationGenerator") public abstract class Hilt_AppContext extends MultiDexApplication implements GeneratedComponentManager<Object> { private final ApplicationComponentManager componentManager = new ApplicationComponentManager(new ComponentSupplier() { @Override public Object get() { return DaggerAppContext_HiltComponents_ApplicationC.builder() .applicationContextModule(new ApplicationContextModule(Hilt_AppContext.this)) .build(); } }); protected final ApplicationComponentManager componentManager() { return componentManager; } @Override public final Object generatedComponent() { return componentManager().generatedComponent(); } @CallSuper @Override public void onCreate() { // This is a known unsafe cast, but is safe in the only correct use case: // AppContext extends Hilt_AppContext // 使用aspectjX后不会执行到这里 ((AppContext_GeneratedInjector) generatedComponent()).injectAppContext(UnsafeCasts.<AppContext>unsafeCast(this)); super.onCreate(); } }
2、Hilt版本2.28-alpha,使用aspectjx插件后,生成的Hilt_Application类不会被替换成项目的application的基类 这个问题选择有什么解决办法么?
aspectjx版本2.0.10,目前发现主要有两个兼容问题: 1、同kotlin 1.4.10 zip file is empty; 2、Hilt版本2.28-alpha,使用aspectjx插件后,生成的Hilt_Application类不会被替换成项目的application的基类
/** * 怀疑是不是aspectJ影响了下面这段执行的问题 * A generated base class to be extended by the @dagger.hilt.android.HiltAndroidApp annotated class. If using the Gradle plugin, this is swapped as the base class via bytecode transformation. */ @Generated("dagger.hilt.android.processor.internal.androidentrypoint.ApplicationGenerator") public abstract class Hilt_AppContext extends MultiDexApplication implements GeneratedComponentManager<Object> { private final ApplicationComponentManager componentManager = new ApplicationComponentManager(new ComponentSupplier() { @Override public Object get() { return DaggerAppContext_HiltComponents_ApplicationC.builder() .applicationContextModule(new ApplicationContextModule(Hilt_AppContext.this)) .build(); } }); protected final ApplicationComponentManager componentManager() { return componentManager; } @Override public final Object generatedComponent() { return componentManager().generatedComponent(); } @CallSuper @Override public void onCreate() { // This is a known unsafe cast, but is safe in the only correct use case: // AppContext extends Hilt_AppContext // 使用aspectjX后不会执行到这里 ((AppContext_GeneratedInjector) generatedComponent()).injectAppContext(UnsafeCasts.<AppContext>unsafeCast(this)); super.onCreate(); } }
Hilt那个问题解决了不
现在有办法解决么?
'dagger.hilt.android.plugin' 插件引用放在 'android-aspectjx'之前试试
aspectjx版本2.0.10,目前发现主要有两个兼容问题: 1、同kotlin 1.4.10 zip file is empty; 2、Hilt版本2.28-alpha,使用aspectjx插件后,生成的Hilt_Application类不会被替换成项目的application的基类