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

参考:

下面这个是大部分的步骤

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. artTemplate教程

    artTemplate教程 官方文档 一个简单的例子 <!DOCTYPE html> <html lang="zh"> <head> <m ...

  2. React 环境搭建及页面调试方法

    React 环境搭建及页面调试方法 |作者:RexFang |出处:http://www.cnblogs.com/rexfang/ |关于作者:Java 程序员一枚 |版权:本文版权归作者和博客园共有 ...

  3. redis笔记(四)

    本篇内容主要是简单介绍redis在python中的使用from time import sleep在python代码中使用redis需要导入redis packageimport redis简单的连接 ...

  4. 笨办法学Python(二十六)

    习题 26: 恭喜你,现在可以考试了! 你已经差不多完成这本书的前半部分了,不过后半部分才是更有趣的.你将学到逻辑,并通过条件判断实现有用的功能. 在你继续学习之前,你有一道试题要做.这道试题很难,因 ...

  5. c++为什么定义了析构函数的类的operator new[]传入的参数会多4字节?

    问题:   在网上看人写了这么一段代码: class A { public: A() { std::cout<<"call A constructor"<< ...

  6. Torch.no_grad()影响MSE损失

    相关描述 https://discuss.pytorch.org/t/torch-no-grad-affecting-outputs-loss/28595/3 今天在训练网络的时候,发现mseloss ...

  7. IOS ScrollView的使用 and delegate

    ScrollView常用的属性设置 //设置内容尺寸 // CGFloat contentH=self.lastBtn.frame // .origin.y+self.lastBtn.frame.si ...

  8. Uva 10806 来回最短路,不重复,MCMF

    题目链接:https://uva.onlinejudge.org/external/108/10806.pdf 题意:无向图,从1到n来回的最短路,不走重复路. 分析:可以考虑为1到n的流量为2时的最 ...

  9. 砍树,POJ(2665)

    题目链接:http://poj.org/problem?id=2665 解题报告: 这里的区域没有重复,若有重复的话,模拟即可. #include <cstdio> #include &l ...

  10. 重定向跳出父Frame

    当session过期后可以用过滤器来设置重定向页面 代码如下: public class ActionFilter extends HttpServlet implements Filter {pri ...