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属性
版权声明:本文为xzytl60937234原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。