Android -- uses-sdk:minSdkVersion 10 cannot be smaller than version L declared in library com.android.support:appcompat-v7:21.0.0-rc1

來源:互聯網
上載者:User

標籤:android   style   blog   io   color   ar   使用   sp   div   

這是一個報錯,是我在Android Studio上添加完Support-v4和v7包之後爆出的錯誤,百度了好久也沒有百度到。當時我的項目有minSdkVersion 19。

設定版本最小為L的時候也會出錯,並且我的測試機是4.3,根本就無法安裝。

defaultConfig {....          minSdkVersion ‘L‘....    }
解決辦法                                                                              

1、將compileSdkVersion設定成為

compileSdkVersion ‘android-L‘

這個解決方案只適用於L版本,如果嘗試部署以下裝置上應用L(< = 4.4.4)會爆出OLD_SDK。為了讓應用程式工作L你仍然需要使用舊的v20支援自由+應用程式相容+ targetVersionSdk和compileVersionSdk

dependencies {        compile ‘com.android.support:appcompat-v7:20.+‘        compile ‘com.android.support:support-v4:20.+‘    }    android {        compileSdkVersion 20        buildToolsVersion ‘20‘        defaultConfig {            applicationId "com.example.application"            minSdkVersion 10            targetSdkVersion 20            versionCode 1            versionName "1.0"        }}

2、改gradle dependecy

這裡可能會無法正常工作,它只會使你的應用程式為Android L工作。為了保護舊的Android作業系統版本的向後相容性,改變gradle dependecy。

compile ‘com.android.support:appcompat-v7:20.+‘
我是天王蓋地虎的分割線                                                             

Android -- uses-sdk:minSdkVersion 10 cannot be smaller than version L declared in library com.android.support:appcompat-v7:21.0.0-rc1

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.