【问题标题】:Android/Jitpack: Unable to import submoduleAndroid/Jitpack:无法导入子模块
【发布时间】:2021-08-20 05:19:33
【问题描述】:

我正在尝试导入我正在创建的 android 库的子模块。该子模块称为progressbar

https://jitpack.io/#SomeKoder/Essentials/0.1.0

https://github.com/SomeKoder/Essentials

dependencies {
    implementation 'com.github.SomeKoder:Essentials:0.1.0'
}

我已经尝试过这个和许多其他变体,但都没有成功。

dependencies {
    implementation 'com.github.SomeKoder.Essentials:progressbar:0.1.0'
}

有人可以帮我弄清楚我做错了什么吗? 提前致谢

【问题讨论】:

    标签: android import module jitpack


    【解决方案1】:

    将此添加到模块 build.gradle 会导致实际构建的工件:

    plugins {
        id 'com.android.library'
        id 'kotlin-android'
        id 'maven-publish'
    }
    
    afterEvaluate {
        publishing {
            publications {
                release(MavenPublication) {
                    from components.release
    
                    groupId = 'com.somekoder.Essentials.progressbar'
                    artifactId = 'progressbar'
                    version = '0.1.4'
                }
                debug(MavenPublication) {
                    from components.debug
    
                    groupId = 'com.somekoder.Essentials.progressbar'
                    artifactId = 'progressbar-debug'
                    version = '0.1.4'
                }
            }
        }
    }
    

    看来您必须在要为其创建工件的每个模块中添加此代码的变体。然后通过 JitPack 导入就可以了。

    【讨论】:

      猜你喜欢
      • 2018-04-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-23
      • 1970-01-01
      • 2017-08-28
      • 2021-08-22
      • 1970-01-01
      相关资源
      最近更新 更多