gpt4 book ai didi

android - 无法发布 Artifact 'xxx.aar' (xxx.aar),因为它不存在

转载 作者:行者123 更新时间:2023-11-29 23:25:19 27 4
gpt4 key购买 nike

无法发布配置“文件”,无法发布 Artifact danlu-bluetooth.aar (/Users/xxx/work/xxx/workplace/androidcode/libraray/xxx/bluetooth/xxx -bluetooth.aar) 因为它不存在。

编译环境说明:

  1. gradle 版本是 4.10.2
  2. Android Gradle 插件版本为 3.2.1

Maven 插件配置:

apply plugin: 'maven'
uploadArchives {
uploadArchives {
repositories {
mavenDeployer {
snapshotRepository(url: "${mvn.snapUrl}") {
authentication(userName: "${mvn.name}", password: "${mvn.pass}")
}

repository(url: "${mvn.url}") {
authentication(userName: "${mvn.name}", password: "${mvn.pass}")
}

pom.project {
version getVersionName()
artifactId getArtifactId()
groupId "${mvn.groupId}"
packaging "${mvn.packaging}"
description getDesc()
}
}
}


task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
artifacts {
archives file(getArtifactId() + ".aar")
archives sourcesJar
}

错误日志:

Caused by: org.gradle.api.artifacts.PublishException: Could not publish configuration 'archives'
at org.gradle.api.tasks.Upload.upload(Upload.java:67)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:801)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:768)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99)

Caused by: org.gradle.api.artifacts.PublishException: Cannot publish artifact 'danlu-bluetooth.aar' (/Users/xxx/work/danlu/workplace/androidcode/libraray/xxx/bluetooth/danlu-bluetooth.aar) as it does not exist.
at org.gradle.internal.component.external.ivypublish.DefaultArtifactPublisher.isValidToPublish(DefaultArtifactPublisher.java:117)
at org.gradle.internal.component.external.ivypublish.DefaultArtifactPublisher.addConfigurations(DefaultArtifactPublisher.java:94)
at org.gradle.internal.component.external.ivypublish.DefaultArtifactPublisher.toPublishMetaData(DefaultArtifactPublisher.java:83)
at org.gradle.internal.component.external.ivypublish.DefaultArtifactPublisher.publish(DefaultArtifactPublisher.java:67)
at org.gradle.api.internal.artifacts.ivyservice.IvyContextualArtifactPublisher$1.execute(IvyContextualArtifactPublisher.java:43)
at org.gradle.api.internal.artifacts.ivyservice.IvyContextualArtifactPublisher$1.execute(IvyContextualArtifactPublisher.java:40)
at org.gradle.internal.Transformers$4.transform(Transformers.java:133)
at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyContextManager.withIvy(DefaultIvyContextManager.java:63)
at

最佳答案

artifacts {
archives file(getArtifactId() + ".aar")
archives sourcesJar
}

只需使用 'archives sourcesJar'。

关于android - 无法发布 Artifact 'xxx.aar' (xxx.aar),因为它不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53699591/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com