I am experiencing a crash that I am not 100% sure what is going on. My suspicions are that it has to do with what retrolambda is doing under the hood to achieve the use of lambdas pre-Java 8. I am receiving the following crash:
04-21 13:50:32.609 1199-1199/com.ariets.af.debug E/AndroidRuntime: FATAL EXCEPTION: main java.lang.NoClassDefFoundError: java.util.Objects
at com.abercrombie.android.sdk.AFSDK.initialize(AFSDK.java:154)
at com.ariets.af.data.sdk.SDKClient.observeSdkInitialize(SDKClient.java:474)
at com.ariets.af.ui.splash.AfSplashScreenPresenterImpl.setupAfSdk(AfSplashScreenPresenterImpl.java:69)
at com.ariets.af.ui.splash.AFSplashScreenActivity.onCreate(AFSplashScreenActivity.java:84)
at android.app.Activity.performCreate(Activity.java:5008)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
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:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
I am not using java.util.Objects
directly (doing a search for that in my code, in fact, does not bring up any results). The following is an exerpt of what my code looks like:
findRegion().flatMap(afRegion -> setupSharedVariables(afRegion))
.flatMap(afRegion -> fetchContent(afRegion)) // THIS IS WHERE THE CRASH OCCURS
.flatMap(sessionHandler::initializeSession)
.doOnNext(complete -> {
isStarted = true;
logTime("startUp successfully completed", start);
});
Some background on the setup of the application:
- We're using retrolambda to support using lambdas on previous versions of Java.
- Our minSdkVersion is 16.
- A couple of gradle plugins we're using (in case any of these will provide some info as to what's going on):
- Retrolambda (obviously)
- Android-Apt
- Hugo
- Spoon
- Fabric
- ErrorProne
Like I said above, I think it might have something to do with what's happening under the hood. It's likely that something is adding the java.util.Objects
(which isn't available on API 16). Anybody have information that may be of use to me? How would I go about circumventing this without upping my minSdkVersion?