Skip to content
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

R8 minify error on Missing class java.beans.ConstructorProperties from Jackson #844

Open
deividasstr opened this issue Feb 20, 2025 · 4 comments

Comments

@deividasstr
Copy link
Contributor

I am getting the following errors on minification builds, I am surprised why this was not reported:

Missing class java.beans.ConstructorProperties (referenced from: void com.fasterxml.jackson.databind.ext.Java7SupportImpl.<init>())
Missing class java.beans.Transient (referenced from: void com.fasterxml.jackson.databind.ext.Java7SupportImpl.<init>())

This comes from Jackson serialization lib, which is brought in to SDK via
io.opentelemetry:opentelemetry-sdk-extension-incubator-> io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi dependencies.

Following local proguard rules workaround the error:

-dontwarn java.beans.ConstructorProperties
-dontwarn java.beans.Transient

But they should be a part of SDKs ruleset.

I don't mind opening a PR if this is approved.

@LikeTheSalad
Copy link
Contributor

Thank you for letting us know about this issue.

I agree that we should implement R8 rules on our side whenever possible 👍 so I'd go with those changes, although before moving in that direction, I'm a bit impressed that we're getting mentions of the Jackson dependency over here somehow, I don't think it's something that OTel Android should be using, and maybe it isn't and it's probably a compile-only dependency? I'd like to have a deeper look at this.

@LikeTheSalad
Copy link
Contributor

It seems like the sdk-extension-incubator dependency is only used here in the startup instrumentation module. However, the compiler doesn't seem to complain if I remove it. Do you remember why we needed to add it, @breedx-splk ?

@breedx-splk
Copy link
Contributor

It seems like the sdk-extension-incubator dependency is only used here in the startup instrumentation module. However, the compiler doesn't seem to complain if I remove it. Do you remember why we needed to add it, @breedx-splk ?

I think we use it for events.

@LikeTheSalad
Copy link
Contributor

I think we use it for events.

The last time I checked, the compiler didn't complain if I removed it. So, if you're not entirely sure whether we need it, I think it's best if we remove it. I mean, the library has such a big size that they even had to come up with "Jackson jr" as a way to address mobile environment concerns... 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants