Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

CrossConnectivity.Current.IsConnected is firing error #154

Closed
olivertech opened this issue May 10, 2018 · 1 comment
Closed

CrossConnectivity.Current.IsConnected is firing error #154

olivertech opened this issue May 10, 2018 · 1 comment

Comments

@olivertech
Copy link

If you are creating an issue for a BUG please fill out this information. If you are asking a question or requesting a feature you can delete the sections below.

Failure to fill out this information will result in this issue being closed. If you post a full stack trace in a bug it will be closed, please post it to http://gist.github.com and then post the link here.

Bug Information

Version Number of Plugin: 3.1.1
Device Tested On: Sony Z3 (on debug mode)
Simulator Tested On: Sony Z3
Version of VS: 2017 15.5.4
Version of Xamarin: 4.8.0.757
Versions of other things you are using:

Android minimum version: Android 5.0 (api 21)
Target android version: Android 8.0 (api 26)

Steps to reproduce the Behavior

Created this method in a base class to be called from all my child classes which inherits de base classe

using Plugin.Connectivity;
...
...
public bool DoIHaveInternet()
{
return CrossConnectivity.Current.IsConnected;
}

Expected Behavior

Return connectivity status

Actual Behavior

Error:

Unhandled Exception:

Java.Lang.ClassNotFoundException: Didn't find class "md592d74be4bac08a7af63848ae15d2f86e.ConnectivityChangeBroadcastReceiver" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]

Code snippet

In base class:

    public bool DoIHaveInternet()
    {
        return CrossConnectivity.Current.IsConnected;
    }

In child class:

    private void GetCliente(Login login, Configuracao configuracao)
    {
        if (DoIHaveInternet())
        {
            Cliente = new Cliente(DependencyService.Get<IServices>().GetCliente(login, configuracao).DocumentElement);
        }
        else
        {
            Alert(_noInternetTitle, _noInternetMessage);
        }
    }

Screenshots

image

@olivertech
Copy link
Author

Have identified the problem... it was because I have used the proguard in release mode to publish the apk... When I returned to debug mode and disabled Proguard, some java libs were removed and do were not restored.... I need to delete bin and obj folders, rebuild the solution and the problem was resolved.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant