Closed JP0722 closed 3 years ago
is it possible you are still using 1.4? i got a 16mb difference when i used it instead of 1.5
1.5 is much better since theyre vector drawables and it only needs 1 file for it compared to having different images for 1 flag for various densities (unless 1.4 uses only 1 png but with large dimensions which leads to a bigger file size.
i just looked at the difference in terms of size and yes. the apk or aab is too big. i also had to ignore these classes in proguard or else my app wont run.
also, one thing im confused is that even if i set my minsdk to 21 and useSupport for vector drawable is set to false, PNGs are still generated, hence it adds up to the file size.
thoughts?
@blongho hi bernard, will you be also be able to fix the proguard issue? since this lib becomes unusable if your lib classes are obfuscated. for now i had to ignore them in proguard so the app will run.
i just looked at the difference in terms of size and yes. the apk or aab is too big. i also had to ignore these classes in proguard or else my app wont run.
also, one thing im confused is that even if i set my minsdk to 21 and useSupport for vector drawable is set to false, PNGs are still generated, hence it adds up to the file size.
thoughts?
i am also facing this problem . i just want to know how did you keep these classes in proguard because my "-keep" is not working .
you use the package name of this lib
-keep class com.blongho.country_data.* { ; }
@chitgoks @blongho the proguard rules you have provided, are not working in signed APK. Could you please suggest something for it
i dont know what you mean by its not working
i just let it be. seems the svg in release still creates png
@chitgoks , did you reach any solution?
@blongho no. i didnt check on it. i just let it be.
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.toLowerCase()' on a null object reference at k.d.a.b.<init>(WorldData.java:9) at k.d.a.a.init(World.java:4)
This exception happens in Runtime after World.init() call
proguard_rules.pro file in project is Wrong.
Possible solution:
Do not use "shrinkResources"
-keepclassmembers class com.blongho.country_data.* { public *; }
with
-keepclassmembers class com.blongho.country_data.Country { *; } -keepclassmembers class com.blongho.country_data.Currency { *; }
Better solution: Provide references in code for vector images, because "shrinkResources" is a good tool
Use @Keep annotation on data files for json parsing https://stackoverflow.com/questions/60612464/load-json-files-failed-with-obfuscation
ok thanks. i only use
-keep class com.blongho.country_data.* { ; }
will try that.
@chitgoks did that proposal solve your problem?
didnt seem to.
@chitgoks do you have any suggestions how this can be addressed? I will be glad to merge a pull request with that feature.
Staled issue
I will be glad to merge your pull request with that feature