Android Question #AdditionalJar conditional for Android Sdk 21+?

jo1234

Active Member
Licensed User
Longtime User
Hi,

firebase-crashlytics requires OkHttpUtils2, which requires Android Sdk 21+.

If I run my app with the following line on Android 4.2 (Sdk 17) I get, as expected, an error.

Code:
#AdditionalJar: com.google.firebase:firebase-crashlytics

Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 17
at okhttp3.internal.platform.AndroidPlatform.<clinit>(AndroidPlatform.kt:153)

How can I make the #AdditionalJar conditional so that it only is executed on Android Sdk 21+?

thanks a lot,
Johannes
 

jo1234

Active Member
Licensed User
Longtime User
I'll just increase minSdkVersion to 21 and ignore older devices because there are also issues with the camera on Android 4.2.
 
Upvote 0
Top