Android快速发布项目到jcenter详解
不管别人的教程多详细,都有他们忽略的坑,所以,都要自己动手。我也是参考了许多许多的博客,弄了一上午加下午十分钟,才搞定。
参考:
下面这个是大部分的步骤
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详解的更多相关文章
- Android Studio发布项目到jcenter,一行代码引入Module
前面我们使用自己封装的okhttp项目时候,只需要app/build.gradle文件中加一行代码就能使用项目. compile 'com.ansen.http:okhttpencapsulation ...
- Android项目实战(三十九):Android集成Unity3D项目(图文详解)
需求: Unity3D 一般用于做游戏 而且是跨平台的.原本设计是Android 应用端A(原生开发)进行一些业务处理,最后由A 打开Android 应用端B(Unity3D 游戏开发)进行游戏操作. ...
- 如何在Android Studio中使用Gradle发布项目至Jcenter仓库
简述 目前非常流行将开源库上传至Jcenter仓库中,使用起来非常方便且易于维护,特别是在Android Studio环境中,只需几步配置就可以轻松实现上传和发布. Library的转换和引用 博主的 ...
- Android 急速发布项目到 JitPack
转载请标明出处: http://www.cnblogs.com/zhaoyanjun/p/5942616.html 出自[赵彦军博客] 2016/10/09 前言:以前写过一篇 Android stu ...
- Android EventBus 3.0 实例使用详解
EventBus的使用和原理在网上有很多的博客了,其中泓洋大哥和启舰写的非常非常棒,我也是跟着他们的博客学会的EventBus,因为是第一次接触并使用EventBus,所以我写的更多是如何使用,源码解 ...
- Android开发:文本控件详解——TextView(一)基本属性
一.简单实例: 新建的Android项目初始自带的Hello World!其实就是一个TextView. 在activity_main.xml中可以新建TextView,从左侧组件里拖拽到右侧预览界面 ...
- 使用Gradle发布项目到JCenter仓库 (转载)
原文:使用Gradle发布项目到JCenter仓库 这篇文章介绍通过Gradle把开源项目发布到公共仓库JCenter中,方便你我他的事情,我们都是很懒的嘛.JCenter现在是Android Stu ...
- [置顶]
xamarin android toolbar(踩坑完全入门详解)
网上关于toolbar的教程有很多,很多新手,在使用toolbar的时候踩坑实在太多了,不好好总结一下,实在浪费.如果你想学习toolbar,你肯定会去去搜索androd toolbar,既然你能看到 ...
- Android 应用程序之间内容分享详解(二)
转载请注明出处:http://blog.csdn.net/xiaanming/article/details/9428613 Android 应用程序之间内容分享详解(一) 之前给大家分享了你开发的应 ...
随机推荐
- struts 上传文件 Dynavalidatorform 实例
一.相关jar包 一个空struts工程的jar包: 另上传文件的两个jar包: 二.页面 1.上传页面upload.jsp <%@ page language="jav ...
- Struts1.x 用户登录模块的实现
页面验证部分: <%@ page language="java" contentType="text/html; charset=UTF-8" pageE ...
- April 14 2017 Week 15 Friday
Try to be a rainbow in someone's cloud. 当乌云萦绕心头,我愿意成为你的彩虹. Actually there are many rainbows in our l ...
- CToolTipCtrl使用详细解说
很多的界面设计都需要有Tip提示,下面描述一下Tip的简单使用方法: 1. 首先要New一个CToolTipCtrl的对象m_pContentTip 2. 调用CToolTipCtrl的create函 ...
- 【转载】#349 - The Difference Between Virtual and Non-Virtual Methods
In C#, virtual methods support polymorphism, by using a combination of the virtual and override keyw ...
- 【HDU4676】Sum Of Gcd(莫队+欧拉函数)
点此看题面 大致题意: 多组询问,求\(\sum_{i=L}^R\sum_{j=i+1}^Rgcd(i,j)\). 推式子 这道题我们可以考虑,每个因数\(d\)被统计答案的次数,肯定与其出现次数有关 ...
- python-一切事物都是对象
python:一切事物都是对象 开始接触python,在里面有一句话“一切事物都是对象”,那么如何来理解这句话呢,下面举简单的例子: a=1 b='hello't=(11,22,33) list1=[ ...
- VMWare关闭beep声
在虚拟机文件夹下找到 .vmx 文件,在文件末尾添加 mks.noBeep = "TRUE" ,重启虚拟机即可.
- React Native ref高级用法&&setNativeProps使用
ref属性不只是string ref属性不仅接受string类型的参数,而且它还接受一个function作为 callback.这一特性让开发者对ref的使用更加灵活. render() { retu ...
- runtime - 消息机制
Xcode中使用runtime代码时,建议先做下配置: 使用runtime代码时会有适当的提醒. OC方法调用的本质是消息转发,消息机制的本质 创建一个Person类,添加方法 - (void)eat ...