-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting minimum compileSdk version to 33 #234
Setting minimum compileSdk version to 33 #234
Conversation
If you set |
Those help with bytecode compatibility afaik, so technically speaking, it shouldn't matter at runtime but still the
Or this one if you happen to use Robolectric in your tests:
|
I see, target 34 then adds AAR metadata that isn't compatible, TIL, thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with this, but I'm not sure about the downgrades to core and navigation-fragment. As far as I can tell, those are still minSdkVersion = 14, so changing them shouldn't be part of this PR.
@LikeTheSalad this also needs a rebase. Thanks!
@breedx-splk It's not about the min version but rather which version is compiled against, if any transitive dependency is compiled against 34, the problem will still exist, so you have to depend on the latest version compiled against 33 or lower. |
Yeah, as @marandaneto said, transitive dependencies can also cause this issue, which is the case with core and navigation-fragment libs. Although I also understand the concern about downgrading dependencies 😟 It's been a while since I created this PR though and I remember thinking at some point afterward that maybe we can get away with both things (i.e. avoiding enforcing the latest compileSdk version in the OTel Android SDK while also not having to downgrade any dependencies) by doing a proper separation between the "core" parts of the OTel Android SDK and its instrumentations (as we've been discussing here). For example, regarding the |
That's what exactly I've done before, although I decided to keep |
I see, thanks @marandaneto, it makes sense. So it seems like in this case if we decided to provide fragment lifecycle instrumentation as part of the "default ones" then the separation wouldn't make much difference as the latest version of the OTel Android SDK would also bring the latest version of the fragment lifecycle instrumentation with it. Since you've dealt with this previously, I'm curious to know if you remember anybody complaining about having to upgrade their compileSdk version after upgrading to your library's latest version? Because I'm ultimately just trying to avoid unnecessary headaches for our users, but in the end, if this won't likely cause too many issues (because users can just avoid upgrading the whole SDK altogether), then we probably shouldn't scratch our heads too much about this. |
yes, I do remember, Android native apps are usually fewer (they upgrade faster), but if Flutter or React native apps depend on this SDK, it will be a bigger problem. |
Got it, thanks for your insights on this. I agree, we might still want to take a look at what options we have to minimize users' headaches on this, but probably for now it's quite soon to get to this point, considering that we're not stable yet and that most users should use this in android native apps, and I'm worried that if we treated this lib as stable (in the sense that we get hesitant about adding breaking changes) then that would defeat the purpose of having it marked as not-stable right now and most likely would make our progress to get to our first stable release much slower and painful 😅 So I think I'm just going to close this issue for now and take another look at it once we're done with the preview state. Cheers! |
Btw also this https://developer.android.com/google/play/requirements/target-sdk |
Android's compileSdk version
34
uses Java 17 APIs which can cause compilation errors when using JDK 11 (at least it happened to me when using Robolectric in a project that depends on opentelemetry-android). I think the switch to a newer JDK version can be problematic for some projects, therefore I believe libs shouldn't enforce it (or at least not too soon), especially in this case where the AGP started to require Java 17 fairly recently.Another, less problematic, side effect of using compileSdk 34 is that it requires upgrading Android Studio which I know several users avoid doing for a while until they have no other choice, and I wouldn't like OTel Android to be that annoying dependency...
I'm up for using the latest compileSdk version if it's necessary but at the moment that doesn't seem to be the case, so it's probably best to avoid causing these kinds of issues unless we have a good reason for it.