Launching lib/main.dart on sdk gphone64 x86 64 in debug mode... Warning: The plugin flutter_plugin_android_lifecycle requires Android SDK version 33. For more information about build configuration, see https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
FAILURE: Build failed with an exception.
Could not resolve all artifacts for configuration ':fluttertoast:classpath'. Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0. Required by: project :fluttertoast > The consumer was configured to find a runtime of a component compatible with Java 17, packaged as a jar, and its dependencies declared externally. However we cannot choose between the following variants of org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0: - gradle70JavadocElements - gradle70RuntimeElements - gradle70SourcesElements - javadocElements - runtimeElements - sourcesElements All of them match the consumer attributes: - Variant 'gradle70JavadocElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0 declares a runtime of a component, and its dependencies declared externally: - Unmatched attributes: - Provides documentation but the consumer didn't ask for it - Provides javadocs but the consumer didn't ask for it - Doesn't say anything about its target Java version (required compatibility with Java 17) - Doesn't say anything about its elements (required them packaged as a jar) - Provides attribute 'org.gradle.plugin.api-version' with value '7.0' but the consumer didn't ask for it - Provides release status but the consumer didn't ask for it - Variant 'gradle70RuntimeElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0 declares a runtime of a component compatible with Java 8, packaged as a jar, and its dependencies declared externally: - Unmatched attributes: - Provides a library but the consumer didn't ask for it - Provides attribute 'org.gradle.jvm.environment' with value 'standard-jvm' but the consumer didn't ask for it - Provides attribute 'org.gradle.plugin.api-version' with value '7.0' but the consumer didn't ask for it - Provides release status but the consumer didn't ask for it - Provides attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' but the consumer didn't ask for it - Variant 'gradle70SourcesElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0 declares a runtime of a component, and its dependencies declared externally: - Unmatched attributes: - Provides documentation but the consumer didn't ask for it - Provides sources but the consumer didn't ask for it - Doesn't say anything about its target Java version (required compatibility with Java 17) - Doesn't say anything about its elements (required them packaged as a jar) - Provides attribute 'org.gradle.plugin.api-version' with value '7.0' but the consumer didn't ask for it - Provides release status but the consumer didn't ask for it - Variant 'javadocElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0 declares a runtime of a component, and its dependencies declared externally: - Unmatched attributes: - Provides documentation but the consumer didn't ask for it - Provides javadocs but the consumer didn't ask for it - Doesn't say anything about its target Java version (required compatibility with Java 17) - Doesn't say anything about its elements (required them packaged as a jar) - Provides release status but the consumer didn't ask for it - Variant 'runtimeElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0 declares a runtime of a component compatible with Java 8, packaged as a jar, and its dependencies declared externally: - Unmatched attributes: - Provides a library but the consumer didn't ask for it - Provides attribute 'org.gradle.jvm.environment' with value 'standard-jvm' but the consumer didn't ask for it - Provides release status but the consumer didn't ask for it - Provides attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' but the consumer didn't ask for it - Variant 'sourcesElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0 declares a runtime of a component, and its dependencies declared externally: - Unmatched attributes: - Provides documentation but the consumer didn't ask for it - Provides sources but the consumer didn't ask for it - Doesn't say anything about its target Java version (required compatibility with Java 17) - Doesn't say anything about its elements (required them packaged as a jar) - Provides release status but the consumer didn't ask for it The following variants were also considered but didn't match the requested attributes: - Variant 'apiElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0 declares a component compatible with Java 8, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares an API of a component and the consumer needed a runtime of a component - Variant 'gradle70ApiElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0 declares a component compatible with Java 8, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares an API of a component and the consumer needed a runtime of a component Failed to notify project evaluation listener. Could not get unknown property 'android' for project ':fluttertoast' of type org.gradle.api.Project. Could not get unknown property 'android' for project ':fluttertoast' of type org.gradle.api.Project.
BUILD FAILED in 21s Exception: Gradle task assembleDebug failed with exit code 1 Exited
In your app level build.gradle
(Android > app > build.gradle) scroll down to
android {
compileSdkVersion 33
}
The error is saying that from all the packages that you use in your project, you need atleast a minimum of SDK 33. Simply change that number, but keep in mind that this means older android phones will not be able to use your project.
Your other solution is to remove the library/package that requires SDK 33 and higher and find an alternative package, or downgrade it to use an older version.
Upgrading packages can sometimes require higher minimum Android SDK because owners maintain their package to be compatible with the latest Android release, which could incorporate new features, security, APIs, optimizations and other improvements that older android devices do not have. In this case when an old Android phone cannot read such features from the package, it gives the error that SDK version is not compatible.
I strongly suggest fixing the issue by upgrading Android SDK to 33, and those with older devices will need to buy a new phone to use your app. The higher SDK usually have improved performance, security and user experience.
You may find more information on which android devices belong to which SDK versions from this documentary: