MoPub crashes application on Android 4.2

android
fabric
api

#1

Whenever I start Application on Android 4.2 test device I get following error:

12-10 12:08:26.390 10150-10150/com.smsrobot.period E/AndroidRuntime: FATAL EXCEPTION: main java.lang.NoClassDefFoundError: io.fabric.sdk.android.services.persistence.PreferenceStoreImpl at io.fabric.sdk.android.services.common.AdvertisingInfoProvider.<init>(AdvertisingInfoProvider.java:37) at io.fabric.sdk.android.services.common.IdManager.<init>(IdManager.java:113) at io.fabric.sdk.android.Fabric$Builder.build(Fabric.java:259) at io.fabric.sdk.android.Fabric.with(Fabric.java:311) at com.smsrobot.period.PeriodApp.onCreate(PeriodApp.java:39) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1000) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4391) at android.app.ActivityThread.access$1300(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5039) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method)

Application runs as expected on android 5.0…
It crashes when Fabric is initiated in Application class in onCreate method on line:
Fabric.with(this, new Crashlytics());

I have used latest fabric plugin to include Crashlytics and MoPub into the project, my gradle file has following lines:
compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') { transitive = true; } compile('com.mopub.sdk.android:mopub:4.2.0@aar') { transitive = true; } compile('io.fabric.sdk.android:fabric:1.3.10@aar') { transitive = true; }

I have read on this forum that Fabric with MoPub should be initiated like this:
Fabric.with(this, new Crashlytics(), new MoPub());

But MoPub class that I have imported into project is not extended from Fabric Kit, so I can’t perform Fabric initialisation. with MoPub.
Is MoPub still extended from Fabric Kit ??

I have tried everything.

If I don’t resolve this problem in next coiple of days I will be forced to remove mopub from project.


#2

Sorry fellas :smile:
It was my mistake, I will left this post for anyone that gets caught in same trap a I did.

I have left “multiDexEnabled true” which was causing problem on older version of Android.

But I would still like to know how to make MoPub play nicely with Fabric and how to initialize Fabric witih MoPub via:
Fabric.with(this, new Crashlytics(), new MoPub());