Sign in Go Pro

Dependency Injection in Android using Kodein

First Steps

 
Autoplay

Up next

Previous

About

You'll learn about the different libraries or artifacts provided by Kodein depending on the platform you're gonna use it.
You will also get all the steps required to integrate Kodein on your project and therefore add a Dependency Injection system to it.

Instructor

Links

Comments

Hola Jorge, acabo de clonar el repositorio del curso y sin hacer ningún cambio al ejecutar la aplicación esta crashea.

Me interesa mucho este curso, pero he tenido varios problemas con Kodein, no quiero dejar de intentar seguir con él, pero estoy que vuelvo a Dagger.

Te dejo el stack para que puedas revisar el ejemplo.

Saludos.
acá el stack.
me.jorgecastillo.kodein E/AndroidRuntime: FATAL EXCEPTION: main
Process: me.jorgecastillo.kodein, PID: 13524
java.lang.RuntimeException: Unable to resume activity {me.jorgecastillo.kodein/me.jorgecastillo.kodein.photoslist.view.PhotoListActivity}: org.kodein.di.Kodein$NotFoundException: No binding found for bind() with ? { ? }
Registered in this Kodein container:

at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3672)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3712)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2949)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1630)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6626)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
Caused by: org.kodein.di.Kodein$NotFoundException: No binding found for bind() with ? { ? }
Registered in this Kodein container:

at org.kodein.di.internal.KodeinContainerImpl.factory(KodeinContainerImpl.kt:174)
at org.kodein.di.KodeinContainer$DefaultImpls.factory$default(KodeinContainer.kt:33)
at org.kodein.di.KodeinContainer$DefaultImpls.provider(KodeinContainer.kt:80)
at org.kodein.di.internal.KodeinContainerImpl.provider(KodeinContainerImpl.kt:7)
at org.kodein.di.KodeinContainer$DefaultImpls.provider$default(KodeinContainer.kt:79)
at org.kodein.di.KodeinAwareKt$Instance$1.invoke(KodeinAware.kt:152)
at org.kodein.di.KodeinProperty$provideDelegate$1.invoke(properties.kt:39)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at me.jorgecastillo.kodein.photoslist.view.PhotoListActivity.getPresenter(Unknown Source:7)
at me.jorgecastillo.kodein.photoslist.view.PhotoListActivity.onResume(PhotoListActivity.kt:36)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1377)
at android.app.Activity.performResume(Activity.java:7140)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3647)

Hi, I'm having the same issue, have any guess in how to solve it?

Hi guys. First of all, sorry for taking so long to fix this, I've been a bit too busy lately. Also thank you for the valuable feedback.

I've updated the repo now to use lastest stable release of Kodein (6.0.0) and Coroutines (1.0.1). Also upgraded a couple more libraries and raised the compileSdkVersion and targetSdkVersion to 28. The compile time error you were getting is also fixed.

Please, try to pull the lastest master branch version and let me know if you have any other problems. Thanks for watching the course!

Thanks Jorge, now it's working perfectly. Congrats for a great course!

>
You need to go PRO to post comments.

Lessons in Dependency Injection in Android using Kodein