gpt4 book ai didi

android - 添加 Xam.Plugin.Connectivity GooglePlayconsole 后的 Xamarin Forms 在签署 APK 用户功能时发出警告

转载 作者:搜寻专家 更新时间:2023-11-01 09:23:46 25 4
gpt4 key购买 nike

当我继续发布新版本以测试引入的连接时,我遇到了警告问题。

我从 NuGet 包安装了 Xam.Plugin.Connectivity

using Plugin.Connectivity;

在公共(public)类级别创建了一个函数

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

然后在我的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");
}
}

但随后在发布 APK 时出现如下警告:

警告:停用此 APK 会导致您的应用可在更少类型的设备上进行新安装。提示:如果这是意外更改,请在新版本中保留此 APK,或确保您的新 APK 支持所有当前支持的设备。

1 区分:android.hardware.wifi

我进行了一些谷歌搜索,但无法达到我假设的风险因素,即由于需要添加此 android.hardware.wifi 功能,用户可能无法在设备上获得更高版本的更新或更少的安装。

请帮助我继续使用此功能吗?对我以后的发布有影响吗?由于安装了 Xam.Plugin.Connectivity,我是否更正了这个警告?

编辑:-发现一个共同点将以下行添加到 list 文件中

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

这是常见的建议,但它仍会检查连接性吗?

最佳答案

是的,您是正确的,警告是因为将 Xam.Plugin.Connectivity 包添加到您的项目。

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.

您可以通过将以下内容添加到您的 AssemblyInfo.cs 文件来绕过此过滤:

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

来源:here

关于android - 添加 Xam.Plugin.Connectivity GooglePlayconsole 后的 Xamarin Forms 在签署 APK 用户功能时发出警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52403955/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com