欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

AndroidStudio中如何解決統(tǒng)一管理版本號引用配置問題-創(chuàng)新互聯(lián)

小編給大家分享一下Android Studio中如何解決統(tǒng)一管理版本號引用配置問題,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!

在陜西等地區(qū),都構(gòu)建了全面的區(qū)域性戰(zhàn)略布局,加強發(fā)展的系統(tǒng)性、市場前瞻性、產(chǎn)品創(chuàng)新能力,以專注、極致的服務(wù)理念,為客戶提供成都網(wǎng)站制作、成都做網(wǎng)站、外貿(mào)營銷網(wǎng)站建設(shè) 網(wǎng)站設(shè)計制作按需策劃設(shè)計,公司網(wǎng)站建設(shè),企業(yè)網(wǎng)站建設(shè),品牌網(wǎng)站制作,全網(wǎng)整合營銷推廣,成都外貿(mào)網(wǎng)站制作,陜西網(wǎng)站建設(shè)費用合理。

方式一:

在gradle.properties中寫入:

#測試環(huán)境
ENV_TEST=test
#開發(fā)環(huán)境
ENV_DEV=dev
#生產(chǎn)環(huán)境
ENV_ONLINE=online
APPLICATION_ID=com.xxx.xxxx
COMPILE_SDK_VERSION=26
TARGET_SDK_VERSION=26
MIN_SDK_VERSION=15
SUPPORT_V4_SUPPORT=com.android.support:support-v4:26.1.0
SUPPORT_ANNOTATIONS=com.android.support:support-annotations:26.1.0
SUPPORT_V7_APPCOMPAT=com.android.support:appcompat-v7:26.1.0
SUPPORT_V7_RECYCLERVIEW=com.android.support:recyclerview-v7:26.1.0

使用規(guī)則,字符串直接用,整形需在后加 as int

android { compileSdkVersion COMPILE_SDK_VERSION as int defaultConfig { applicationId APPLICATION_ID minSdkVersion MIN_SDK_VERSION as int targetSdkVersion TARGET_SDK_VERSION as int versionCode 100 versionName "1.0.0" multiDexEnabled true flavorDimensions "versionCode" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" }

方式二:

在根目錄下的build.gradle文件下添加 buildscript{ .... } 中的內(nèi)容:

buildscript { ext.kotlin_version = '1.1.51' ext.rxandroid = '2.0.1' ext.anko_version = '0.8.2' ext.support_version = '26.1.0' ext.target_sdk_version = 26 ext.min_sdk_version = 15 ext.applicationId = 'com.beiyijinfu.rxbusdemo' repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } }

使用規(guī)則,字符串需使用“$”,整形直接用

android { compileSdkVersion compile_sdk_version defaultConfig { applicationId "com.xxx.xxxx" minSdkVersion min_sdk_version targetSdkVersion target_sdk_version versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" implementation "com.android.support:appcompat-v7:$support_version" implementation "io.reactivex.rxjava2:rxandroid:$rxandroid" implementation "org.jetbrains.anko:anko-common:$anko_version" implementation "com.android.support:recyclerview-v7:$support_version" }

方式三:

在根目錄下的build.gradle文件下添加 ext{ .... } 中的內(nèi)容:

ext{ kotlin_version = '1.1.51' rxandroid = '2.0.1' anko_version = '0.8.2' support_version = '26.1.0' target_sdk_version = 26 compile_sdk_version = 26 min_sdk_version = 15 }

使用規(guī)則,字符串需使用“$rootProject.”,整形直接用rootProject.。ext可加可不加

android { compileSdkVersion rootProject.compile_sdk_version defaultConfig { applicationId "com.xxx.xxxx" minSdkVersion rootProject.ext.min_sdk_version targetSdkVersion rootProject.ext.target_sdk_version versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$rootProject.ext.kotlin_version" implementation "com.android.support:appcompat-v7:$rootProject.support_version" implementation "io.reactivex.rxjava2:rxandroid:$rootProject.rxandroid" compile "org.jetbrains.anko:anko-common:$rootProject.anko_version" compile "com.android.support:recyclerview-v7:$rootProject.support_version" }

方式四:

在項目根目錄下創(chuàng)建.gradle文件,如:config.gradle,config.gradle中文件內(nèi)容可以自己定義,如下示例:

ext{ kotlin_version = '1.1.51' rxandroid = '2.0.1' anko_version = '0.8.2' support_version = '26.1.0' target_sdk_version = 26 compile_sdk_version = 26 min_sdk_version = 15 }

使用規(guī)則,在build.gradle中先引用進來:

apply from :"config.gradle"
dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile "com.android.support

以上是“Android Studio中如何解決統(tǒng)一管理版本號引用配置問題”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學(xué)習(xí)更多知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!

新聞名稱:AndroidStudio中如何解決統(tǒng)一管理版本號引用配置問題-創(chuàng)新互聯(lián)
網(wǎng)頁網(wǎng)址:http://www.chinadenli.net/article10/dhcpgo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)頁設(shè)計公司全網(wǎng)營銷推廣網(wǎng)站設(shè)計網(wǎng)站制作定制網(wǎng)站網(wǎng)站設(shè)計公司

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站優(yōu)化排名