open-telemetry/opentelemetry-android

MinSdk code compatibility

LikeTheSalad opened this issue · 1 comments

Currently, our minSdk is set to 21, however, our code can still use some 21+ APIs without any warnings since the instrumentation subproject's lint check is desugaring-aware.

Based on the above, I believe we should mention in the README that any consumer project with its minSdk set to lower than 26 must enable desugaring, otherwise their app could crash in devices with API level < 26.

I personally prefer to avoid relying on the corelib desugaring mechanism because it can increase the final APK size, however, since the corelib desugaring feature is a requirement from the opentelemetry-java lib as well, then avoiding to use 21+ code in this repo won't make any difference when it comes to having to enable corelib desugaring in the consumer project. Still, I wanted to provide visibility on this issue in order to give more detailed info on why corelib desugaring must be enabled and also to provide a place for comments/ideas on this topic.

I think that putting a notice about the desugaring requirement is very important. We have it in our docs as well, and users have been tripped up by it.