0
0

More than 3 years have passed since last update.

Dagger2 でのエラー対処 java.lang.RuntimeException: android.app.Application does not implement dagger.android.HasAndroidInjector

Posted at

発生した問題

Dagger2 を導入したいが下記のエラーがでて、うまくいかない
どうやら AndroidInjection.inject(this) でエラーが発生している模様

java.lang.RuntimeException: android.app.Application does not implement dagger.android.HasAndroidInjector

解決策

Manifest に Application クラスを継承したクラスを書いていなかったのが問題
App クラスを追加したら解決した。

AndroidManifest
    <application
        android:name=".App"

github
https://github.com/higuuu/higuuu-github-api/commit/bdca6867948e4dbacc02f346358a1a48394c0d2d

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0