blongho / worldCountryData

Android library for country flag, currency, and other country information
https://blongho.github.io/worldCountryData/doc/
MIT License
98 stars 35 forks source link

This is making my app too large , if possible provide progaurd rules #15

Closed JP0722 closed 3 years ago

blongho commented 4 years ago

I will be glad to merge your pull request with that feature

chitgoks commented 4 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.

chitgoks commented 4 years ago

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?

chitgoks commented 4 years ago

@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.

Tanv33rA commented 4 years ago

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 .

chitgoks commented 4 years ago

you use the package name of this lib

-keep class com.blongho.country_data.* { ; }

PrajwalSood commented 4 years ago

@chitgoks @blongho the proguard rules you have provided, are not working in signed APK. Could you please suggest something for it

chitgoks commented 4 years ago

i dont know what you mean by its not working

i just let it be. seems the svg in release still creates png

blongho commented 3 years ago

@chitgoks , did you reach any solution?

chitgoks commented 3 years ago

@blongho no. i didnt check on it. i just let it be.

akelix commented 3 years ago

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:

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

chitgoks commented 3 years ago

ok thanks. i only use

World flag icons

-keep class com.blongho.country_data.* { ; }

will try that.

blongho commented 3 years ago

@chitgoks did that proposal solve your problem?

chitgoks commented 3 years ago

didnt seem to.

blongho commented 3 years ago

@chitgoks do you have any suggestions how this can be addressed? I will be glad to merge a pull request with that feature.

github-actions[bot] commented 3 years ago

Staled issue