4

我创建了一个新的 Flutter 项目,这就是文件中 minSdkVersion 的样子app/build.gradle

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId "com.example.projectname"
    minSdkVersion flutter.minSdkVersion
    targetSdkVersion flutter.targetSdkVersion
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
}

集合的价值在哪里flutter.minSdkVersion

请注意,以前,该配置值如下所示:

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId "com.example.projectname"
    minSdkVersion 19 //*** This is the part that needs to be changed, previously was 16
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

另外,这是android/local.properties文件的内容:

sdk.dir=/Users/usernaem/Library/Android/sdk
flutter.sdk=/Users/username/flutter
flutter.buildMode=release
flutter.versionName=1.0.0
flutter.versionCode=1

可以看到,flutter.minSdkVersion这里没有设置 的值,但是项目可以编译构建成功。

flutter.minSdkVersionflutter.targetSdkVersion变量在哪里初始化?

PS相关问题:https ://github.com/flutter/flutter/issues/95533

4

1 回答 1

1

转到您的颤振提取文件夹中的此文件:

颤振/包/flutter_tools/gradle/flutter.gradle

在那里你可以找到所有的静态变量。

于 2022-01-06T12:55:32.500 回答