sergejsha / tinybus

Simple, lightweight and fast event bus tailored for Android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TinyBus minSDK

kenshin171 opened this issue · comments

I implemented an application context bus. It works from jellybean and higher api levels, However on gingerbread api lvl 10 (2.3.6) when initialising the bus in my application context.

mBus = TinyBus.from(this);

it throws a java.lang.NoClassDefFoundError, Logcat is as below.

01-07 23:07:59.283 1421-1421/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.halfbit.tinybus.TinyBusDepot
at com.halfbit.tinybus.TinyBus.from(TinyBus.java:113)
at com.kenshin.repapp.App.onCreate(App.java:55)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:969)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3272)
at android.app.ActivityThread.access$2200(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:969)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)

I checked the source code the manifests states minsdk 14 but the build.gradle states minsdk 10. And so i found out that the problem is that TinyBusDepot uses ActivityLifecycleCallbacks which is only available in api lvl 14 and above. If i am not wrong build.gradle will always override manifests. So i recommend updating the build.gradle file to minsdk 14 and perhaps indicating in the readme the min sdk level for TinyBus.

#42 - added minimalistic support.