Closed anilthummar closed 3 years ago
Hi, Sorry for the late reponse. Did you ever solve this? If no, can you paste the full error log here.?
@blongho thanks for updates.
No any error but When I have to create signup apk file that time country images from your com.github.blongho: world country data:v1.5 dependency
I meet this problem, too. This is caused by proguard. It's ok in debug mode and set minifyEnabled to false. It seems like "getCountry" is null. I already config the proguard file as your project but still crash. Please help, thanks.
The crash stack is as following:
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.toLowerCase()' on a null object reference
at com.blongho.country_data.e.f(SourceFile:169)
at com.blongho.country_data.e.i(SourceFile:129)
at com.blongho.country_data.e.
The proguard file for using com.github.blongho:worldCountryData: -keep class com.blongho.country_data { ; } -keepparameternames -renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
-keepclasseswithmembers, allowoptimization enum {
public static [] values();
public static valueOf(java.lang.String);
}
-keepclasseswithmembernames, includedescriptorclasses class {
native
Hello,
I have same issue too in release build. Anyone fixed this issue?
Thanks
It seems as if setting minified to true is the issue here.
I still have not found a working solution for that.
I made a sample app which is in the appstore.
Check my gradle here: CountryDataDemo
I have not tried this stack overflow answer
If anyone ever finds a work-around, then please update us.
However, if your app works online, you can use Rest Countries to fetch the data on-demand.
Regards Bernard
Hello,
I have fixed it once I added your packages to the proguard exception.
-keep class com.blongho.* {;} -keep interface com.blongho.**
Thanks
@JosephLuns thanks for your feedback.
Hello,
I have fixed it once I added your packages to the proguard exception.
BlongHo -> WorldCountryFlag
-keep class com.blongho.* {;} -keep interface com.blongho.**
Thanks
This issue only happens in release version because of proguard exception. We should add this into docs. Thank a lot.
Great 👏. I will update it soon
Thanks for you lib its grt work in debug mode app
buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } }
implementation 'com.google.android.material:material:1.1.0' implementation 'com.github.blongho:worldCountryData:v1.5'
not getting flag = World.getFlagOf("CountryName");
please help on that , I want to set minifyEnabled true when I create sign-up apk file