Open gmk57 opened 2 years ago
It still crashes, even if rule are added -keep class android.os.SystemProperties {*;}
Log
java.lang.NoSuchFieldError: No field VERSION_CODE of type Ljava/lang/String; in class Landroid/os/SystemProperties; or its superclasses (declaration of 'android.os.SystemProperties' appears in /system/framework/framework.jar)
Downgrade to 1.0.13 solved! And there is no need to add additional proguard rules
It still crashes, even if rule are added
-keep class android.os.SystemProperties {*;}
Log
java.lang.NoSuchFieldError: No field VERSION_CODE of type Ljava/lang/String; in class Landroid/os/SystemProperties; or its superclasses (declaration of 'android.os.SystemProperties' appears in /system/framework/framework.jar)
Fix:
Downgrade to 1.0.13 solved! And there is no need to add additional proguard rules
Downgrading to 1.0.14 is enough to avoid the crash. Anyway, this still remains an issue...
The solution suggested by @gmk57 works for the problem he posted. I've had the same issue and after applying it works. And if it was done correctly, should be added to the library's consumer rules.
The problem posted by @shenjingfs seems to be something else, and I haven't seen it.
I guess the bizarre idea behind adding within a library android.os.SystemProperties
is to access the system's android.os.SystemProperties
which are not available for an app/lib developer.
The SystemProperties is implemented with JNI - the impl is split into two parts: C++'s android_os_SystemProperties.cpp
(implementing the access) and Java's android.os.SystemProperties
(providing Java interface).
The printerlibrary provides a copy of android.os.SystemProperties
(probably an exact copy of SystemProperties.java from Sunmi Android OS source code). Just the face of the JNI-bridged implementation, to access natively implemented part.
Sounds like quite a hack 😬
Looking at the content of the sunmi libraries, it looks they fixed the issue in 1.0.18.
1.0.14 | 1.0.15 | 1.0.16 | 1.0.17 | 1.0.18 | 1.0.19 |
---|---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Stack trace:
or
This is caused by
at line 664 of (decompiled) SunmiPrinterService.java
Fix
Add to
proguard-rules.pro
:-keep class android.os.SystemProperties { get(java.lang.String); }
Ideally this should be added to library'sconsumer-rules.pro
.