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

DuplicatePlatformClasses lint error #260

Open
awardakbb opened this issue Jul 29, 2024 · 0 comments
Open

DuplicatePlatformClasses lint error #260

awardakbb opened this issue Jul 29, 2024 · 0 comments

Comments

@awardakbb
Copy link

When integrating the following Pubnub Kotlin sdk into an Android app for Fire TV, we get the error below:
implementation 'com.pubnub:pubnub-kotlin:9.2.2'

Task :app:lintVitalFiretvRelease FAILED
/Users/awardak/StudioProjects/devices-bod-firetv/app/build.gradle:193: Error: json defines classes that conflict with classes now provided by Android. Solutions include finding newer versions or alternative libraries that don't have the same problem (for example, for httpclient use HttpUrlConnection or okhttp instead), or repackaging the library using something like jarjar. [DuplicatePlatformClasses]
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.0'
~~~~

Explanation for issues of type "DuplicatePlatformClasses":
There are a number of libraries that duplicate not just functionality of
the Android platform but using the exact same class names as the ones
provided in Android -- for example the apache http classes. This can lead
to unexpected crashes.

To solve this, you need to either find a newer version of the library which
no longer has this problem, or to repackage the library (and all of its
dependencies) using something like the jarjar tool, or finally, rewriting
the code to use different APIs (for example, for http code, consider using
HttpUrlConnection or a library like okhttp).


This only happens when we pull in the pubnub-kotlin dependency so it looks like the SDK has some classes that are duplicates of those inside kotlinx-serialization-json. Would it be possible to rename those?

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

No branches or pull requests

1 participant