简体   繁体   English

如何在已发布的Play应用上回滚Gradle SDK设置? 什么是目标SDK和最低SDK?

[英]How do I roll back Gradle SDK settings on a published Play app? What is Target SDK and minimum SDKs?

As I was developing, I published to SDK 21, Lollipop, and I'm not able to use it on my KitKat device. 在开发过程中,我发布了SDK 21 Lollipop,但无法在KitKat设备上使用它。 The applications are really simple and I only used the SDK for the animations and for material design, however two things come up when I try and make changes to the play store. 这些应用程序确实非常简单,我只将SDK用于动画和材质设计,但是当我尝试对Play商店进行更改时会遇到两件事。

I'm not sure what to set for my app. 我不确定要为我的应用设置什么。 There is target SDK, minimum sdk, and such. 有目标SDK,最小sdk等。 I set all of these to 21 to 22. Now, if I try and publish an app that uses SDK minimum 11, Play gets mad and says that it cant roll back on devices. 我将所有这些设置为21到22。现在,如果我尝试发布使用最低SDK版本11的应用,Play就会发疯,并说它无法在设备上回滚。 I don't care to update the users phones. 我不在乎更新用户的手机。 Its a simple application that doesnt require that, but it won't let me update and replace the primary apk. 它是一个不需要的简单应用程序,但不会让我更新和替换主要apk。

What should I do? 我该怎么办? What should I change? 我应该改变什么? Apps are posted here under Thered Software on Google Play. 应用程序发布在Google Play上的Thered软件下。

您可以为不同的api级别发布多个apk: http : //developer.android.com/training/multiple-apks/api.html

First you should make sure you understand the difference between the compile SDK, minimum SDK, and target SDK versions. 首先,您应该确保了解编译SDK,最低SDK和目标SDK版本之间的区别。 These are explained well in What is the difference between min SDK version/target SDK version vs. compile SDK version? 最低SDK版本/目标SDK版本与编译SDK版本之间的区别是什么? .

Now, if I try and publish an app that uses SDK minimum 11, Play gets mad and says that it cant roll back on devices. 现在,如果我尝试发布使用最低SDK版本11的应用,Play就会发疯,并说它无法在设备上回滚。

It would help if you posted the specific error message that the Play Store shows you, but it sounds like you are trying to upload an APK with a lower version code than an existing version of your app. 如果您发布了Play商店向您显示的特定错误消息,这会有所帮助,但这听起来像是您尝试上传的APK版本号低于应用程序现有版本的APK。

For example, let's assume you previously uploaded an APK that had a min SDK of 21 and you labeled that APK as version 56 of your application. 例如,假设您先前上传的SDK的最低SDK为21,并且将该APK标记为应用程序的版本56。 Any version you upload now needs to have a version code of 57 or higher. 您上载的任何版本现在都必须具有57或更高版本的代码。 This is because Android uses this version code to determine which version of an application is "newer." 这是因为Android使用此版本代码来确定应用程序的哪个版本是“较新的”。

This is specified in your build.gradle, as below: 这在build.gradle中指定,如下所示:

android {
    defaultConfig {
        versionCode 56
    }
}

Change your minsdk requirement in the manifest. 在清单中更改您的minsdk要求。 Do a new release (don't forget to increment the version code). 进行新发行(不要忘记增加版本代码)。

That is all. 就这些。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM