Android Question Oops - targetSdkVersion="31" but using the directory that points to SDK 30

Robert Valentino

Well-Known Member
Licensed User
Longtime User
I changed one of my apps to target SDK 31 but forgot to change the directory in the paths where 31 actually exists (still pointing to 30)

What does that mean? I uploaded the app to google and all seems fine?

I am going to fix this but just wanted to understand what the ramifications of this were.

BobVal
 

agraham

Expert
Licensed User
Longtime User
It doesn't really matter. Your app obviously doesn't use anything that actually requires SDK 31 as it compiled under SDK 30 and as Android is generally backward compatible it will run on an SDK 31 device and many earlier ones assuming you set your minSDK correctly. The only thing that I can think might trip you up is if there is something, like a permission, that got tightened up under SDK 31 compared to SDK30. For example if you target SDK 28 your app can access the entire filestore with PERMISSION_WRITE_EXTERNAL_STORAGE but if you change the target SDK for that same app to SDK 30 it will be subject to SDK 30 restrictions and will not be able to directly access any other than a few select folders and types of files.
 
Upvote 1

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Thanks for the response.

I've changed my app to use the right directories and put it on google play.

Google wants everyone to be at SDK 31 - What do they use to determine this.
If I were to have left it the way I had where the target sdk 31 and the libraries are 30 would Google think I was 31? (of course assuming I didn't get tripped up by anything)
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
- What do they use to determine this.
Only the target SDK setting. Everything else, permissions, restrictions follows from that. It doesn't matter what SDK it was compiled against - those libraries are non-functional dummies consisting only of definitions. Runtime behaviour is determined by the full libraries on the device.
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Agraham - thanks so much for explaining this. I've learned so much from this. Didn't realize the compiled path libraries were just stubs.

Again Thanks.
 
Upvote 0
Top