简体   繁体   English

设置正确的Android构建目标minSdkVersion,targetSdkVersion

[英]setting the correct Android Build Target, minSdkVersion, targetSdkVersion

I have an app that actually was developed for level starting 7. So far I had these settings: 我有一个实际上是为第7级开始开发的应用程序。到目前为止,我有以下设置:

Android Build Target = 7 - for compiling
minSdkVersion=7, targetSdkVersion=7 - for GooglePlay filter

Now as it turns out, when using these settings the app does not work correctly anymore on level 14 and above. 现在事实证明,使用这些设置时,该应用在14级及更高版本上无法正常运行。 While it does not crash, there are some functions which do not work correctly anmore. 虽然它不会崩溃,但是有些功能不能正常工作了。

Now I found out that changing the settings to this: 现在我发现将设置更改为此:

Android Build Target = 12, minSdkVersion=7, targetSdkVersion=7

solves the problem - AND the app can still be installed on level 7 devices and runs without problems. 解决了问题-该应用仍然可以安装在7级设备上,并且可以正常运行。

Is it actually OK to leave the setting like that or are there any risks that I do not see? 离开这样的设置实际上是否可以,或者有没有我看不到的风险?

It just seems strange that a level 12 compiled app just runs on level 7 (or hopefully on all others < 12) without any problems. 似乎很奇怪,一个12级编译的应用程序可以在7级(或希望在所有其他<12级)上运行而没有任何问题。

Many thanks! 非常感谢!

You should have a look at the documentation of the manifest.xml. 您应该查看manifest.xml的文档。 A few pointers : 一些提示:

targetsdkversion is used in order to tell to the framework for which version you have thought out your app. 使用targetsdkversion可以告诉框架您考虑过应用程序的哪个版本。 The best practice (and what google strongly recommends) is to set it to the last version (16 at the moment) 最佳做法(以及Google的强烈建议)是将其设置为最新版本(目前为16)

-minsdkversion is the minimum version of Android of which your app is able to run. -minsdkversion是您的应用程序能够运行的最低Android版本。 Since new apis are added with each new version and that old version of Android are irrelevant, it is pretty useful. 由于每个新版本都会添加新的api,而旧版本的Android则无关紧要,因此它非常有用。

-Never use maxsdkversion. -请勿使用maxsdkversion。 It was useful when tablets where new in order to do give you some time to develop a tablet version of your app but it should be not be used anymore. 当新的平板电脑可以为您提供一些时间来开发您的应用程序的平板电脑版本时,这很有用,但不应再使用它。

so yeah, target=min=7 is in fact the odd configuration. 所以是的,target = min = 7实际上是奇数配置。

Your config is OK as long as you've tested enough on Android API level 7 devices to be sure the app functions fine. 只要您已经在Android API级别7设备上进行了足够的测试以确保应用程序正常运行,则配置就可以了。

More normal might be to set the targetSdkVersion = Android Build Target 更正常的做法可能是设置targetSdkVersion = Android构建目标

I have an app on the market (from 2010) with Android Build Target =4 and minSDKVersion=3 and it is fine. 我在市场上(自2010年起)有一个Android Build Target = 4和minSDKVersion = 3的应用程序,这很好。 But I also set targetSdkVersion=4. 但是我还设置了targetSdkVersion = 4。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 android:minSdkVersion,android:targetSdkVersion和“target”之间的关系 - Relation between android:minSdkVersion, android:targetSdkVersion and “target” Android SDK minSdkVersion 和 targetSdkVersion - Android SDK minSdkVersion and targetSdkVersion Android Studio minSdkVersion和targetSdkVersion警告 - Android Studio minSdkVersion and targetSdkVersion warning Android:minSdkVersion与targetSdkVersion之间的关系 - Android: Relationship between minSdkVersion and targetSdkVersion Android风格的应用程序minSdkVersion =“ 8” targetSdkVersion =“ 21” - Android style app minSdkVersion=“8” targetSdkVersion=“21” 如果targetSdkVersion = 23(棉花糖),当minSdkVersion &lt;targetSdkVersion时,Android皮棉不会显示错误 - Android lint not showing errors when minSdkVersion < targetSdkVersion, if targetSdkVersion=23 (Marshmallow) 使用targetSdkVersion为25和minSdkVersion 19构建Android应用程序 - Building an Android app with targetSdkVersion of 25 and minSdkVersion 19 适用于Android的哪个Java版本具有不同的minSdkVersion和targetSdkVersion - Which Java version for Android with different minSdkVersion and targetSdkVersion 不同的android:minSdkVersion和targetSdkVersion导致性能问题 - Different android:minSdkVersion and targetSdkVersion causing performance problems Android compileSdkVersion 23, minSdkVersion 15, targetSdkVersion 23 - Android compileSdkVersion 23, minSdkVersion 15, targetSdkVersion 23
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM