Xamarin Forms After Adding Xam.Plugin.Connectivity GooglePlayconsole raise warning on signing APK user features

Viewed 200

I faced a issue of warning as I went on publishing new release to test the Connectivity introduced.

I installed Xam.Plugin.Connectivity from NuGet Packages

using Plugin.Connectivity;

Created a function at Public class Level

    public static bool CheckConnection()
    {
        if (CrossConnectivity.Current.IsConnected)
            return true;
        else
            return false;
    }

And then called in my MainPage.xaml.cs

    public MainPage()
    {
        InitializeComponent();

        if (Sql_Common.CheckConnection() == false)
        {
            DisplayAlert("Network Error!", "Network connection could not be establised to server!", "ok");
        }

    }
    protected void OnAppearingAsync()
    {
        base.OnAppearing();

        if (Sql_Common.CheckConnection() == false)
        {
            DisplayAlert("Network Error!", "Network connection could not be establised to server!", "ok");
        }
    }

But then the warning came at Publishing the APK as follows:

Warning: Deactivation of this APK will result in your app being available for new installs on fewer types of devices. Tip: If this is an unintended change, then retain this APK in the new release or ensure that your new APKs support all currently supported devices.

1 differentiating: android.hardware.wifi

I did some google but could not reach the risk factor I was assuming that users may not get later updates or installations less on devices, due to adding this android.hardware.wifi feature requried.

So Please help me that can I proceed with this feature? Will it have any impact on my later releases? And am I correct that due to installing the Xam.Plugin.Connectivity, this warning has especially came?

Edited:- One thing common was found Adding following line into manifest file

<uses-feature android:name="android.hardware.wifi" required="false" /> 

was common suggestion but then will it still check the connectivity?

1 Answers

Yes, you are correct that the warning comes because of adding the Xam.Plugin.Connectivity package to your project.

The ACCESS_NETWORK_STATE and ACCESS_WIFI_STATE permissions are required and are automatically added to your Android Manifest when you compile. No need to add them manually!

By adding these permissions Google Play will automatically filter out devices without specific hardware.

You can get around this filtering by adding the following to your AssemblyInfo.cs file:

[assembly: UsesFeature("android.hardware.wifi", Required = false)]

Source: here

Related