- Home /
Unity 5.4 uses old android SDK target (api level: 22), so i cant update my app on play store
Hi!
I have an application on play store that i built with a previous version of unity, that used aPI level 23 (marshmallow) as a target sdk version. Now i want to release a newer version of it with unity 5.4, but i cannot upload the SDK because unity is now back to using target sdk version 22 (Lollipop), and the play store wont let me update
Unity does not have a setting to control the target sdk version (there is a setting for the minimum supported api, but that's not the same). So what do i have to do to publish my app on the play store?
The play store displays this error message: "It is forbidden to downgrade devices which previously used M permissions (target SDK 23 and above) to APKs which use old style permissions (target SDK 22 and below). This occurs in the change from version 2 (target SDK 23) to version 3 (target SDK 22)."
Hi @Hussar123
What is the SD$$anonymous$$ Target that you need? Have you checked that you have the target API installed in your Android SD$$anonymous$$ location? Unity supports the target API that you need as soon you have it installed in your machine
Answer by pako · Sep 11, 2016 at 11:31 AM
Unity uses whatever Android SDK you have in your system.
So, make sure that you have the latest android API installed, by starting the Android SDK Manager, and updating to the latest API.
Also, make sure that in Unity/Edit/Preferences/ External Tools the path to the Android SDK is set correctly to the Android SDK installation you updated.
Hi! Thank you very much for your answer!. I checked the installed sdks and i have only the latest level sdks installed, and 22 or older sdks are all uninstalled.
Here's a complete list of what i have installed:
Android SD$$anonymous$$ Tools 25.1.7 Android SD$$anonymous$$
platform tools 24.0.2 Android SD$$anonymous$$
Build tools 23.0.2 (this is not the but it should be for marshmallow)
SD$$anonymous$$ Platform 23 Rev.3
Android Support Library 23.2.1
Google USB driver 11
I double checked and this is the SD$$anonymous$$ folder that is set in unity.
Like all Android apps, Unity will also generate your game with an Android$$anonymous$$anifest. This file specifies the targetSD$$anonymous$$ that your game uses. If you do not have your own manifest, Unity has a default one that gets used, not sure which targetSD$$anonymous$$ value is specified there. The easiest way is to check your android manifest(s) - there may be more than one, to see which targetSD$$anonymous$$ value is specified.
Note that there are a few different values - $$anonymous$$Sdk, targetSdk, maxSdk. All have a different use.
Please note that I also offer my professional services so you could contact me via this link, in the case you still weren't able to resolve this issue.
Answer by LightOwl · Apr 14, 2017 at 05:47 AM
This can be found under plugins/android in the project folder
Answer by quanpatrick · May 25, 2017 at 04:30 PM
copy SDK tools_r25.2.5-windows >>>>AppData\Local\Android\sdk\tools
finish
Answer by titch_stewart · Oct 16, 2018 at 12:36 AM
@trenmost I don't know if you fixed this or not but I've just ran into this problem, when trying to add my APK to my Google Play Console account, and spent nearly 4 hours getting it to work. I have Unity 2017.3.1f1 and didn't need to update it. I did follow some of the instructions in:
https://boostlog.io/@mohammedalsayedomar/setup-android-sdk-and-jdk-in-unity-5adad03d47018500491f3f77
Specifically I updated the following: Android SDK Tools Android SDK Platform-Tools Android SDK Build-Tools
Note afterwards that Unity was still saying that my highest level was Level 25:
I did a rebuild and checked the AndroidManifest using AndroidStudio's Build->Analyze APK and it shows:
I was able to drag and drop the APK into my Google Play Console without any problems.
Restarting Unity didn't show the newly available SDK levels. I've not restarted my PC but I think they'll probably appear after that.
Anyway, hope this helps someone because it's a minefield.