国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Android > 正文

Android快速發布項目到jcenter詳解

2019-11-09 17:57:42
字體:
來源:轉載
供稿:網友

不管別人的教程多詳細,都有他們忽略的坑,所以,都要自己動手。我也是參考了許多許多的博客,弄了一上午加下午十分鐘,才搞定。

參考: 下面這個是大部分的步驟 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

記住,學東西都要自己動手,別人的教程再詳細,在你的電腦上都會有坑。記住了,年輕人,自己動手。


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 通江县| 麻栗坡县| 邯郸市| 上高县| 胶南市| 民权县| 扎鲁特旗| 车致| 常山县| 辉县市| 河北区| 汉沽区| 邵东县| 鄢陵县| 大田县| 平阳县| 台东县| 平昌县| 柯坪县| 广丰县| 于田县| 廊坊市| 孝昌县| 泸定县| 岳普湖县| 上栗县| 宽甸| 温宿县| 镇远县| 洪雅县| 定陶县| 固始县| 密云县| 彰化县| 福贡县| 教育| 栾川县| 安远县| 安远县| 黑龙江省| 滁州市|