简体   繁体   中英

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. 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.

I'm not sure what to set for my app. There is target SDK, minimum sdk, and such. 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. 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.

What should I do? What should I change? Apps are posted here under Thered Software on Google Play.

您可以为不同的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. These are explained well in What is the difference between min SDK version/target SDK version vs. compile SDK version? .

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.

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.

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. Any version you upload now needs to have a version code of 57 or higher. This is because Android uses this version code to determine which version of an application is "newer."

This is specified in your build.gradle, as below:

android {
    defaultConfig {
        versionCode 56
    }
}

Change your minsdk requirement in the manifest. Do a new release (don't forget to increment the version code).

That is all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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