i’m trying to getCountryCode() on a WifiManager insance, i.e.

WifiManager wifiManager = (WifiManager) getSystemService (Context.WIFI_SERVICE);

Although I set compileSdkVersion to 29 the compiler cannot find getCountryCode().

error: cannot find symbol
symbol: method getCountryCode()
location: variable wifiManager of type WifiManager​

This symbol should be accessible, as stated here
java/android/net/wifi/WifiManager.java#1723 (android source)

Does anyone of you know, why the compiler cannot resolve getCountryCode()?
Btw: setCountryCode() can’t be found either whereas getConnectionInfo() can be resolved and used.

Sharing is caring!

Leave a Reply