AndroidManifest.xml中的android:exported属性

本文解析了Android系统中PermissionDenial错误的原因,特别是当尝试访问未导出组件时出现的问题。详细介绍了如何通过调整AndroidManifest.xml文件中的android:exported属性来控制Activity和服务的访问权限。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

PermissionDenial: opening xxx ....  that is notexported from uid 10036

在AndroidManifest.xml 中 android:exported 属性:

这个属性用于指示该activity或Service是否能被其他程序应用组件调用或跟它交互;

取值为(true | false),如果设置成true,则能够被调用或交互,否则不能;

设置为false时,只有同一个应用程序的组件或带有相同用户ID的应用程序才能启动或绑定该服务。

添加到相应的activity或Service属性中;exported=”true”/ exported=”false” 。

> Task :app:processDebugMainManifest FAILED [com.android.support:animated-vector-drawable:28.0.0] C:\Users\Administrator\.gradle\caches\transforms-3\3648fb114e268826532fb9efd04f940b\transformed\animated-vector-drawable-28.0.0\AndroidManifest.xml Warning: Namespace 'android.support.graphics.drawable' used in: com.android.support:animated-vector-drawable:28.0.0, com.android.support:support-vector-drawable:28.0.0. F:\git13\WatchTest1\app\src\main\AndroidManifest.xml:41:5-75 Warning: Element uses-permission#android.permission.INSTALL_PACKAGES at AndroidManifest.xml:41:5-75 duplicated with element declared at AndroidManifest.xml:10:5-74 F:\git13\WatchTest1\app\src\main\AndroidManifest.xml:47:5-76 Warning: Element uses-permission#android.permission.CHANGE_WIFI_STATE at AndroidManifest.xml:47:5-76 duplicated with element declared at AndroidManifest.xml:35:5-76 F:\git13\WatchTest1\app\src\main\AndroidManifest.xml:61:5-67 Warning: Element uses-permission#android.permission.INTERNET at AndroidManifest.xml:61:5-67 duplicated with element declared at AndroidManifest.xml:31:5-67 F:\git13\WatchTest1\app\src\main\AndroidManifest.xml:64:5-75 Warning: Element uses-permission#android.permission.READ_PHONE_STATE at AndroidManifest.xml:64:5-75 duplicated with element declared at AndroidManifest.xml:19:5-75 F:\git13\WatchTest1\app\src\main\AndroidManifest.xml:65:5-69 Warning: Element uses-permission#android.permission.CALL_PHONE at AndroidManifest.xml:65:5-69 duplicated with element declared at AndroidManifest.xml:22:5-69 F:\git13\WatchTest1\app\src\main\AndroidManifest.xml:91:9-105:20 Error: android:exported needs to be explicitly specified for element <activity#com.dosen.watchtest.MainActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. F:\git13\WatchTest1\app\src\main\AndroidManifest.xml:307:9-320:20 Error: android:exported needs to be explicitly specified for element <activity#com.dosen.watchtest.activity.PhotoActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. F:\git13\WatchTest1\app\src\main\AndroidManifest.xml:119:9-123:19 Error: android:exported needs to be explicitly specified for element <service#com.dosen.watchtest.alarm.AlarmKlaxon>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. F:\git13\WatchTest1\app\src\main\AndroidManifest.xml:111:9-117:20 Error: android:exported needs to be explicitly specified for element <receiver#com.dosen.watchtest.alarm.AlarmReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. F:\git13\WatchTest1\app\src\main\AndroidManifest.xml:125:9-133:20 Error: android:exported needs to be explicitly specified for element <receiver#com.dosen.watchtest.alarm.AlarmInitReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. F:\git13\WatchTest1\app\src\main\AndroidManifest.xml:148:9-152:20 Error: android:exported needs to be explicitly specified for element <receiver#com.dosen.watchtest.receiver.WakeLockBroadCast>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. F:\git13\WatchTest1\app\src\main\AndroidManifest.xml:154:9-158:20 Error: android:exported needs to be explicitly specified for element <receiver#com.dosen.watchtest.receiver.CloudOpenReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. F:\git13\WatchTest1\app\src\main\AndroidManifest.xml:160:9-164:20 Error: android:exported needs to be explicitly specified for element <receiver#com.dosen.watchtest.receiver.SmsReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. F:\git13\WatchTest1\app\src\main\AndroidManifest.xml:71:9-76:20 Error: android:exported needs to be explicitly specified for element <receiver#io.rong.callkit.VoIPBroadcastReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. F:\git13\WatchTest1\app\src\main\AndroidManifest.xml:80:9-84:20 Error: android:exported needs to be explicitly specified for element <receiver#io.rong.callkit.util.RTCPhoneStateReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. F:\git13\WatchTest1\app\src\main\AndroidManifest.xml:46:9-61:20 Error: android:exported needs to be explicitly specified for element <receiver#io.rong.push.rongpush.PushReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. 是什么问题
06-12
Androidstudio查看这段在AndroidManifest.xml中的代码是否需要修改或者优化<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"> <uses-permission android:name="android.permission.INTERNET" /> <application android:allowBackup="true" android:icon="@drawable/tubiao" android:label="@string/app_name" android:roundIcon="@drawable/tubiao" android:supportsRtl="true" android:networkSecurityConfig="@xml/network_security_config" android:theme="@style/Theme.MyExamProject"> <activity android:name=".AddActivityActivity" android:exported="false" /> <activity android:name=".AddFurnitureActivity" android:exported="false" /> <activity android:name=".AddCaregiverActivity" android:exported="false" /> <activity android:name=".AddOldActivity" android:exported="false" /> <activity android:name=".FacilityActivity" android:exported="false" /> <activity android:name=".EventsActivity" android:exported="false" /> <activity android:name=".AddActivity2" android:exported="false" /> <activity android:name=".UpdateIFActivity" android:exported="false" /> <activity android:name=".MyIFActivity" android:exported="false" /> <activity android:name=".MainActivity" android:exported="false" /> <activity android:name=".UpdateGamesActivity" android:exported="false" /> <activity android:name=".RegisterActivity" android:exported="false" /> <activity android:name=".PersonalCenterActivity" android:exported="false" /> <activity android:name=".LoginActivity" android:exported="false" /> <activity android:name=".DeleteGamesActivity" android:exported="false" /> <activity android:name=".BackActivity" android:exported="false" /> <activity android:name=".AddGamesActivity" android:exported="false" /> <activity android:name=".HomeActivity" android:exported="true" /> <activity android:name=".WelcomeActivity" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
03-11
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值