Android Studio配置中AndroidAnnotations

來源:互聯網
上載者:User

標籤:str   for   技術分享   png   round   led   junit   rip   分享   

  今天正好得空看了下關於AndroidAnnotations這個東西,這個東西發現也算是來源於其他的三方的架構吧,具體的是什麼架構已經不記得了,總之是這個東西讓我很是流連忘返,雖然當時看到這個東西很驚訝,也是恨不得趕緊就能啪進去看看究竟。

  也是由於工作原因吧,說實話我也算是個敬業的小憤青,苦於不會套路,然後一直拖延到今天。

  這裡就到了我今天寫這篇部落格的原因說明了,這裡讓我萬分惱怒和氣憤,這東西中文版很少人寫,寫的也基本就沒法看,其次就是一片部落格被N多人拷貝,我也就呵呵了。

  那麼咱們開始今天的主題配置講解。

  首先是項目的build gradle檔案配置見:

 

 

   這裡大家注意下藍色部分的幾個點哈,這裡著重點名下這塊配置。

buildscript {    repositories {        mavenCentral()//---這裡一定要注意,不是  jcenter()    }    dependencies {        classpath ‘com.android.tools.build:gradle:2.2.0‘        // NOTE: Do not place your application dependencies here; they belong        // in the individual module build.gradle files        classpath ‘com.neenbedankt.gradle.plugins:android-apt:1.8‘    }}

 

   其次是module中build gradle的配置:

 

 

 

 

 

 上述是關於其AndroidAnnotions的在gradle中的配置

 

apply plugin: ‘com.android.application‘apply plugin: ‘com.neenbedankt.android-apt‘android {    compileSdkVersion 24    buildToolsVersion "24.0.3"    defaultConfig {        applicationId "com.helloworld"        minSdkVersion 15        targetSdkVersion 21        versionCode 1        versionName "1.0"        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"    }    buildTypes {        release {            minifyEnabled false            proguardFiles getDefaultProguardFile(‘proguard-android.txt‘), ‘proguard-rules.pro‘        }    }}def AAVersion = ‘4.1.0‘ // change this to your desired version, for example the latest stable: 4.1.0dependencies {    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:24.1.0‘    testCompile ‘junit:junit:4.12‘    apt "org.androidannotations:androidannotations:$AAVersion"    compile "org.androidannotations:androidannotations-api:$AAVersion"}

 

Android Studio配置中AndroidAnnotations

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.