ThanosFisherman / WifiUtils

Easily Connect to WiFi Networks
Apache License 2.0
731 stars 188 forks source link

Crash on trying to enable wifi #98

Closed debduttaVxplore closed 3 years ago

debduttaVxplore commented 3 years ago
WifiUtils.withContext(getApplicationContext()).enableWifi(new WifiStateListener() {
            @Override
            public void isSuccess(boolean isSuccess) {
                if(isSuccess)
                {
                    runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            onWifiTurnedOn();
                        }
                    });
                }

            }
        });

////////////////////////////////////////////////////////////////////////////////////// java.lang.NoClassDefFoundError: Failed resolution of: Lcom/thanosfisherman/elvis/Elvis; at com.thanosfisherman.wifiutils.WifiUtils.enableWifi(WifiUtils.java:247) at com.vxplore.esp01.MainActivity.tryTurnOnWifi(MainActivity.java:271)

ThanosFisherman commented 3 years ago

Make sure you using the latest version of WifiUtils.

debduttaVxplore commented 3 years ago

Okay, let me check version, but I think I have put latest version.

debduttaVxplore commented 3 years ago

Yea, I used 1.6.4. Is this Ok?

ThanosFisherman commented 3 years ago

Yes it's ok. This should not normally happen though. I will have a look. In the meantime make sure you also include kotlin-stdlib-jdk8 dependency in your project.

Smartelic commented 3 years ago

Hi Scan wifi also failing. I think it's due to one of your dependency is not synced with .aar file. After including this "com.thanosfisherman.elvis:elvis:3.0" in gradle dependency it worked fine to me.

ThanosFisherman commented 3 years ago

Can you please upgrade to version 1.6.5 and let me know whether elvis is now resolved without the need of including it as an extra dependency? It should work now either way.

Smartelic commented 3 years ago

It is working now, thank you so much for quick update, and big thank you for the great library.