Flutter run stuck at installing when using compileSdkVersion=33

Viewed 435

I noticed these kind of warnings when running my Flutter app:

One or more plugins require a higher Android SDK version.

Warning: The plugin geolocator_android requires Android SDK version 33. For more information about build configuration, see https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. Warning: The plugin mobile_scanner requires Android SDK version 32. For more information about build configuration, see https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.

So I tried upgrading to Android SDK version 33. I changed the versions to this in android/local.properties:

flutter.minSdkVersion=23 flutter.targetSdkVersion=33 flutter.compileSdkVersion=33

and I access these values in android/app/build.gradle like this:

localProperties.getProperty('flutter.compileSdkVersion').toInteger()

In android/build.gradle:

//...
dependencies {
    //...
    classpath 'com.android.tools.build:gradle:7.1.2'

}
//...

In android/gradle/wrapper/gradle-wrapper.properties:

//...
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip

Now running the command flutter run --verbose

With compileSdkVersion set to 32 the app builds and runs. With compileSdkVersion set to 33 however it stucks forever at:

[ +101 ms] Starting: Intent { act=android.intent.action.RUN flg=0x20000000 cmp=app.myapp/.MainActivity (has extras) } Error type 3 Error: Activity class {app.myapp/app.myapp.MainActivity} does not exist. [ ] Waiting for observatory port to be available...

1 Answers

What's your flutter version? I had the same error (MainActivity does not exist) and upgrade my Flutter version to 3.3.2. It works fine now.

Related