2015-12-03 58 views
0

我在Android Studio中使用sdk版本19我應該在Android Studio中使用哪些appcombat版本?

但是我應該使用哪種版本的appcombat版本?

如果我看到的應用程序構建gradle這個,我BuildstoolVersion是19.1.0和targetSDK版也是19

這是我的應用程序的gradle構建設置如下

android { 
    compileSdkVersion 19 
    buildToolsVersion "19.1.0" 

    defaultConfig { 
     applicationId "com.seoul.agent.felix.robolectrictest" 
     minSdkVersion 19 
     targetSdkVersion 19 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 

    testOptions { 
     unitTests.all { 
      // All the usual Gradle options. 
      jvmArgs '-XX:MaxPermSize=256m' 
     } 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    compile 'com.android.support:appcompat-v7:19.+' 
    compile 'com.android.support:support-v4.19.+' 
    compile 'com.github.kristofa:mock-http-server:4.1' 

    testCompile 'junit:junit:4.12' 
    testCompile 'org.mockito:mockito-core:1.9.5' 
    testCompile 'org.robolectric:robolectric:3.0' 

} 
+2

AppCom ** ** b在:!'就緒...撲滅' –

+0

使用**最新的程序兼容性庫**:目前23.1.1 –

回答

1

您將不再需要任何支持庫在你項目中,因爲你的minSdkVersiontargetSdkVersion是一樣的。

支持庫旨在爲舊版android版本添加新功能。目前有六個版本的support library的:

  • V4
  • V7
  • V8
  • V13
  • V14
  • V17

但要記住:支持庫版本7不是新版本o f 4和8不是7的較新版本。相反,每個版本都包含在此版本號的android版本中添加的組件。

示例:Android版本3.0(API級別11)使用名爲「Fragments」的新功能發佈。爲了能夠在3.0之前在Android中使用片段,他們引入了v4 Support Library

如果您的targetSdkVersion爲19,而您的minSdkVersion爲10,並且您想使用片段,則需要使用v4支持庫中的類才能使它們在所有電話上都可用。

import android.support.v4.app.Fragment; 
+0

閱讀更好的問題:但是什麼版本的appcombat版本應該我用?這隻有1個appcompat支持庫。 –

+0

感謝版本是一個問題。它是在sdk版本降低後完成的 –

相關問題