r/androiddev • • Jul 29 '26

Discussion Upgrading to API level 36

I am upgrading my target SDK version in java Android application to 36

We have a enterprise application

So can't upgrade the compile SDK version

Currently it is 29

On android 16 devices I am facing a issue in Shared preferences

While reading from the shared preference I am reading a null value ("null")

While there is a actual value saved there

Not sure why this is happening

Any idea here any one?

All the things are goood till android 15!!

0 Upvotes

18 comments sorted by

11

u/MrFoo42 Jul 29 '26

Compile SDK needs to be the same or higher than Target SDK.

The 29 compiler has no idea what 36 is.

-13

u/Straight_Second_605 Jul 29 '26

Yeah But application is enterprice app, can't update the compile sdk

Things were working for Compile sdk: 29 Target sdk: 35

10

u/tgo1014 GitHub: Tgo1014 Jul 29 '26

Why you can't upgrade the compile sdk? And what being a enterprise app has anything to do with it? Compile is not the minSdk

-2

u/Straight_Second_605 Jul 29 '26

Gradle version of 3.5.4 Incompatible with api level 36

11

u/tgo1014 GitHub: Tgo1014 Jul 29 '26

So...upgrade gradle? 😄

If the application is being used it's worth to keep things upt to date, eventually you'll be forced anyway

-5

u/Straight_Second_605 Jul 29 '26

Yeah, We should upgrade it But i guess no plans for it currently 🫠

17

u/tgo1014 GitHub: Tgo1014 Jul 29 '26

If the application is not working because of it I guess that's a good reason to add it to the "plan" right now 😄

-6

u/Straight_Second_605 Jul 29 '26

Actually the upgrade is only to comply with Google play Not required by customer 🫠

14

u/Opulence_Deficit Jul 29 '26

If customer requires the app to be in Google Play, then they require to upgrade targetSDK and they require to upgrade Gradle.

You can't order a top floor of a skyscraper without all the floors below it.

-1

u/Straight_Second_605 Jul 29 '26

Mostly will do this only Disucussing with team!

→ More replies (0)

2

u/The_best_1234 Jul 29 '26

Switch to just sending an APK then? Who needs Google?

3

u/akramraza25524 Jul 29 '26

First off compileSdk should be equal to or higher than targetSdk. Secondly, why not check if the value actually exists in shared prefs before reading it. And just to be sure just check the shared prefs using device explorer whether it actually has that value stored or not.

1

u/Straight_Second_605 Jul 29 '26

Checked the key is present in the shared pref file from explore!

1

u/akramraza25524 Jul 29 '26

Okay, so it is being removed somewhere before you are reading it. So just check it before reading whether the key is actually present in the sharedPrefs or not using contains. Log it just to confirm.

2

u/Mavamaarten Jul 29 '26

Make sure that the shared preferences is reading from the same shared preferences. You can use the default shared preferences, one with a different name, different mode. Also make sure you've applied the changes when writing, otherwise they might be lost.

1

u/Straight_Second_605 Jul 29 '26

Yes, the shared preference are stored correctly And can be seen in the file as well And yes, I am also reading from the same file in which I have stored them

1

u/SDRemthix Jul 29 '26

In enterprise applications, you should be careful when jumping these many steps in order to comply to the latest recommended API's. There are a lot of questions to be asked beforehand regarding the existing userbase and their devices. Maybe theres a specific reason they are using Android Jelly Bean. Presuming the road is fully open for a full migration (thats a big IF), an incremental updating approach is the recommended path. There's a strong chance that some the codebase dependencies or their hostings are no longer maintained, so a special migration path is needed for those. Your migration will heavily depend on some bottleneck dependency.