Fix macOS LinkageError from shaded Jna-platform conflicting with Minecraft#46
Open
leventecsordas wants to merge 1 commit into
Open
Fix macOS LinkageError from shaded Jna-platform conflicting with Minecraft#46leventecsordas wants to merge 1 commit into
leventecsordas wants to merge 1 commit into
Conversation
Stop bundling jna-platform in the shadow JAR so Discord RPC uses the game's JNA copy and avoids LinkageError on fullscreen handling (thevortex#43).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #43.
On macOS (Apple Silicon, MC 26.1.2+), the client could crash shortly after launch with a
java.lang.LinkageErrorwhen fullscreen/window mode was updated. Two class loaders were loading different copies ofcom.sun.jna.Pointer— one from the mod's shadow JAR and one from Minecraft's runtime libraries used byMacosUtil/ca.weblite.objc.This removes
jna-platformfrom the shadow configuration. Minecraft 26.1+ already shipsjnaandjna-platform5.17.0 on all platforms, so jDRPC (Discord RPC) can use the game's copy at runtime.Changes
net.java.dev.jna:jna-platform:5.17.0into the mod JARbuild.gradleexplaining why JNA must not be bundledImpact
UnixConnection(no JNA)UnixConnection(no JNA)WindowsConnection(JNA)JAR size drops from ~3.6 MB to ~375 KB.