Repository navigation
android: keep the prefixed jni_zero classes in consumer rules - #107
Merged
Merged
Conversation
The prefixed artifact (livekit#102) relocates jni_zero to livekit.org.jni_zero, but the consumer rule still keeps org.jni_zero. With R8 enabled the relocated JniInit is stripped and JNI_OnLoad aborts at startup.
16 tasks done
NateIsern
added a commit
to OxyHQ/Allo
that referenced
this pull request
Sep 26, 2026
#181) @livekit/react-native-webrtc 144.2.0 ships the PREFIXED WebRTC build (livekit.org.*), but its consumer rules still keep org.jni_zero.**. With R8 on in release builds, livekit.org.jni_zero.JniInit is stripped and libjingle_peerconnection_so aborts in JNI_OnLoad at launch (ClassNotFoundException, then SIGTRAP) — reproduced on a Pixel with Mention, which carries the same rule. Keep the class through expo-build-properties' extraProguardRules until livekit/react-native-webrtc#107 (merged, unreleased) ships. The new test reads the installed consumer rules: it fails if nobody keeps the class, and fails again once upstream does, so ours gets deleted. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
BLiYing
added a commit
to BLiYing/im-rtc-android
that referenced
this pull request
Sep 27, 2026
…g.webrtc 避免宿主撞包名 宿主 rongxin_android 接入时崩在 NoClassDefFoundError: Lorg/webrtc/EglBase——它自家老 VoIP 引擎(libECMedia.so,JNI 硬绑定 org.webrtc)跟本 SDK 标准版 io.github.webrtc-sdk:android 的 org.webrtc 撞 duplicate class,宿主排掉了标准版依赖,但老引擎的 fork 里没有 EglBase 这个类。 改用 io.github.webrtc-sdk:android-prefixed(同版本号 150.7871.01),org.webrtc 与 native JNI 绑定层 jni_zero 一并改名到 livekit.org.webrtc / livekit.org.jni_zero,两份实现不再共享类名, 宿主不需要排除任何一边。consumer-rules.pro 补 jni_zero 的 keep 规则——漏这条是已知坑:native 层按名字反射找 JniInit,Java 侧没有显式引用,R8 会当死代码裁掉,症状是装机正常、一调 PeerConnectionFactory.initialize() 就崩,堆栈还看不出是这里(社区里 livekit/react-native-webrtc#107 等项目踩过同一个坑)。 ./scripts/test.sh 六步全绿。未真机验——尤其要拿开 R8/minify 的 release 包验一次 livekit.org.jni_zero 的 keep 规则真的生效,debug 包默认不跑 R8 测不出来。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Problem
#102 moved Android to the prefixed
io.github.webrtc-sdk:android-prefixedartifact and updated the WebRTC keep rule tolivekit.org.webrtc.**, but the jni_zero rule still keepsorg.jni_zero.**. The prefixed artifact relocates jni_zero too: itslibs/shadow-all.jar(144.7559.15) contains onlylivekit/org/jni_zero/*, with no unprefixedorg/jni_zeroclasses.In an app with R8 enabled (
minifyEnabled true),livekit.org.jni_zero.JniInitis therefore stripped, and the native library aborts while loading. Reproduced on a Pixel 8a running Android 16, with a release build using@livekit/react-native-webrtc144.2.0 (via@livekit/react-native3.0.0), Expo SDK 57 and RN 0.86:144.1.2 wasn't affected, because it used the unprefixed artifact that
org.jni_zero.**matches.Fix
Keep
livekit.org.jni_zero.**, mirroring theorg.webrtc→livekit.org.webrtcchange in #102. With the equivalent rule in the app's own ProGuard config, the same release build starts normally.