Android studio forced api 31

Uncategorized
Hi,

I’m sorry if this may have been asked, but I’ve searched all over with Google and can’t really find what I’m looking for..

After setting up android studio I created a test app with a txt field and a button.

Trying to compile and run on my old phone (a Samsung galaxy s8 in dev mode), it spews an error:

The minCompileSdk (31) specified in a dependency AAR metadata (meta-inf/com/android/build/gradle/aar-metadata.properties) is greater than this modules compileSdkVersion (android-28)

Depemdancy: android.core:core:1.7.0.

I know apk 31 is greater than apk 28, thanks android studio..

Things I have done:

File》project structure 》modules》compile sdk ver = 28 (and 9 – pie)

Edited build.gradle
CompileSdk 28
MinSdk 23
TargetSdk 28
CompileSdkVersion 28

May I add that I specified 28 when creating the project, but android studio insists on sdk 31. Confuses the heck out of me..

I’ve always had trouble with android studio and gradle with a poor Internet connection. I’m managing to get the build using Internet hotspot on my new phone, though it fails on apk version..

I used to use eclipse to program back in the day and had no issues, but I think that’s deprecated now in favour of (ahem) android studio..

Please help, as I can’t for the life of me figure this out and only finding solutions to set the sdk to 31 on Google isn’t what I want, I want to use an older sdk. It’s getting quite depressing at this point..

Thanks in advance for any help given by you good folks out there..

Sharing is caring!

Leave a Reply