uni-app 3.2.12 安卓云打包失败 get manifestOutputDirectory error

uni-app 3.2.12 安卓云打包失败 get manifestOutputDirectory error

操作步骤:

  • 3.2.12 选择安卓云打包

预期结果:

  • 打包成功

实际结果:

  • 打包失败

bug描述:

Appid: xxx get manifestOutputDirectory error

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ‘:app:checkReleaseDuplicateClasses’.

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable Duplicate class javax.annotation.CheckForNull found in modules jetified-jsr305-3.0 (jsr305-3.0.0.jar) and jetified-jsr305-3.0.1 (com.google.code.findbugs:jsr305:3.0.1) Duplicate class javax.annotation.CheckForSigned found in modules jetified-jsr305-3.0 (jsr305-3.0.0.jar) and jetified-jsr305-3.0.1 (com.google.code.findbugs:jsr305:3.0.1) … Duplicate class javax.annotation.meta.When found in modules jetified-jsr305-3.0 (jsr305-3.0.0.jar) and jetified-jsr305-3.0.1 (com.google.code.findbugs:jsr305:3.0.1)


Go to the documentation to learn how to Fix dependency resolution errors.


- Try:
  - Run with --debug option to get more log output. Run with --scan to get full insights.

- Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:checkReleaseDuplicateClasses'.
...

更多关于uni-app 3.2.12 安卓云打包失败 get manifestOutputDirectory error的实战教程也可以访问 https://www.itying.com/category-93-b0.html

4 回复

操作系统版本: 18363.449

更多关于uni-app 3.2.12 安卓云打包失败 get manifestOutputDirectory error的实战教程也可以访问 https://www.itying.com/category-93-b0.html


打开manifest文件,看看HBuilderX是否显示红色叹号。 如果找不出原因,可以新建一个项目,把里面的manifest源码替换过来(注意appid保留之前的),需要配的地方重新在可视化界面配

这个问题是由于项目中存在重复的 jsr305 依赖冲突导致的。jsr305 是一个 Java 注解库,多个模块同时引入了不同版本(3.0.0 和 3.0.1)导致类重复。

解决方案:

  1. 检查项目依赖:查看项目中哪些插件或模块引入了 jsr305。常见于使用特定地图、推送或统计插件时。

  2. manifest.json 中添加排除依赖配置: 在 "app-plus" -> "distribute" -> "android" 节点下添加:

    "plugins": {
        "dependency": {
            "exclude": [
                "com.google.code.findbugs:jsr305"
            ]
        }
    }
    

    这会从所有依赖中排除指定的冲突包。

  3. 如果排除后仍报错,可以尝试强制指定版本。在相同位置添加:

    "plugins": {
        "dependency": {
            "force": {
                "com.google.code.findbugs:jsr305": "3.0.1"
            }
        }
    }
回到顶部