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

参考:

下面这个是大部分的步骤

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. nginx-1.12.2编译安装指导

    nginx-1.12.2编译安装 下载源码包 安装 安装后配置 下载源码包 下载地址:http://nginx.org/en/download.html nginx-1.12.2:http://ngi ...

  2. Laravel 5.5 官方推荐 Nginx 配置学习

    Laravel 5.5 版本官方放出了 Nginx 服务器的配置,中文文档:服务器配置 Nginx server { listen 80; server_name example.com; root ...

  3. HCNA配置RIPv1

    1.拓扑图 2.配置 R1 The device is running! ###### <Huawei>sys Enter system view, return user view wi ...

  4. HDFS文件操作(命令行)

    HDFS是一种分布式文件系统,为MapReduce这种框架下的海量数据分布式处理而设计. Hadoop之HDFS文件操作常有两种方式,一种是命令行方式,即Hadoop提供了一套与Linux文件命令类似 ...

  5. 在windows bat脚本(batch)中延时

    编写bat脚本时,有事我们希望在指令和指令之间,加入延时.例如当一条指令执行后,windows需要一定时间来响应的情况. 以下是一种实现方法,通过ping 指令来实现,5表示ping5次,就是延时5秒 ...

  6. Altium_Designer如何快速寻找元件和封装

    初学Altium碰到最多的问题就是:不知道元件放在哪个库中.这里我收集了DXP2004常用元件库下常见的元件.使用时,只需在libary中选择相应元件库后,输入英文的前几个字母就可看到相应的元件了.通 ...

  7. 检测浏览器中是否有Flash插件

    由于IE和非IE浏览器检测方式不同,所以代码如下 function hasPlugin(name){ debugger; name = name.toLowerCase(); for(var i=0; ...

  8. Linux ELF格式分析

    http://www.cnblogs.com/hzl6255/p/3312262.html ELF, Executable and Linking Format, 是一种用于可执行文件.目标文件.共享 ...

  9. ABI 管理

    https://developer.android.google.cn/ndk/guides/abis.html 不同 Android 手机使用不同的 CPU,因此支持不同的指令集.CPU 与指令集的 ...

  10. Codeforces 758A Holiday Of Equality

    题目链接:http://codeforces.com/problemset/problem/758/A A. Holiday Of Equality time limit per test 1 sec ...