gpt4 book ai didi

android - Xamarin.Android 没有 'android:exported' 属性设置错误

转载 作者:行者123 更新时间:2023-12-05 00:02:05 24 4
gpt4 key购买 nike

当 Xamarin.Android 设置为 Android 12 时,我收到了

"You uploaded an APK or Android App Bundle which has an activity,activity alias, service or broadcast receiver with intent filter, butwithout the 'android:exported' property set. This file can't beinstalled on Android 12 or higher. See:developer.android.com/about/versions/12/behavior-changes-12#exported"


将 APK 上传到 Google Play 控制台以获取新版本时出错。
我已将 Exported 属性添加到我的 Activity 和服务中,但仍设置此错误。
[Activity(Label = "@string/AppDrawerName", Icon = "@mipmap/ic_launcher", RoundIcon = "@mipmap/ic_launcher_round", Theme = "@style/MainTheme", MainLauncher = true, Exported = false, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation, ScreenOrientation = ScreenOrientation.Portrait)]

public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
服务
[Service(Exported = true)]
public class BarcodeService : IBarcodeService
{

最佳答案

详细的输出 MSBuild 项目输出详细程度可以解决问题。
enter image description here
当我打开这个功能时,我发现了一个 NotificationPushService 和一个 TokenService 元素需要添加一个 android:exported="true"标签。

关于android - Xamarin.Android 没有 'android:exported' 属性设置错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70876739/

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