Search code examples
androidflutter

Flutter building with wrong compileSdkVersion


I'm trying to update the compileSdkVersion from 33 to 34 in my Flutter project.

I changed the android/app/build.gradle file, ran

flutter clean
flutter pub get

I built the new appbundle but when I upload it to Play Store it still identifies as compileSdkVersion 33. This is the build.gradle I'm using.

https://pastebin.com/aAWQRRRJ

What am I missing?


Solution

  • Thanks to @Hitarth Chhunchha in the comments I was able to find the solution. In the android/app/build.gradle file, I changed this line

    targetSdkVersion flutter.targetSdkVersion
    

    to this

    targetSdkVersion 34
    

    and this solved my issue.

    Useful if you need to manually handle the target SDK version without upgrading Flutter.