【问题标题】:Android Studio Error Manifest merger failed : Apps targeting Android 12 exported already existsAndroid Studio 错误清单合并失败:针对 Android 12 导出的应用程序已存在
【发布时间】:2022-11-10 15:03:21
【问题描述】:

我不擅长英语,所以我使用翻译。对不起。

我正在做一个在移动设备上控制无人机的项目,我将找到一个名为dronekit的模块并使用它,但是当我应用它时,会出现同样的错误。

Manifest merger failed : android:exported needs to be explicitly specified for <service>. 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

我的清单:

    <activity
        android:name=".MainActivity"
        android:exported="true"
        android:screenOrientation="landscape">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

我的 build.gradle(:app):

android {
...
compileSdk 31
defaultConfig {
    ...
    minSdk 23
    targetSdk 31
    ...
}
dependencies {
...
implementation files('../libs/dronekit-android.3.0.2.aar')
}

如您所见, android:exported 已经在其中。但是“合并清单”中有一个错误。请帮我。

【问题讨论】:

    标签: java android-studio dronekit dronekit-android


    【解决方案1】:

    当你用 WinRAR 打开 Android 库文件(dronekit.aar)时,你会看到一个 AndroidManifest.xml 文件,用记事本或任何文本编辑器打开它并添加一个函数

    android:exported="true"
    

    在每一项服务和活动中。 然后在 android studio 中再次导出并在 build.xml 中添加依赖项。毕业。它会起作用的。

    【讨论】:

      猜你喜欢
      • 2021-07-28
      • 2021-08-11
      • 1970-01-01
      • 2020-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-04
      相关资源
      最近更新 更多