不管别人的教程多详细,都有他们忽略的坑,所以,都要自己动手。我也是参考了许多许多的博客,弄了一上午加下午十分钟,才搞定。

参考:

下面这个是大部分的步骤

http://blog.csdn.net/zhcswlp0625/article/details/54895584

下面这个是填坑的:

http://blog.csdn.net/tmac2000/article/details/53261141

坑一:

创建仓库时,如果使用Bintray-release,名字就填成maven,因为他的wiki:repoName: The repository name. Set to ‘maven’ by default.(有错误请指出)

不然就会报错:

Bintray- HTTP/1.1 404 Not Found [message:Repo ‘maven’ was not found]

坑二:gradle版本号要写为:

classpath ‘com.android.tools.build:gradle:2.1.0’

因为

classpath ‘com.android.tools.build:gradle:2.2.0’

好像会报unsupport * 错误

我自己的一些配置:

最外层的grale配置:

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

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.novoda:bintray-release:0.3.4' // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
} allprojects {
repositories {
jcenter()
}
} task clean(type: Delete) {
delete rootProject.buildDir
}

要上传的gradle配置:

apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'//添加
android {
compileSdkVersion 23
buildToolsVersion '23.0.0' defaultConfig {
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" }
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
} } dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.0'
testCompile 'junit:junit:4.12'
} publish {
userOrg = 'coaxinyu'//bintray.com用户名
groupId = 'com.caoxinyu'//jcenter上的路径
artifactId = 'coaxinyu'//项目名称
publishVersion = '1.0.0'//版本号
desc = 'this is for test'//描述,不重要
website = 'https://github.com/coaxinyu/tobebetter'//网站,最好有,不重要
}

然后执行的命令:

gradlew clean build bintrayUpload  -PbintrayUser=coaxinyu   -PbintrayKey=*****  -PdryRun=false

记住,学东西都要自己动手,别人的教程再详细,在你的电脑上都会有坑。记住了,年轻人,自己动手。

Android快速发布项目到jcenter详解的更多相关文章

  1. Android Studio发布项目到jcenter,一行代码引入Module

    前面我们使用自己封装的okhttp项目时候,只需要app/build.gradle文件中加一行代码就能使用项目. compile 'com.ansen.http:okhttpencapsulation ...

  2. Android项目实战(三十九):Android集成Unity3D项目(图文详解)

    需求: Unity3D 一般用于做游戏 而且是跨平台的.原本设计是Android 应用端A(原生开发)进行一些业务处理,最后由A 打开Android 应用端B(Unity3D 游戏开发)进行游戏操作. ...

  3. 如何在Android Studio中使用Gradle发布项目至Jcenter仓库

    简述 目前非常流行将开源库上传至Jcenter仓库中,使用起来非常方便且易于维护,特别是在Android Studio环境中,只需几步配置就可以轻松实现上传和发布. Library的转换和引用 博主的 ...

  4. Android 急速发布项目到 JitPack

    转载请标明出处: http://www.cnblogs.com/zhaoyanjun/p/5942616.html 出自[赵彦军博客] 2016/10/09 前言:以前写过一篇 Android stu ...

  5. Android EventBus 3.0 实例使用详解

    EventBus的使用和原理在网上有很多的博客了,其中泓洋大哥和启舰写的非常非常棒,我也是跟着他们的博客学会的EventBus,因为是第一次接触并使用EventBus,所以我写的更多是如何使用,源码解 ...

  6. Android开发:文本控件详解——TextView(一)基本属性

    一.简单实例: 新建的Android项目初始自带的Hello World!其实就是一个TextView. 在activity_main.xml中可以新建TextView,从左侧组件里拖拽到右侧预览界面 ...

  7. 使用Gradle发布项目到JCenter仓库 (转载)

    原文:使用Gradle发布项目到JCenter仓库 这篇文章介绍通过Gradle把开源项目发布到公共仓库JCenter中,方便你我他的事情,我们都是很懒的嘛.JCenter现在是Android Stu ...

  8. [置顶] xamarin android toolbar(踩坑完全入门详解)

    网上关于toolbar的教程有很多,很多新手,在使用toolbar的时候踩坑实在太多了,不好好总结一下,实在浪费.如果你想学习toolbar,你肯定会去去搜索androd toolbar,既然你能看到 ...

  9. Android 应用程序之间内容分享详解(二)

    转载请注明出处:http://blog.csdn.net/xiaanming/article/details/9428613 Android 应用程序之间内容分享详解(一) 之前给大家分享了你开发的应 ...

随机推荐

  1. 百万级数据库SQL优化大总结

    网上关于SQL优化的教程很多,但是比较杂乱.近日有空整理了一下,写出来跟大家分享一下,其中有错误和不足的地方,还请大家纠正补充. 这篇文章我花费了大量的时间查找资料.修改.排版,希望大家阅读之后,感觉 ...

  2. T-SQL在线格式化工具

    http://www.dpriver.com/pp/sqlformat.htm?ref=g_wangz

  3. 浩顺晶密K-5 打卡时间设置

    公司有一台浩顺晶密K-5打卡设备,因为时间异常需要重新调整,设备外部就几个按钮,全部按了一遍发现没有任何变化,所以肯定是哪里操作不对,然后用钥匙打开这个设置,上面有一排文字,分别是设置.+.-.确认等 ...

  4. OpenGL学习 Following the Pipeline

    Passing Data to the Vertex Shader Vertex Attributes At the start of the OpenGL pipeline,we use the i ...

  5. Django QuestSet API (官方文档)

    1.返回新查询集的方法 (1)filter():滤指定条件的结果 Entry.objects.filter(pub_date__gt=datetime.date(2005, 1, 3), headli ...

  6. Android(java)学习笔记61:Android中的 Application类用法

    1. 简介 如果想在整个应用中使用全局变量,在java中一般是使用静态变量,public类型:而在android中如果使用这样的全局变量就不符合Android的框架架构,但是可以使用一种更优雅的方式就 ...

  7. set方法的使用

    <div id='root'> <div v-for='(item,key,index) of userInfo'> {{item}}--{{key}}--{{index}} ...

  8. 重写KVC

    #import "NSObject+WQKVC.h" #import <objc/runtime.h> /** KVC 首先调用的方法顺序: |- setter: se ...

  9. Performing User-Managed Database-18.5、Restoring Control Files

    版权声明:本文为博主原创文章.未经博主同意不得转载. https://blog.csdn.net/offbeatmine/article/details/28429339 18.5.Restoring ...

  10. Object类的常用方法

    Object类是Java中所有类的始祖.如果没有明确的指定继承,则默认继承Object类.在Java中除了基本类型外都是Object类型的对象,包括数组. 1)equals方法 Object: pub ...