Dagger giving TypeNotPresentException in Android Kitkat only

49 views
Skip to first unread message

Jot

unread,
Jan 11, 2016, 10:08:13 AM1/11/16
to Dagger Discuss
Hi ,

I am using Dagger in my project. It is giving me TypeNotPresentException in Android Kitkat only. its is working fine in Android 5.0 and above.

below is error log.

 java.lang.RuntimeException: Unable to create application com.rs.android.alpha.GlobalMobileProductApplication: java.lang.TypeNotPresentException: Type com/rs/android/alpha/ui/MainFragmentListAdapter not present
                                                       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4447)
                                                       at android.app.ActivityThread.access$1300(ActivityThread.java:141)
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
                                                       at android.os.Handler.dispatchMessage(Handler.java:99)
                                                       at android.os.Looper.loop(Looper.java:137)
                                                       at android.app.ActivityThread.main(ActivityThread.java:5103)
                                                       at java.lang.reflect.Method.invokeNative(Native Method)
                                                       at java.lang.reflect.Method.invoke(Method.java:525)
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
                                                       at dalvik.system.NativeStart.main(Native Method)
                                                    Caused by: java.lang.TypeNotPresentException: Type com/rs/android/alpha/ui/MainFragmentListAdapter not present
                                                       at java.lang.Class.getDeclaredAnnotation(Native Method)
                                                       at java.lang.Class.getAnnotation(Class.java:243)
                                                       at dagger.internal.plugins.reflect.ReflectivePlugin.getModuleAdapter(ReflectivePlugin.java:51)
                                                       at dagger.internal.RuntimeAggregatingPlugin.getModuleAdapter(RuntimeAggregatingPlugin.java:98)
                                                       at dagger.internal.RuntimeAggregatingPlugin.collectIncludedModulesRecursively(RuntimeAggregatingPlugin.java:85)
                                                       at dagger.internal.RuntimeAggregatingPlugin.getAllModuleAdapters(RuntimeAggregatingPlugin.java:71)
                                                       at dagger.ObjectGraph$DaggerObjectGraph.makeGraph(ObjectGraph.java:166)
                                                       at dagger.ObjectGraph$DaggerObjectGraph.access$000(ObjectGraph.java:132)
                                                       at dagger.ObjectGraph.create(ObjectGraph.java:129)
                                                       at com.rs.android.alpha.Injector.init(Injector.java:20)
                                                       at com.rs.android.alpha.Injector.init(Injector.java:31)
                                                       at com.rs.android.alpha.GlobalMobileProductApplication.onCreate(GlobalMobileProductApplication.java:88)
                                                       at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
                                                       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4444)
                                                       at android.app.ActivityThread.access$1300(ActivityThread.java:141) 
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316) 
                                                       at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                       at android.os.Looper.loop(Looper.java:137) 
                                                       at android.app.ActivityThread.main(ActivityThread.java:5103) 
                                                       at java.lang.reflect.Method.invokeNative(Native Method) 
                                                       at java.lang.reflect.Method.invoke(Method.java:525) 
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
                                                       at dalvik.system.NativeStart.main(Native Method) 


and here is my gradle file.

androidTestCompile 'junit:junit:4.11'
androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
androidTestCompile 'org.mockito:mockito-core:1.9.5'
androidTestCompile fileTree(dir: 'libs', include: 'robotium-solo-5.2.2-SNAPSHOT.jar')
compile project(':swipelibrary')
compile project(':infinitePageIndicatorlibrary')
compile files('libs/core-3.1.0.jar')
compile project(':imagesliderlibrary')
compile 'com.google.code.gson:gson:2.3'
compile 'com.squareup.dagger:dagger:1.0.1'
compile 'com.squareup.dagger:dagger-compiler:1.0.1'
compile 'com.jakewharton:butterknife:1.3.2'
compile 'com.actionbarsherlock:viewpagerindicator:2.4.1'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.github.kevinsawicki:android-pusher:0.6'
compile 'com.squareup:otto:1.3.4'
compile 'com.squareup.picasso:picasso:2.4.0'
compile 'com.squareup.retrofit:retrofit:1.8.0'
compile 'me.dm7.barcodescanner:zxing:1.5'
compile 'com.squareup.okhttp:okhttp:2.3.0'
compile 'com.squareup.okio:okio:1.5.0'
compile project(':notificationslibrary')
compile project(path: ':alpmiddleware', configuration: 'acpDebug')
compile project(':customdialoglibrary')
compile files('libs/FlurryAnalytics-5.1.0.jar')
compile 'com.android.support:support-v4:22.0.0'
compile 'com.android.support:appcompat-v7:22.0.0'
compile project(':facebooklibrary')
compile files('libs/ibm-mobile-push-android-sdk-3.6.0.6.jar')
compile files('libs/ibm-mobile-push-android-sdk-plugin-inbox-3.6.0.6.jar')
compile 'com.google.android.gms:play-services:8.3.0'
compile 'io.reactivex:rxandroid:0.24.0'
compile 'io.realm:realm-android:0.82.1'
compile files('libs/ibm-mobile-push-android-sdk-plugin-inapp-3.6.0.6.jar')


Kindly help



Jesse Wilson

unread,
Jan 11, 2016, 10:10:12 AM1/11/16
to Dagger Discuss

Please upgrade to 1.2.2 as a minimum. Are you using ProGuard?


--
You received this message because you are subscribed to the Google Groups "Dagger Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dagger-discus...@googlegroups.com.
To post to this group, send email to dagger-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages