问题描述
下载大号preVIEW发行版本 Android的工作室后,
,当我的项目有的minSdkVersion
19
此外,设置在 mindSdkVersion
如下:
defaultConfig {
....
的minSdkVersion'L'
....
}
我收到几十如下的错误,就从资源 AppCompat-v7-21
:
所以,我有2个问题:
- 为什么AS抱怨的minSdkVersion?我presume因为AppCompat-V7 21只支持大号释放;但为什么 ?此外,它仅支持大号释放时,将要正式发布的秋季呢?因为这将是一个问题...或者是它只是一个临时的限制,以便应用程序不能推到Play商店,如谷歌I / O 2014年主题?指定
- 为什么AppCompat-V7 21抱怨这些错误,因为我已经设置mindSdkVersion为L?
compileSdkVersion机器人-L'
热潮。完成。
最后编辑时间:作为的Android 5.0版本,这不再是一个问题,只是针对API直接级别21
修改为清楚起见:事实上,正如David_E以下规定,该解决方案仅适用于L型,如果你尝试部署L以下设备上的应用程序(例如< = 4.4.4),它会抱怨OLD_SDK的。为了使应用程序的工作preL你仍然需要使用旧的V20支持LIB +应用程序兼容性+ targetVersionSdk和compileVersionSdk
相关性{
编译com.android.support:appcompat-v7:20.+
编译com.android.support:support-v4:20.+
}
安卓{
compileSdkVersion 20
buildToolsVersion'20'
defaultConfig {
的applicationIDcom.example.application
的minSdkVersion 10
targetSdkVersion 20
版本code 1
VERSIONNAME1.0
}
}
Got the above error after downloading L preview release version in Android Studio
, when my project had minSdkVersion
19.
Furthermore, when setting mindSdkVersion
as below:
defaultConfig {
....
minSdkVersion 'L'
....
}
I get dozens of errors as below, regarding resources from AppCompat-v7-21
:
/home/user/workspace/project/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0-rc1/res/values-v21/values.xml
Error:Error retrieving parent for item: No resource found that matches the given name '@android:TextAppearance.Material.SearchResult.Subtitle'.
So I have 2 questions:
- Why does AS complain about minSdkVersion ? I presume because AppCompat-v7 21 supports only L release; but why ? Also, will it support only L release when it is going to be officially released in autumn too ? Because that would be a problem... Or is it just a temporary restriction in order for apps not be be pushed to Play Store, as specified in the Google I/O 2014 Keynote ?
- Why does AppCompat-v7 21 complain about those errors, as I already set mindSdkVersion to L ?
compileSdkVersion 'android-L'
BOOM. Done.
LAST EDIT: As of Android 5.0 release, this is no longer an issue, just target API level 21 directly.
Edit for clarity: Indeed as David_E specified below, this solution only works for L version, if you try to deploy the app on a device below L (ex <=4.4.4) it will complain of OLD_SDK. In order for the app to work pre-L you still need to use the old v20 support lib + app compat + targetVersionSdk and 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"
}
}
这篇关于清单合并失败:使用-SDK:10的minSdkVersion不能比L型小图书馆com.android.support:appcompat-v7:21.0.0-rc1声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!