【问题标题】:Flutter minSdkVersion and targetSdkVersion errorFlutter minSdkVersion 和 targetSdkVersion 错误
【发布时间】:2022-01-22 09:13:21
【问题描述】:

在旧版本中,我们可以通过 android/app/build.gradle 进行更改。现在,当我们更改它时,它会报错。

defaultConfig {
        applicationId "com.example.manuel"
        minSdkVersion flutter.minSdkVersion
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

有些人通过local.properties解决了这个问题,但是这个方法也不起作用。

sdk.dir=C:/Users/user/AppData/Local/Android/Sdk
flutter.sdk=C:\\src\\flutter
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1

【问题讨论】:

标签: android flutter gradle


【解决方案1】:

您还需要在新版本中编辑build.gradle 文件。如下;

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
   applicationId "com.example.manuel"
    minSdkVersion 16 // <--- There minSdkVersion Content
    targetSdkVersion 27 <--- There targetSdkVersion (is actually Max Sdk Version) Content
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

然后重新构建项目并再次构建它。

希望对你有用。

【讨论】:

  • 是的,它适用于 dostum,我希望他们在下一次更新中解决问题。
猜你喜欢
  • 2022-01-17
  • 2014-04-15
  • 2022-01-20
  • 2013-12-20
  • 2020-01-14
  • 1970-01-01
  • 2022-01-10
  • 2016-03-01
  • 1970-01-01
相关资源
最近更新 更多