放弃JitPack,发布Android Library Bintray 提交问题相关

放弃JitPack,发布Android Library

 

放弃JitPack 不能及时编译出错误来导致每次需要在GitHub release  提交 release   还不支持23以上

 

发布Android Library注意点:

第一步:注册帐号 
注册帐号地址: 
https://bintray.com/signup/osshttps://bintray.com/signup/osshttps://bintray.com/signup/oss

 

第二步 Android工程配置

 

在project build.gradle添加

还有lib build.gradle添加

app 不用配置

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.novoda:bintray-release:0.5.0'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0' // Add this line
       
    }

}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://dl.bintray.com/linlsyf/maven' }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

https://dl.bintray.com/linlsyf/maven'   为个人地址

 

lib 库配置

apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.novoda.bintray-release'
android {
    compileSdkVersion 26

    lintOptions {
        abortOnError false
    }

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }

    buildTypes {
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }

        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

}
tasks.withType(JavaCompile){

    options.encoding = "UTF-8"}
publish {
    userOrg = 'linlsyf'      // bintray注册的用户名
    groupId = 'com.easysoft.widget.lib'  // 包名
    artifactId = 'easywidget'// bintray创建的package
    publishVersion = '1.0.0'
}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'com.android.support:appcompat-v7:23.2.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

publish 部分为个人设置

 

第三步 发布

gradlew assembleRelease  才能生成 release

2  gradlew bintrayUpload   检查是否有错误并解决 如编码错误需要去除掉中文注释

3  因为lib 有自己配置信息

4  提交

gradlew aR bintrayUpload -PbintrayUser=linlsyf -PbintrayKey=linlsyf -PdryRun=false -x releaseAndroidJavadocs

 

linlsyf 为自己的名字    第二个配置自己的 apikey 替换即可

4 添加到jcenter

5易错点

如果出现

Execution failed for task ':lib:bintrayUpload'.
> java.net.SocketException: Connection reset by peer: socket write error

大概是你不适合开发吧

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值