[英]Android Studio Rebuilding Project Task :app:processDebugMainManifest FAILED
I recently updated my projects build.gradle
to target Android SDK 32 with the statements:我最近将我的项目build.gradle
更新为目标 Android SDK 32,声明如下:
compileSdkVersion 32
targetSdkVersion 32
After this process, I am now unable to Rebuild my project and have it run on my mobile device.在此过程之后,我现在无法重建我的项目并让它在我的移动设备上运行。
The manifest merger process gives this error:清单合并过程给出了这个错误:
Error: android:exported needs to be explicitly specified for.错误:android:需要明确指定导出。 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.针对 Android 12 及更高版本的应用需要为android:exported
指定一个明确的值,当相应的组件定义了一个 Intent 过滤器时。 See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.有关详细信息,请参阅 https://developer.android.com/guide/topics/manifest/activity-element#exported。
Execution failed for task ':app:processDebugMainManifest'.任务“:app:processDebugMainManifest”执行失败。
After upgrading my Android Studio to Bumblebee, I was able to get a much more descriptive error message that pointed out the missing attributes for the services and activities.将我的 Android Studio 升级到 Bumblebee 后,我能够获得更具描述性的错误消息,指出服务和活动缺少的属性。
To my surprise, the Activities and Service were from a USSD automation library we use called Hover .令我惊讶的是,活动和服务来自我们使用的 USSD 自动化库,名为Hover 。 I've had to override these and declare them manually in our Manifest to add the missing android:exported
attribute.我不得不覆盖这些并在我们的清单中手动声明它们以添加缺少的android:exported
属性。 These are the affected Hover components in the error message:这些是错误消息中受影响的 Hover 组件:
<service#com.hover.sdk.requests.HoverAccessibilityService>
<activity#com.hover.sdk.api.SessionActivity>
<activity#com.hover.sdk.permissions.PermissionActivity>
These have to be implicitly defined in your Manifest.这些必须在您的清单中隐式定义。
It's probably one of your dependencies' manifest.它可能是您的依赖项清单之一。
Check your merged manifest (there is a tab for that in the IDE if you open your manifest file) and see what component is missing the export
property.检查您的合并清单(如果您打开清单文件,则 IDE 中有一个选项卡)并查看缺少export
属性的组件。
Once you identified the library, you can update it to it's latest version.确定库后,您可以将其更新到最新版本。
If the library is already updated to its latest version, you can manually override their manifest item and fix it temporarily until they release a fix.如果库已经更新到最新版本,您可以手动覆盖他们的清单项目并临时修复它,直到他们发布修复程序。
I'll update my answer soon with an example.我会尽快用一个例子更新我的答案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.