Github 库 发布到jitpack遇到的问题

网上很多文章都已经过时了!!!

github

发布流程 本地工程push到github 然后 create publish release 等流程网上一大堆。没有什么问题。

JitPack

输入项目用户名/项目名 点击 lookup

会看到你publish的版本点击 Get it !!!

等待加载完成如果成功Log 会显示绿色 是吧会显示红色

image

成功后 即可使用。失败可点击红色log查看失败原因。

问题1 :gif图片不显示!!

有几种写法 不知为何第一第二种一直不行最后使用的第三种

1 , <img src="https://github.com/用户名/xxxx/blob/main/xxx/xxxxx.gif" width="32%"/>

2, [站外图片上传中...(image-d2589f-1636192120111)]

3,<img src="xxx/Screenrecorder20211106.gif" width="32%">

问题2: 找不到 gradle-wrapper

我最开始没有把gradle文件夹上传到github 记得要上传。

问题3: 网上的教程 已经过时

使用 com.github.dcendents:android-maven-gradle-plugin , plugs[ id'com.github.dcendents.android-maven'] 方式已经不能用了

查看 官方文档!

image
image
image
image

直接把Google代码抄过来

plugins {
    id 'com.android.library'
    id 'kotlin-android'
    id 'maven-publish'
}

task sourceJar(type: Jar) {
    from android.sourceSets.main.java.srcDirs
    classifier "sources"
}
afterEvaluate {
    publishing {
        publications {
            release(MavenPublication) {
                // The following applies a component to this publication
                // which results in publishing an app bundle.
                from components.release

                groupId = 'com.github.用户名'
                artifactId = '项目名'
                version = '1.0.0'
            }
            debug(MavenPublication) {
                // The following applies a component to this publication
                // which results in publishing APKs in a ZIP file.
                from components.debug


                groupId = 'com.github.用户名''
                artifactId = '项目名''
                version = '1.0.0'
            }
        }
    }
}
注意:修改项目后想要生效必须重新publish realse 才有效哦!!

问题4: Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.

在Android studio里面设置gradle的jdk版本无效!!!
跟目录新建文件 jitpack.yml 里面写

jdk:
  - openjdk11
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容