Android studio 导入layoutlib.jar 关于项目引入核心库(core-library)异常的问题

本文介绍了在Android Studio中遇到导入layoutlib.jar并尝试引入core-library时出现的错误,提供了解决方法:通过使用`provided`配置,避免编译错误。详细报错信息为'Execution failed for task ':preDexDebug'。
摘要由CSDN通过智能技术生成

解决办法:不用去编译该库,使用provided 

dependencies {
    provided files('lib/layoutlib.jar')
}

问题报错如下:

Execution failed for task ':preDexDebug'.

com.android.ide.common.internal.LoggedErrorException: Failed to run command:
E:\Android_ADT\adt-bundle-windows-x86_64\sdk\build-tools\22.0.1\dx.bat --dex --output D:\Myproject\build\intermediates\pre-dexed\debug\layoutlib-ae9cf8329731796be8e310f0f62b2c55a956159a.jar D:\Myproject\doc\layoutlib.jar
Error Code:
1
Output:
trouble processing "java/lang/AutoCloseable.class":

Ill-advised or mistaken usage of a core class (java.* or javax.*)
when not building a core library.

This is often due to inadvertently including a core library file
in your applicatio
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值