[英]Caused by: java.util.zip.ZipException: invalid code lengths set
I get this error while trying to build a project on Android Studio. 尝试在Android Studio上构建项目时出现此错误。 It happens when trying to compress the final artifact with a binary file on res/raw/file.dat.
当尝试使用res / raw / file.dat上的二进制文件压缩最终工件时,会发生这种情况。
The solution like explained here: Maven corrupting binary files in source/main/resources when building jar 像这里解释的解决方案: 构建jar时,Maven破坏了源/主/资源中的二进制文件
Is to add the file or res/raw folder to a "false" filtering on build. 是将文件或res / raw文件夹添加到构建时的“ false”过滤中。 But the problem is that i configure my internal maven repository with JFrog Articatory following this: https://inthecheesefactory.com/blog/how-to-setup-private-maven-repository/en
但是问题是我按照以下步骤使用JFrog Articatory配置了我的内部Maven存储库: https ://inthecheesefactory.com/blog/how-to-setup-private-maven-repository/en
The question: How to convert this: 问题:如何将其转换为:
<project>
<build>
<resources>
<resource>
<directory>${basedir}/src/main/resources/lib</directory>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
...
</plugins>
</build>
</project>
Into gradle style: 转换为gradle样式:
def libraryGroupId = 'XXXXXXX'
def libraryArtifactId = 'XXXXXX'
def libraryVersion = '0.0.1'
publishing {
publications {
aar(MavenPublication) {
groupId libraryGroupId
version libraryVersion
artifactId libraryArtifactId
artifact("$buildDir/outputs/aar/${artifactId}-release.aar")
}
}
}
artifactory {
contextUrl = 'XXXXXXXXXX'
publish {
repository {
repoKey = 'libs-release-local'
username = artifactory_username
password = artifactory_password
}
defaults {
publications('aar')
publishArtifacts = true
properties = ['qa.level': 'basic', 'q.os': 'android', 'dev.team': 'core']
publishPom = true
}
}
I've tried using pom.xml but it kepts saying does not recognized TAG project in .xml file. 我尝试使用pom.xml,但一直说无法识别.xml文件中的TAG项目。
Thanks!!! 谢谢!!!
android {
sourceSets {
main {
assets.srcDirs = ['src/main/res/raw']
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.