1

My flutter based app is failing to run from main.dart, with an error being thrown that states

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\trans\Documents\test_app-master\test-app-master\android\app\build.gradle' line: 32

* What went wrong:
A problem occurred evaluating project ':app'.
> Invalid value for compileSdkPreview ("C:\Users\trans\Documents\flutter_windows_3.0.5-stable\flutter"). Value must be a platform preview name (e.g. "S")

I can't seem to find anyone else with a similar issue, and I'm new to the world of Android app development.

I have an old build I am able to run off of my emulated virtual device, but I can't seem to rebuild with my changes now.

I tried invalidating the cache, and deleting the .idea folder, but nothing seems to solve the issue.

My project SDK version is just Android API 30, and my virtual device is set to match that. My sdk paths all seem to be in order as well.

Google has been my best friend getting this running, but I can't seem to find or word this correctly to find anything. I'm also a bit of an amateur with the workflow of mobile app development, so I can't say if I'm missing something really silly here.

Let me know if this is enough. I'd be happy to add more details or context if needed. Thanks!

Powermaster Prime
  • 402
  • 1
  • 2
  • 16

1 Answers1

2

Set the min sdk version to 26 and compile and Target sdk to 32 or 33. Also hover on kotlin and it will show the compatible version. Please add that as the kotlin version. All these changes to be done in build.gradle. Also if there is a key by name comple sdk preview

Kaushik Chandru
  • 15,510
  • 2
  • 12
  • 30