8月问题总结~Android 12适配

Android12 新特性及适配指南

重要信息:

  • 新的应用启动页:
    应用启动页 SplashScreen(影响所有应用);
  • 声明 android:exported:
    应用组件需显示声明 android:exported(以Android12位目标平台的应用);

android:exported相关问题集锦:

Android 12软件安装后闪退,请添加android:exported=“true“属性值
解决Android12系统Apk出现安装失败-22或者安装失败-127
Android 12 android:exported=“true“属性-三方依赖报错问题
Android12 依旧提示使用 intent-filter 需设置 android:exported 属性

除四大组件之外,根据其他对应错误信息,对项目以及所在依赖库进行修改,主项目manifest中:

<!--以下:android 12 加入exported-->
        <!--com.umeng.umsdk:vivo-umengaccs:1.1.6-->
        <receiver
            android:name="org.android.agoo.vivo.PushMessageReceiverImpl"
            android:exported="false"
            tools:node="merge" />
        <!--com.umeng.umsdk:oppo-push:3.0.0,com.umeng.umsdk:oppo-umengaccs:1.0.8-fix-->
        <service
            android:name="com.heytap.msp.push.service.CompatibleDataMessageCallbackService"
            android:exported="false"
            tools:node="merge" />
        <service
            android:name="com.heytap.msp.push.service.DataMessageCallbackService"
            android:exported="false"
            tools:node="merge" />

<!--        implementation(name: 'openDefault-4.3.0', ext: 'aar')-->
        <activity
            tools:node="merge"
            android:name="com.sina.weibo.sdk.share.WbShareTransActivity"
            android:exported="true"
            android:configChanges="keyboardHidden|orientation"
            android:launchMode="singleTask"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" >
            <intent-filter>
                <action android:name="com.sina.weibo.sdk.action.ACTION_SDK_REQ_ACTIVITY" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            tools:node="merge"
            android:name="com.sina.weibo.sdk.share.WbShareToStoryActivity"
            android:exported="true"
            android:configChanges="keyboardHidden|orientation"
            android:launchMode="singleTask"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" >
            <intent-filter>
                <action android:name="com.sina.weibo.sdk.action.ACTION_SDK_REQ_STORY" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <!-- huawei push   implementation 'com.umeng.sdk:push-huawei:1.0.0'-->
        <receiver
            tools:node="merge"
            android:exported="true"
            android:name="org.android.agoo.huawei.HuaWeiReceiver" >
            <intent-filter>
                <action android:name="com.huawei.android.push.intent.REGISTRATION" />
                <action android:name="com.huawei.android.push.intent.RECEIVE" />
                <action android:name="com.huawei.intent.action.PUSH" />
                <action android:name="com.huawei.intent.action.PUSH_STATE" />
            </intent-filter>
        </receiver>


<!--        com.liulishuo.filedownloader:library:1.6.4-->
        <service
            tools:node="merge"
            android:exported="false"
            android:name="com.liulishuo.filedownloader.services.FileDownloadService$SharedMainProcessService" />

        <service
            tools:node="merge"
            android:exported="false"
            android:name="com.liulishuo.filedownloader.services.FileDownloadService$SeparateProcessService"
            android:process=":filedownloader" />

Android 12 expoeted 相关描述

在这里插入图片描述

  • Alarm精确闹钟:
    应用程序使用Alarm精确闹钟 需申请SCHEDULE_EXACT_ALARM权限(以Android12位目标平台的应用);
  • 通知栏变更:
    Notification通知栏布局样式再次调整(以Android12位目标平台的应用);
  • 精确位置:
    请求精确位置,需同时申请 ACCESS_FINE_LOCATION 和 ACCESS_COARSE_LOCATION 权限(以Android12位目标平台的应用);
  • 前台服务
    将禁止从后台启动前台服务(以Android12位目标平台的应用);
  • 蓝牙权限:
    申请蓝牙相关权限时,不再需要申请设备位置信息相关权限(以Android12位目标平台的应用);

Android 判断是否安装此应用(解决Android12和Android11获取不到已安装的所有应用列表)

Android11、12存储变化-不能在scard存文件怎么办-更换存储区域

【Android踩过的坑】11.junit.framework.Assert 报错

Android 12真机调试——安装失败,安装包异常

Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defin…

Android项目实战(六十五):android12 适配 exported属性

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值