简体   繁体   English

Android Studio 重建项目任务:app:processDebugMainManifest FAILED

[英]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”执行失败。


Despite adding the ` android:exported="false" ` property to each activity in my manifest the project is still failing to rebuild. 尽管将 android:exported="false" 属性添加到清单中的每个活动,项目仍然无法重建。
I tried to comment out all the activities in the manifest and to only leave the LauncherActivity but to my surprise the same error keeps popping up. 我试图注释掉清单中的所有活动,只留下 LauncherActivity,但令我惊讶的是,同样的错误不断出现。

If anyone has come across this problem after updating to Android 12 SDK please help out!! 如果有人在更新到 Android 12 SDK 后遇到这个问题,请帮忙!!
Running Android Studio Arctic Fox 2020.3.1 Patch 4 运行 Android Studio Arctic Fox 2020.3.1 Patch 4

**EDIT 1** **编辑1**
Tried out solutions and suggested comments on [this S/O thread][1] 在 [this S/O thread][1] 上尝试了解决方案和建议评论

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.

相关问题 &gt; 任务:app:processDebugMainManifest 失败 - > Task :app:processDebugMainManifest FAILED 尝试构建入职屏幕 Android Studio(液体滑动)时任务“:app:processDebugMainManifest”执行失败 - Execution failed for task ':app:processDebugMainManifest' when trying to built an Onboarding Screen Android Studio (liquid swipe) 将 Android Studio 升级到 Electric Eel 后,任务“:app:processDebugMainManifest”执行失败 - Execution failed for task ':app:processDebugMainManifest' after upgrading Android Studio to Electric Eel 我收到此错误 Execution failed for task:app:processDebugMainManifest while running with npm run android 但使用 android studio 运行正常 - i got this error Execution failed for task :app:processDebugMainManifest while running with npm run android but with android studio it works fine 任务“:app:processDebugMainManifest”错误执行失败 - Execution failed for task ':app:processDebugMainManifest' error 任务 ':app:processDebugMainManifest' 执行失败。 在 ReactNative CLI 中 - Execution failed for task ':app:processDebugMainManifest'. in ReactNative CLI Task:app:processDebugMainManifest FAILED,Manifest Merger Failed with multiple errors in React Native using Android Sdk 版本 31 - Task :app:processDebugMainManifest FAILED, Manifest Merger Failed with multiple errors in React Native using Android Sdk Version 31 Flutter 构建失败并出现异常(任务 ':app:processDebugMainManifest' 执行失败) - Flutter build failed with an exception ( Execution failed for task ':app:processDebugMainManifest') Flutter 错误。 任务“:app:processDebugMainManifest”执行失败 - Flutter Error. Execution failed for task ':app:processDebugMainManifest' 在本机反应中出现错误:Task:app:processDebugMainManifest FAILED - Getting error in react native : Task :app:processDebugMainManifest FAILED
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM