原因:java.util.zip.ZipException:设置的代码长度无效



我在尝试在Android Studio上构建项目时收到此错误。当尝试使用 res/raw/file.dat 上的二进制文件压缩最终工件时,就会发生这种情况。

解决方案如下所述:构建jar时,Maven损坏源/主/资源中的二进制文件

是在构建时将文件或 res/raw 文件夹添加到"假"过滤中。但问题是我按照以下内容使用 JFrog Articatory 配置我的内部 maven 存储库:https://inthecheesefactory.com/blog/how-to-setup-private-maven-repository/en

问题: 如何转换:

<project>
<build>
<resources>
<resource>
<directory>${basedir}/src/main/resources/lib</directory>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
...
</plugins>
</build>
</project>   

进入分级风格:

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
}
}

我尝试使用pom.xml但它一直说无法识别.xml文件中的TAG项目。

谢谢!!!

android {
sourceSets {
main {
assets.srcDirs = ['src/main/res/raw']
}
}
}

最新更新