Target Downgrade

后端 未结 2 1775
天命终不由人
天命终不由人 2021-01-27 06:38

I have released an app on the app store with the target api being 23. A user has contacted me informing me that my app immediately crashes on devices running 23. After researchi

相关标签:
2条回答
  • 2021-01-27 07:18

    As the error message states, once you set your targetSdkVersion to 23, you are using Android 6.0's runtime permissions and cannot downgrade to target an older targetSdkVersion.

    As mentioned in the Picking your compile, min, and targetSdkVerison blog post:

    That doesn’t mean you have to use every new feature introduced nor should you blindly update your targetSdkVersion without testing  — please, please test before updating your targetSdkVersion! Your users will thank you.

    You'll have to update your app's compatibility with API 23, removing libraries that specifically prohibit targeting API 23 and ensuring that you request dangerous permissions at runtime.

    0 讨论(0)
  • 2021-01-27 07:26

    instead of downgrade you can add conditions for relate the parts of your code to the supported versions.

        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M){
           //put whole code here if nothing supported for 23+
        }
    
    0 讨论(0)
提交回复
热议问题