如何解决无法将Kotlin库发布到Jitpack
我创建了一个Kotlin库,该库使用Apollo作为其GraphQL客户端。我正在尝试将其发布到Jitpack。我运行./gradlew install命令,但是构建失败:
Could not publish configuration 'archives'
Cannot publish artifact 'metadata.json' (.../sample/build/generated/metadata/apollo/debugAndroidTest/service/metadata.json)) as it does not exist.
让我知道是否需要更多信息。 谢谢!
解决方法
希望这可以帮助其他开发者。
Jitpack 文档未更新。确保您没有使用:
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'com.apollographql.apollo'
id 'kotlinx-serialization'
id 'com.github.dcendents.android-maven' <------
}
将 com.github.dcendents.android-maven
替换为 maven-publish
。 com.github.dcendents.android-maven
被标记为已弃用。然后你可以在你的库构建 gradle 中将你的配置添加到 public 到 maven。
afterEvaluate {
publishing {
publications {
// Creates a Maven publication called "release".
release(MavenPublication) {
// Applies the component for the release build variant.
from components.release
// You can then customize attributes of the publication as shown below.
groupId = 'com.test.sdk.library'
artifactId = 'test'
version = 0.0.1 //(whatever version you want)
}
}
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。