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

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.toLowerCase()' on a null object reference #44

Closed mustafaberk1996 closed 1 year ago

mustafaberk1996 commented 1 year ago

Describe the bug I am getting an error that is NullPointerException. It is in WorldData.java file where in this library.

To Reproduce

  1. just write World.init(applicationContext) in App file or an Activity file.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots

Screen Shot 2022-11-30 at 12 24 49 Screen Shot 2022-11-30 at 12 24 59

Additional context I hadn't been getting this error before but now I am getting. It is weird I also use this library in my another app and this library is working as well there.

blongho commented 1 year ago

Hi @mustafaberk1996 ,

Which version of the library are you using?

mustafaberk1996 commented 1 year ago

I was using the latest version but I removed the library. Now I am using FlagKit library and there is no issue until now.

IvLink-dev commented 1 year ago

Hi @mustafaberk1996, I think you use proguard and forgot to add proguard rules -keep class com.blongho.* { ; } -keep interface com.blongho.* -keeppackagenames com.blongho.country_data -keepclassmembers class com.blongho.country_data. { public ; } -keep class com.blongho.country_data.R { ; }

waheedkhan-dev commented 9 months ago

Facing same issue on a release build with isMinifyEnabled = true and isShrinkResources = false Also add the proguard rules mention above