dagger-2

    0熱度

    2回答

    下面是活動,它仍然使用舊的DI模型,我試圖遷移到Dagger2(使用Dagger-android)。我想注入Presenter,正如你所看到的,一個依賴是'NewProjectDisplayer',它是活動中的自定義視圖。 這是 'NewProjectDisplayer' 我想要提供給演示 我有一個模塊(的AppModule),其提供像ProjectService全局相關性,login服務等 下面

    1熱度

    2回答

    我有一個小場景,我有以下結構,我試圖在baseActivity片段中注入片段管理器,但由於某種原因,我的運氣不佳:( @Singleton @Component(modules = { AppModule.class, ActivityModule.class, AndroidSupportInjectionModule.class }) public interfac

    0熱度

    1回答

    我在我的項目中使用了Dagger2發佈的庫。我已經定義AppComponent爲: @Singleton @Component(modules = { AndroidInjectionModule.class, AppModule.class, ActivityBuilder.class }) public interface AppComponent { @Compo

    0熱度

    1回答

    我已經花了數小時嘗試在谷歌中找到我的兩個匕首實現的區別。 它實現這樣 @Module class MatchesModule { @Provides @NetworkScope @IntoMap @RetrofitModulesName(eRetrofitModules.MATCHES) fun retrofitMatches(okHttpClient: OkHttpClient,

    0熱度

    1回答

    我有2次注射同一類的,我用它們來創建2個改造API客戶端: 改造實例: @Provides @Singleton @Named(NO_REAUTH_RETROFIT) fun provideNoAuthRetrofit(moshi: Moshi, okHttpClientBuilder: OkHttpClient.Builder): Retrofit { return Retrof

    1熱度

    1回答

    我有一個使用匕首-2和GRPC一個Java項目,當我嘗試建立使用它./gradlew構建我得到以下錯誤: > java.lang.NoClassDefFoundError: com/google/auto/common/MoreTypes 被MoreTypes應該是提供內部的匕首-2依賴或我應該提供該類路徑的依賴關係? 這是gradle.build文件內容的相關部分: plugins {

    0熱度

    1回答

    創建我創建retrofit2 @Module public class NetworkModule { private Context context; public NetworkModule(Application app) { this.context = app; } @Singleton @Provides

    0熱度

    2回答

    我試圖用@ContributesAndroidInjector在我的匕首模塊提供一個類,我看到的錯誤:[ClassName] is not a framework type. 有誰知道什麼是「框架式」是在何種情況下將一個類不能一?

    0熱度

    1回答

    我正在使用Dagger Android 2.13,並且正在設置活動範圍的依賴關係。 我明白瞭如何爲模塊內聲明的依賴性指定範圍: @Module public class MyActivityModule { @Provides @PerActivity MyActivityDataRepo provideMyActivityDataRepo() { re

    0熱度

    1回答

    我正在嘗試使用Dagger 2創建簡單的MVP Archtecture應用程序。我試圖獲得與本教程中相同的結果,但使用Kotlin。這是我的代碼到目前爲止。 主講人: class MainPresenter @Inject constructor(var view: IMainView): IMainPresenter{ override fun beginMessuring() {