【发布时间】:2015-04-21 05:37:26
【问题描述】:
我的项目使用 api 21 编译并运行良好,当我尝试使用 api 22 编译它时,我遇到了来自 gradle 的许多错误(Error:In <declare-styleable> SherlockSpinner, unable to find attribute android:popupPromptView 和许多其他错误),我无法修复它们。
所以问题是,如果我让 api 22 运行并使用 api 21 编译它会发生什么,哪些设备无法运行我的应用程序?
更新:
请查看我的配置并告诉我哪些设备无法运行我的应用 这是我的 build.gradle 配置文件的一部分:
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')
}
【问题讨论】:
-
这不是必须的,具有 22 版本的设备也可以运行它,但可能缺少 22nd 暴露的一些功能
-
它是您选择在哪个 api 级别上编译,以这种方式选择最大和最小 api 级别。或者你可以下载最新的 API 22 并用它制作模拟器然后编译。
-
设备 = api 19 将无法安装/运行您的应用。
-
添加你的错误堆栈
-
我应该怎么做才能包含 api 22 设备并且不会遇到错误?
标签: android android-studio gradle compiler-errors