小编Nar*_* NK的帖子

带有 Hilt 的 Dagger 从模块在适配器中注入 ActivityContext

我正在使用匕首和刀柄,我想将 @ActivityContext 从模块注入到适配器,但出现此错误 -

ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.1ANTLR Runtime version 4.5.3 used for parser compilation does not match the current runtime version 4.7.1ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.1ANTLR Runtime version 4.5.3 used for parser compilation does not match the current runtime version 4.7.1/mnt/My Projects/app/build/generated/source/kapt/debug/app/myapp/MyApp_HiltComponents.java:156: error: [Dagger/MissingBinding] @dagger.hilt.android.qualifiers.ActivityContext android.content.Context cannot be provided without an @Provides-annotated method.
  public abstract static …
Run Code Online (Sandbox Code Playgroud)

android kotlin dagger dagger-hilt

5
推荐指数
1
解决办法
3121
查看次数

导航参数双重错误:无法转义标识符“0.0”,因为它包含非法字符

在导航图参数中为 Double 设置 defaultValue 时出错。

 <argument
            android:name="lat"
            app:argType="java.lang.Double"
            android:defaultValue="0.0"
            />
        <argument
            android:name="lon"
            app:argType="kotlin.Double"
            android:defaultValue="0.0"
            />
Run Code Online (Sandbox Code Playgroud)

我已经尝试了两者java.lang.Doublekotlin.Double使用安全参数插件。

如何传递具有默认值的 Double 参数?

navigation android kotlin

3
推荐指数
2
解决办法
2305
查看次数

标签 统计

android ×2

kotlin ×2

dagger ×1

dagger-hilt ×1

navigation ×1