#Flutter error: The plugin qr_code_scanner requires a higher Android SDK version.

1 messages · Page 1 of 1 (latest)

red talon
#

this is my build.gradle ```plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

android {
namespace "com.example.medisync"
compileSdk 33
ndkVersion flutter.ndkVersion

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
    jvmTarget = '1.8'
}

sourceSets {
    main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId "com.example.medisync"
    // You can update the following values to match your application needs.
    // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
    minSdkVersion flutter.minSdkVersion
    targetSdkVersion 33
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
}

buildTypes {
    release {
        // TODO: Add your own signing config for the release build.
        // Signing with the debug keys for now, so `flutter run --release` works.
        signingConfig signingConfigs.debug
    }
}

}

flutter {
source '../..'
}

dependencies {}

#

and this is what happens when i try to flutter run in terminal: ```C:\Users\username\projects\xyz\android\app\src\debug\AndroidManifest.xml Error:
uses-sdk:minSdkVersion 19 cannot be smaller than version 20 declared in library [:qr_code_scanner] C:\Users\username\projects\xyz\build\qr_code_scanner\intermediates\merged_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 19
Suggestion: use a compatible library with a minSdk of at most 19,
or increase this project's minSdk version to at least 20,
or use tools:overrideLibrary="net.touchcapture.qr.flutterqr" to force usage (may lead to runtime failures)

FAILURE: Build failed with an exception.

    Suggestion: use a compatible library with a minSdk of at most 19,
            or increase this project's minSdk version to at least 20,
            or use tools:overrideLibrary="net.touchcapture.qr.flutterqr" to force usage (may lead to runtime failures)
  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

BUILD FAILED in 7s
Running Gradle task 'assembleDebug'... 8.1s

Error: Gradle task assembleDebug failed with exit code 1

#

i know this might not be the right place to ask such i think, but help is appreciated pls

#

or is it just something wrong with the package im working with