我今天开始用AndroidStudio编程,一个朋友给我发了一个小的示例应用程序,但我无法运行任何代码,因为这个错误不断出现。我已经尝试解决它约3个小时,现在与不同的论坛,但我不能让它工作,我会非常感谢您的帮助,因为我只是不知道该怎么做....
控制台:
android:exported needs to be explicitly specified for element <activity#com.dbestech.food_delivery.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.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Manifest merger failed : android:exported needs to be explicitly specified for element <activity#com.dbestech.food_delivery.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.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 5s
Exception: Gradle task assembleDebug failed with exit code 1
___________________________________________________________________________________
and my AndroidManifest.xml file:
___________________________________________________________________________________
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dbestech.food_delivery">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>```
1条答案
按热度按时间xyhw6mcr1#
将此添加到您的
AndroidManifest.xml
您需要使用
action
MAIN和category
LAUNCHER查找<activity>
标记像这样加上
android:exported="true"
-