--
You received this message because you are subscribed to the Google Groups "java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/java/tencent_5144C6A43A0CC07778854AA0%40qq.com.
Sam Maier,
Thank you for being willing to provide help and for replying to my email. In my first email, I mentioned two issues. Let's discuss the first issue first.
In the first issue, I did not provide a detailed crash stack, which may have led you to think that my assumption was incorrect. Therefore, I have created a demo and uploaded it to GitHub, where I have detailed my reproduction steps and log information:
Please take a look at this demo and help me investigate further.
Thank you again for your assistance.
Thank you for your reply. I am not sure if I misunderstood you. I am aware that JNI methods are renamed to HASH names, but here it seems to be not just a renaming issue but rather that the unused jni methods are being deleted, which is causing the problem. Additionally, I also followed your suggestion to check the jni_zero/proguard.flag
.
jni_zero/proguard.flag
into my own proguard.txt
, but the crash in case2 from the GitHub demo still occurs. My proguard.txt
is modified as follows:-keep class com.demo.** {*;}-keep class androidx.** { *;}# Keeps for method level annotations.-keepclasseswithmembers,allowaccessmodification class ** {@org.jni_zero.AccessedByNative <fields>;}-keepclasseswithmembers,includedescriptorclasses,allowaccessmodification class ** {@org.jni_zero.CalledByNative <methods>;}-keepclasseswithmembers,includedescriptorclasses,allowaccessmodification class ** {@org.jni_zero.CalledByNativeUnchecked <methods>;}# Allow unused native methods to be removed, but prevent renaming on those that# are kept.-keepclasseswithmembernames,includedescriptorclasses,allowaccessmodification class ** {native <methods>;}# Used when multiplexing. We don't package our own @UsedByReflection, so using this instead.-keepclasseswithmembers class !cr_allowunused,**J.N {public long *_HASH;}
jni_zero/proguard.flag
file and found that it is already included in out/apk_demo/gen/apk_demo/apk_demo.build_config.json
(as shown in the image below). In theory, I should not need to include it again in my proguard.txt
, right?My English isn't very good, and the translation software may have caused some misunderstanding. If you can clearly tell me what I need to add to fix this issue, that would be best. I can then analyze further based on the code you provide and understand your intentions. Thank you very much!
Sorry to bother you again, and thank you for your support and help.