是否必须使用api 22棒棒糖编译我的应用程序? [英] Is it mandatory to compile my app with api 22 lollipop?

查看:65
本文介绍了是否必须使用api 22棒棒糖编译我的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目使用api 21编译并运行正常,当我尝试使用api 22编译时,我遇到了gradle的许多错误(错误:在< declare-styleable> SherlockSpinner中,找不到android:popupPromptView属性,以及许多其他错误),我无法修复它们。

My project compiles and runs fine with api 21 and when i try to compile it with api 22 i'm facing many errors from gradle (Error:In <declare-styleable> SherlockSpinner, unable to find attribute android:popupPromptView, and many other errors) and i can't fix them.

所以问题是,如果我放开api 22并仅用api 21进行编译,会发生什么情况?哪些设备无法运行我的应用程序?

So the question is what happens if i let api 22 go and just compile it with api 21, and which devices can't run my app?

更新:

请查看我的配置并告诉我设备无法运行我的应用程序
这是我的build.gradle配置文件的一部分:

Please take a look at my config and tell me which devices can't run my app this is a part of my build.gradle config file:

apply plugin: 'com.android.application'
android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        minSdkVersion 9
        targetSdkVersion 19
    }

    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
    }

    lintOptions {
        abortOnError false
        checkReleaseBuilds false
    }
}
dependencies {
    compile 'com.android.support:support-v4:21.0.3'
    compile 'com.google.code.gson:gson:2.3'
    compile 'com.google.android.gms:play-services-base:6.5.+'
    compile project(':chipsLibrary')
    compile project(':slidingMenu')
    compile project(':listviewanims')
    compile project(':switchCompatLibrary')
    compile project(':lib_numberpicker')
    compile project(':styleddialogslib')
    compile project(':doomDatePickerlibrary')
    compile project(':swipelistview')
    compile project(':actionbarsherlockPullToRefresh')
    compile project(':showcaseLib_Untouched_library')
    compile project(':cropper')
    compile project(':library_androidanims')
    compile project(':library_async_45')
    compile files('libs/google-api-services-drive-v2-rev123-1.18.0-rc.jar')
    compile files('libs/google-oauth-client-1.18.0-rc.jar')
    compile files('libs/acra-4.5.0.jar')
    // Required for Dropbox
    compile files('libs/dropbox-android-sdk-1.6.1.jar')
    compile files('libs/json_simple-1.1.jar')
    compile files('libs/systembartint-1.0.3.jar')
    compile files('libs/universal-image-loader-1.9.2 (1).jar')
    compile files('libs/volley.jar')
    compile files('libs/google-api-client-1.18.0-rc.jar')
    compile files('libs/google-api-client-android-1.18.0-rc.jar')
    compile files('libs/google-http-client-1.18.0-rc.jar')
    compile files('libs/google-http-client-android-1.18.0-rc.jar')
    compile files('libs/google-http-client-gson-1.18.0-rc.jar')
    compile files('libs/joda-time-2.3.jar')
    compile files('libs/itext-4.2.1.jar')
}


推荐答案

编译仅当您要使用特定SDK版本提供的功能时,才需要通过定义特定的SDK版本来定义您的应用程序。

Compiling your application by defining particular compile SDK version is only required if you would want to use the features provided by that particular SDK version.

您绝对可以使用较低版本进行编译,使其与较高版本兼容,但是如上所述,您将无法使用由定义的新功能/功能更高的版本。

You can definitely compile with lower version and make it compatible for the higher version, but as said above you won't be able to use the new functionalities/features defined by higher version.

这篇关于是否必须使用api 22棒棒糖编译我的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆