Failed to transform artifact ‘xxx.jar’ to match attributes 异常

1、异常情况描述(AS项目接入第三方依赖报错)


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform artifact 'slice.jar (io.airlift:slice:0.5)' to match attributes {artifactType=android-dex, dexing-enable-desugaring=true, dexing-is-debuggable=true, dexing-min-sdk=16, org.gradle.usage=java-runtime-jars}.
      > Execution failed for DexingWithClasspathTransform: E:\android_studio_gradle_repository\.gradle\caches\modules-2\files-2.1\io.airlift\slice\0.5\c921c01e56aa66e38c97a73602bfc84c849d0733\slice-0.5.jar.
         > Error while dexing.

* 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

2、异常处理

经过排查,定位在build.gradle文件配置中

需要将build.gradle中android.enableJetifier的值修改为false

 以下配置可参考


android {
    defaultConfig {
        multiDexEnabled true
    }
    packagingOptions {
        /*解决异常:  More than one file was found with OS independent path 'META-INF/DEPENDENCIES'*/
        /*这个问题是因为引入了多个第三方库,而第三方库中拥有很多重名的文件,所以会报这种错误*/
        exclude 'META-INF/DEPENDENCIES'
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation 'com.android.support:multidex:1.0.3'
}

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
回答: 根据引用\[1\]中的信息,"Artifact SchedulingSystem:war exploded: Waiting for server connection to start artifact deployment..."的报错信息表明在部署项目时出现了错误。根据引用\[2\]中的描述,可能是因为项目中的WebServlet与其他servlet重名导致的报错。此外,引用\[3\]中提到的解决方式是通过点击clean按钮后重新发布项目来解决该问题。因此,您可以尝试清理项目并重新发布来解决"Artifact SchedulingSystem:war exploded: Waiting for server connection to start artifact deployment..."的报错。 #### 引用[.reference_title] - *1* *3* [Artifact itheima_spring_mvc:war exploded: Waiting for server connection to start artifact deployment](https://blog.csdn.net/weixin_45986454/article/details/122404151)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [Artifact 项目:war exploded: Error during artifact deployment. See server log for details.解决办法](https://blog.csdn.net/kqimo/article/details/130398031)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值