android studio 打包出现这样的问题怎么解决? 10
:app:makeJarFAILEDFAILURE:Buildfailedwithanexception.*Whatwentwrong:CannotexpandZIP'G...
:app:makeJar FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Cannot expand ZIP 'G:\oroar2\app\build\intermediates\bundles\release\classes.jar' as it does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 7.374 secs
打包代码:
def SDK_BASENAME = "unity";
def SDK_VERSION = "_V2.1";
def sdkDestinationPath = "build";
def zipFile = file('build/intermediates/bundles/release/classes.jar')
task deleteBuild(type: Delete) {
delete sdkDestinationPath + SDK_BASENAME + SDK_VERSION + ".jar"
}
task makeJar(type: Jar) {
from zipTree(zipFile)
from fileTree(dir: 'src/main',includes: ['assets/'])
baseName = SDK_BASENAME + SDK_VERSION
destinationDir = file(sdkDestinationPath)
}
makeJar.dependsOn(deleteBuild, build) 展开
FAILURE: Build failed with an exception.
* What went wrong:
Cannot expand ZIP 'G:\oroar2\app\build\intermediates\bundles\release\classes.jar' as it does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 7.374 secs
打包代码:
def SDK_BASENAME = "unity";
def SDK_VERSION = "_V2.1";
def sdkDestinationPath = "build";
def zipFile = file('build/intermediates/bundles/release/classes.jar')
task deleteBuild(type: Delete) {
delete sdkDestinationPath + SDK_BASENAME + SDK_VERSION + ".jar"
}
task makeJar(type: Jar) {
from zipTree(zipFile)
from fileTree(dir: 'src/main',includes: ['assets/'])
baseName = SDK_BASENAME + SDK_VERSION
destinationDir = file(sdkDestinationPath)
}
makeJar.dependsOn(deleteBuild, build) 展开
3个回答
展开全部
你看你的资源文件是否存在有大写命名的文件。
android资源文件不允许大写。android自动生成的资源文件如果出错了不是配置问题就是命名问题,android 在命名的时候 只能用 a-z的小写 和0-9的数字 ,而且 第一个必须是 字母
你的是否是23版本的?如果是:
在stackoverflow上的解释是:23.0之前有基于apac.http package的引用,而升级后这个引用没了,导致新建项目报错
Found a workaround that allows me to keep working on 22
You need to delete the build tools 23 from the sdk manager and then in the sdk folder (yes the actual folder) open up sdk/extras/android/m2repository/com/android/support/appcompat-v7
blow away the entire 23.0.0 folder
then in the same appcompat folder open maven-metadata.xml and delete the one line <version>23.0.0</version>
clean and rebuild
code.google给出了解决办法:
参照以上方法,我们需要这么干:
第一步:把你的build.gradle设置为(之前报错时候这里是v7.23.0.0) v7:22.2.1
第二步:进入Android\sdk\extras\android\m2repository\com\android\support\appcompat-v7 ,删除23.0.0文件夹,删除maven-metadata.xml中的<version>23.0.0</version>
第三步:进入项目clean,接着rebuild 注意!!!!!!只clean依然报错
已测试,完成以上三步再建立其他项目正常
android资源文件不允许大写。android自动生成的资源文件如果出错了不是配置问题就是命名问题,android 在命名的时候 只能用 a-z的小写 和0-9的数字 ,而且 第一个必须是 字母
你的是否是23版本的?如果是:
在stackoverflow上的解释是:23.0之前有基于apac.http package的引用,而升级后这个引用没了,导致新建项目报错
Found a workaround that allows me to keep working on 22
You need to delete the build tools 23 from the sdk manager and then in the sdk folder (yes the actual folder) open up sdk/extras/android/m2repository/com/android/support/appcompat-v7
blow away the entire 23.0.0 folder
then in the same appcompat folder open maven-metadata.xml and delete the one line <version>23.0.0</version>
clean and rebuild
code.google给出了解决办法:
参照以上方法,我们需要这么干:
第一步:把你的build.gradle设置为(之前报错时候这里是v7.23.0.0) v7:22.2.1
第二步:进入Android\sdk\extras\android\m2repository\com\android\support\appcompat-v7 ,删除23.0.0文件夹,删除maven-metadata.xml中的<version>23.0.0</version>
第三步:进入项目clean,接着rebuild 注意!!!!!!只clean依然报错
已测试,完成以上三步再建立其他项目正常
微测检测5.10
2023-05-10 广告
2023-05-10 广告
您好!建议咨 深圳市微测检测有限公司,已建立起十余个专业实验室,企业通过微测检测就可以获得一站式的测试与认 证解决方案;(EMC、RF、MFi、BQB、QI、USB、安全、锂电池、快充、汽车电子EMC、汽车手机互 联、语音通话质量),认证遇...
点击进入详情页
本回答由微测检测5.10提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |