title: Flutter Android SDK version 28 Error but I am using 30
body: <p>When I create a new flutter app, It starts android sdk version 28 but I use android sdk 30.
  Flutter doctor also shows Platform android-30, build-tools 30.0.2. When I tried to install a package like url_launcher or shared_preferences I am getting error It looks for Android sdk 30.
  Also every time I am changing android sdk verison from build.gradle.</p>
  <p>Here is My flutter doctor output:</p>
  <pre><code>flutter doctor -v
  [✓] Flutter (Channel stable, 1.22.0, on Linux, locale en_US.UTF-8)
      • Flutter version 1.22.0 at /home/felix/snap/flutter/common/flutter
      • Framework revision d408d302e2 (7 days ago), 2020-09-29 11:49:17 -0700
      • Engine revision 5babba6c4d
      • Dart version 2.10.0
  
   
  [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
      • Android SDK at /home/felix/Android/Sdk
      • Platform android-30, build-tools 30.0.2
      • Java binary at: /home/felix/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/193.6626763/jre/bin/java
      • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
      • All Android licenses accepted.
  
  [!] Android Studio (version 4.0)
      • Android Studio at /home/felix/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/193.6626763
      ✗ Flutter plugin not installed; this adds Flutter specific functionality.
      ✗ Dart plugin not installed; this adds Dart specific functionality.
      • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593
  </code></pre>
  <p>)</p>
  <p>Url launcher package error :</p>
  <pre><code>FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':url_launcher:parseDebugLibraryResources'.
  &gt; Could not resolve all files for configuration ':url_launcher:androidApis'.
     &gt; Failed to transform file 'android.jar' to match attributes {artifactType=android-platform-attr, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}
        &gt; Execution failed for PlatformAttrTransform: /home/computer/Android/Sdk/platforms/android-28/android.jar.
           &gt; /home/computer/Android/Sdk/platforms/android-28/android.jar (No such file or directory)
  
  * 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.
  
  * Get more help at https://help.gradle.org
  
  BUILD FAILED in 2s
  </code></pre>
  <p>Exception: Gradle task assembleDebug failed with exit code 1</p>
  <p>My build.gradle file</p>
  <pre><code>    def localProperties = new Properties()
  def localPropertiesFile = rootProject.file('local.properties')
  if (localPropertiesFile.exists()) {
      localPropertiesFile.withReader('UTF-8') { reader -&gt;
          localProperties.load(reader)
      }
  }
  
  def flutterRoot = localProperties.getProperty('flutter.sdk')
  if (flutterRoot == null) {
      throw new GradleException(&quot;Flutter SDK not found. Define location with flutter.sdk in the local.properties file.&quot;)
  }
  
  def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
  if (flutterVersionCode == null) {
      flutterVersionCode = '1'
  }
  
  def flutterVersionName = localProperties.getProperty('flutter.versionName')
  if (flutterVersionName == null) {
      flutterVersionName = '1.0'
  }
  
  apply plugin: 'com.android.application'
  apply plugin: 'kotlin-android'
  apply from: &quot;$flutterRoot/packages/flutter_tools/gradle/flutter.gradle&quot;
  
  android {
      compileSdkVersion 30
  
      sourceSets {
          main.java.srcDirs += 'src/main/kotlin'
      }
  
      lintOptions {
          disable 'InvalidPackage'
      }
  
      defaultConfig {
          // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
          applicationId &quot;com.example.appdeals&quot;
          minSdkVersion 16
          targetSdkVersion 30
          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 {
      implementation &quot;org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version&quot;
  }
  </code></pre>
  <p>shared_preferences error :</p>
  <pre><code>FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':shared_preferences:parseDebugLibraryResources'.
  &gt; Could not resolve all files for configuration ':shared_preferences:androidApis'.
     &gt; Failed to transform file 'android.jar' to match attributes {artifactType=android-platform-attr, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}
        &gt; Execution failed for PlatformAttrTransform: /home/computer/Android/Sdk/platforms/android-28/android.jar.
           &gt; /home/computer/Android/Sdk/platforms/android-28/android.jar (No such file or directory)
  
  * 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.
  * Get more help at https://help.gradle.org
  
  BUILD FAILED in 8s
  Exception: Gradle task assembleDebug failed with exit code 1
  Exited (sigterm)
  </code></pre>