Unverified Commit 9cb60c98 authored by Emmanuel Garcia's avatar Emmanuel Garcia Committed by GitHub

Revert "reads min/target sdk versions from localproperties" (#99191)

parent c80ff45a
...@@ -29,16 +29,6 @@ apply plugin: 'com.android.application' ...@@ -29,16 +29,6 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def flutterMinSdkVersion = localProperties.getProperty('flutter.minSdkVersion')
if (flutterMinSdkVersion == null) {
flutterMinSdkVersion = flutter.minSdkVersion
}
def flutterTargetSdkVersion = localProperties.getProperty('flutter.targetSdkVersion')
if (flutterTargetSdkVersion == null) {
flutterTargetSdkVersion = flutter.targetSdkVersion
}
android { android {
compileSdkVersion flutter.compileSdkVersion compileSdkVersion flutter.compileSdkVersion
...@@ -58,8 +48,8 @@ android { ...@@ -58,8 +48,8 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "dev.flutter.flutter_api_samples" applicationId "dev.flutter.flutter_api_samples"
minSdkVersion flutterMinSdkVersion minSdkVersion flutter.minSdkVersion
targetSdkVersion flutterTargetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
} }
......
...@@ -28,16 +28,6 @@ if (flutterVersionName == null) { ...@@ -28,16 +28,6 @@ if (flutterVersionName == null) {
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def flutterMinSdkVersion = localProperties.getProperty('flutter.minSdkVersion')
if (flutterMinSdkVersion == null) {
flutterMinSdkVersion = flutter.minSdkVersion
}
def flutterTargetSdkVersion = localProperties.getProperty('flutter.targetSdkVersion')
if (flutterTargetSdkVersion == null) {
flutterTargetSdkVersion = flutter.targetSdkVersion
}
android { android {
compileSdkVersion flutter.compileSdkVersion compileSdkVersion flutter.compileSdkVersion
...@@ -48,8 +38,8 @@ android { ...@@ -48,8 +38,8 @@ android {
defaultConfig { defaultConfig {
applicationId "io.flutter.examples.flutter_view" applicationId "io.flutter.examples.flutter_view"
minSdkVersion flutterMinSdkVersion minSdkVersion flutter.minSdkVersion
targetSdkVersion flutterTargetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
} }
......
...@@ -28,16 +28,6 @@ if (flutterVersionName == null) { ...@@ -28,16 +28,6 @@ if (flutterVersionName == null) {
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def flutterMinSdkVersion = localProperties.getProperty('flutter.minSdkVersion')
if (flutterMinSdkVersion == null) {
flutterMinSdkVersion = flutter.minSdkVersion
}
def flutterTargetSdkVersion = localProperties.getProperty('flutter.targetSdkVersion')
if (flutterTargetSdkVersion == null) {
flutterTargetSdkVersion = flutter.targetSdkVersion
}
android { android {
compileSdkVersion flutter.compileSdkVersion compileSdkVersion flutter.compileSdkVersion
...@@ -48,8 +38,8 @@ android { ...@@ -48,8 +38,8 @@ android {
defaultConfig { defaultConfig {
applicationId "io.flutter.examples.hello_world" applicationId "io.flutter.examples.hello_world"
minSdkVersion flutterMinSdkVersion minSdkVersion flutter.minSdkVersion
targetSdkVersion flutterTargetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
} }
......
...@@ -28,16 +28,6 @@ if (flutterVersionName == null) { ...@@ -28,16 +28,6 @@ if (flutterVersionName == null) {
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def flutterMinSdkVersion = localProperties.getProperty('flutter.minSdkVersion')
if (flutterMinSdkVersion == null) {
flutterMinSdkVersion = flutter.minSdkVersion
}
def flutterTargetSdkVersion = localProperties.getProperty('flutter.targetSdkVersion')
if (flutterTargetSdkVersion == null) {
flutterTargetSdkVersion = flutter.targetSdkVersion
}
android { android {
compileSdkVersion flutter.compileSdkVersion compileSdkVersion flutter.compileSdkVersion
...@@ -49,8 +39,8 @@ android { ...@@ -49,8 +39,8 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.image_list" applicationId "com.example.image_list"
minSdkVersion flutterMinSdkVersion minSdkVersion flutter.minSdkVersion
targetSdkVersion flutterTargetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
} }
......
...@@ -28,16 +28,6 @@ if (flutterVersionName == null) { ...@@ -28,16 +28,6 @@ if (flutterVersionName == null) {
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def flutterMinSdkVersion = localProperties.getProperty('flutter.minSdkVersion')
if (flutterMinSdkVersion == null) {
flutterMinSdkVersion = flutter.minSdkVersion
}
def flutterTargetSdkVersion = localProperties.getProperty('flutter.targetSdkVersion')
if (flutterTargetSdkVersion == null) {
flutterTargetSdkVersion = flutter.targetSdkVersion
}
android { android {
compileSdkVersion flutter.compileSdkVersion compileSdkVersion flutter.compileSdkVersion
...@@ -48,8 +38,8 @@ android { ...@@ -48,8 +38,8 @@ android {
defaultConfig { defaultConfig {
applicationId "io.flutter.examples.layers" applicationId "io.flutter.examples.layers"
minSdkVersion flutterMinSdkVersion minSdkVersion flutter.minSdkVersion
targetSdkVersion flutterTargetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
} }
......
...@@ -28,16 +28,6 @@ if (flutterVersionName == null) { ...@@ -28,16 +28,6 @@ if (flutterVersionName == null) {
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def flutterMinSdkVersion = localProperties.getProperty('flutter.minSdkVersion')
if (flutterMinSdkVersion == null) {
flutterMinSdkVersion = flutter.minSdkVersion
}
def flutterTargetSdkVersion = localProperties.getProperty('flutter.targetSdkVersion')
if (flutterTargetSdkVersion == null) {
flutterTargetSdkVersion = flutter.targetSdkVersion
}
android { android {
compileSdkVersion flutter.compileSdkVersion compileSdkVersion flutter.compileSdkVersion
...@@ -48,8 +38,8 @@ android { ...@@ -48,8 +38,8 @@ android {
defaultConfig { defaultConfig {
applicationId "io.flutter.examples.platform_channel" applicationId "io.flutter.examples.platform_channel"
minSdkVersion flutterMinSdkVersion minSdkVersion flutter.minSdkVersion
targetSdkVersion flutterTargetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
......
...@@ -28,16 +28,6 @@ if (flutterVersionName == null) { ...@@ -28,16 +28,6 @@ if (flutterVersionName == null) {
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def flutterMinSdkVersion = localProperties.getProperty('flutter.minSdkVersion')
if (flutterMinSdkVersion == null) {
flutterMinSdkVersion = flutter.minSdkVersion
}
def flutterTargetSdkVersion = localProperties.getProperty('flutter.targetSdkVersion')
if (flutterTargetSdkVersion == null) {
flutterTargetSdkVersion = flutter.targetSdkVersion
}
android { android {
compileSdkVersion flutter.compileSdkVersion compileSdkVersion flutter.compileSdkVersion
...@@ -48,8 +38,8 @@ android { ...@@ -48,8 +38,8 @@ android {
defaultConfig { defaultConfig {
applicationId "io.flutter.examples.platform_view" applicationId "io.flutter.examples.platform_view"
minSdkVersion flutterMinSdkVersion minSdkVersion flutter.minSdkVersion
targetSdkVersion flutterTargetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
} }
......
...@@ -97,7 +97,7 @@ variable to be set. The full invocation to run everything might ...@@ -97,7 +97,7 @@ variable to be set. The full invocation to run everything might
therefore look something like: therefore look something like:
```shell ```shell
$ export FLUTTER_ROOT=~/path/to/flutter-sdk $ FLUTTER_ROOT=~/path/to/flutter-sdk
$ flutter test --concurrency 1 $ flutter test --concurrency 1
``` ```
......
...@@ -139,11 +139,6 @@ class FlutterPlugin implements Plugin<Project> { ...@@ -139,11 +139,6 @@ class FlutterPlugin implements Plugin<Project> {
private Properties localProperties private Properties localProperties
private String engineVersion private String engineVersion
/**
* Flutter Docs Website references URLs for help messages.
*/
private final String kWebsiteDeploymentAndroidBuildConfig = 'https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration'
@Override @Override
void apply(Project project) { void apply(Project project) {
this.project = project this.project = project
...@@ -305,7 +300,7 @@ class FlutterPlugin implements Plugin<Project> { ...@@ -305,7 +300,7 @@ class FlutterPlugin implements Plugin<Project> {
localEngine = engineOut.name localEngine = engineOut.name
localEngineSrcPath = engineOut.parentFile.parent localEngineSrcPath = engineOut.parentFile.parent
} }
project.android.buildTypes.all this.&addFlutterDependencies project.android.buildTypes.all this.&addFlutterDependencies
} }
private static Boolean shouldShrinkResources(Project project) { private static Boolean shouldShrinkResources(Project project) {
...@@ -414,33 +409,9 @@ class FlutterPlugin implements Plugin<Project> { ...@@ -414,33 +409,9 @@ class FlutterPlugin implements Plugin<Project> {
// Wait until the Android plugin loaded. // Wait until the Android plugin loaded.
pluginProject.afterEvaluate { pluginProject.afterEvaluate {
Boolean showBuildConfigurationMessage = false
// Checks if there is a mismatch between the plugin compileSdkVersion and the project compileSdkVersion.
if (pluginProject.android.compileSdkVersion > project.android.compileSdkVersion) { if (pluginProject.android.compileSdkVersion > project.android.compileSdkVersion) {
project.logger.quiet("Warning: The plugin ${pluginName} requires Android SDK version ${pluginProject.android.compileSdkVersion.substring(8)}.") project.logger.quiet("Warning: The plugin ${pluginName} requires Android SDK version ${pluginProject.android.compileSdkVersion.substring(8)}.")
showBuildConfigurationMessage = true
}
// Checks if there is a mismatch between the plugin minSdkVersion and the project minSdkVersion.
if(pluginProject.android.defaultConfig?.minSdkVersion?.apiLevel > project.android.defaultConfig?.minSdkVersion?.apiLevel) {
project.logger.quiet("Warning: The plugin ${pluginName} requires minSdkVersion ${pluginProject.android.defaultConfig?.minSdkVersion?.apiLevel}.")
showBuildConfigurationMessage = true
if (!resolveProperty("flutter.minSdkVersion", null)) {
project.logger.quiet("flutter.minSdkVersion not found on ${project.projectDir.parentFile}${File.separator}local.properties, consider adding it. Using ${project.android.defaultConfig.minSdkVersion.apiLevel} as default.")
}
// Additionally checks if the targetSdkVersion was set.
if (!resolveProperty("flutter.targetSdkVersion", null)) {
project.logger.quiet("flutter.targetSdkVersion not found on ${project.projectDir.parentFile}${File.separator}local.properties, consider adding it. Using ${project.android.defaultConfig.targetSdkVersion.apiLevel} as default.")
}
} }
if (showBuildConfigurationMessage) {
project.logger.quiet("For more information about build configuration, see $kWebsiteDeploymentAndroidBuildConfig.")
}
project.android.buildTypes.all addEmbeddingDependencyToPlugin project.android.buildTypes.all addEmbeddingDependencyToPlugin
} }
} }
......
...@@ -390,24 +390,27 @@ final GradleHandledError minSdkVersion = GradleHandledError( ...@@ -390,24 +390,27 @@ final GradleHandledError minSdkVersion = GradleHandledError(
required bool usesAndroidX, required bool usesAndroidX,
required bool multidexEnabled, required bool multidexEnabled,
}) async { }) async {
final File localPropertiesFile = project.directory final File gradleFile = project.directory
.childDirectory('android') .childDirectory('android')
.childFile('local.properties'); .childDirectory('app')
.childFile('build.gradle');
final Match? minSdkVersionMatch = _minSdkVersionPattern.firstMatch(line); final Match? minSdkVersionMatch = _minSdkVersionPattern.firstMatch(line);
assert(minSdkVersionMatch?.groupCount == 3); assert(minSdkVersionMatch?.groupCount == 3);
final String textInBold = globals.logger.terminal.bolden( final String textInBold = globals.logger.terminal.bolden(
'Fix this issue by adding the following to the file ${localPropertiesFile.path}:\n' 'Fix this issue by adding the following to the file ${gradleFile.path}:\n'
'\n' 'android {\n'
'flutter.minSdkVersion=${minSdkVersionMatch?.group(2)}\n' ' defaultConfig {\n'
' minSdkVersion ${minSdkVersionMatch?.group(2)}\n'
' }\n'
'}\n'
); );
globals.printBox( globals.printBox(
'The plugin ${minSdkVersionMatch?.group(3)} requires a higher Android SDK version.\n' 'The plugin ${minSdkVersionMatch?.group(3)} requires a higher Android SDK version.\n'
'$textInBold\n' '$textInBold\n'
"Note that your app won't be available to users running Android SDKs below ${minSdkVersionMatch?.group(2)}.\n" "Note that your app won't be available to users running Android SDKs below ${minSdkVersionMatch?.group(2)}.\n"
'Alternatively, try to find a version of this plugin that supports these lower versions of the Android SDK.\n' 'Alternatively, try to find a version of this plugin that supports these lower versions of the Android SDK.',
'For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration',
title: _boxTitle, title: _boxTitle,
); );
return GradleBuildStatus.exit; return GradleBuildStatus.exit;
...@@ -515,8 +518,8 @@ final GradleHandledError minCompileSdkVersionHandler = GradleHandledError( ...@@ -515,8 +518,8 @@ final GradleHandledError minCompileSdkVersionHandler = GradleHandledError(
required bool usesAndroidX, required bool usesAndroidX,
required bool multidexEnabled, required bool multidexEnabled,
}) async { }) async {
final Match? minCompileSdkVersionMatch = _minCompileSdkVersionPattern.firstMatch(line); final Match? minSdkVersionMatch = _minCompileSdkVersionPattern.firstMatch(line);
assert(minCompileSdkVersionMatch?.groupCount == 1); assert(minSdkVersionMatch?.groupCount == 1);
final File gradleFile = project.directory final File gradleFile = project.directory
.childDirectory('android') .childDirectory('android')
...@@ -526,7 +529,7 @@ final GradleHandledError minCompileSdkVersionHandler = GradleHandledError( ...@@ -526,7 +529,7 @@ final GradleHandledError minCompileSdkVersionHandler = GradleHandledError(
'${globals.logger.terminal.warningMark} Your project requires a higher compileSdkVersion.\n' '${globals.logger.terminal.warningMark} Your project requires a higher compileSdkVersion.\n'
'Fix this issue by bumping the compileSdkVersion in ${gradleFile.path}:\n' 'Fix this issue by bumping the compileSdkVersion in ${gradleFile.path}:\n'
'android {\n' 'android {\n'
' compileSdkVersion ${minCompileSdkVersionMatch?.group(1)}\n' ' compileSdkVersion ${minSdkVersionMatch?.group(1)}\n'
'}', '}',
title: _boxTitle, title: _boxTitle,
); );
......
...@@ -25,16 +25,6 @@ apply plugin: 'com.android.application' ...@@ -25,16 +25,6 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def flutterMinSdkVersion = localProperties.getProperty('flutter.minSdkVersion')
if (flutterMinSdkVersion == null) {
flutterMinSdkVersion = flutter.minSdkVersion
}
def flutterTargetSdkVersion = localProperties.getProperty('flutter.targetSdkVersion')
if (flutterTargetSdkVersion == null) {
flutterTargetSdkVersion = flutter.targetSdkVersion
}
android { android {
compileSdkVersion flutter.compileSdkVersion compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion ndkVersion flutter.ndkVersion
...@@ -47,8 +37,8 @@ android { ...@@ -47,8 +37,8 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "{{androidIdentifier}}" applicationId "{{androidIdentifier}}"
minSdkVersion flutterMinSdkVersion minSdkVersion flutter.minSdkVersion
targetSdkVersion flutterTargetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
} }
......
...@@ -25,16 +25,6 @@ apply plugin: 'com.android.application' ...@@ -25,16 +25,6 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def flutterMinSdkVersion = localProperties.getProperty('flutter.minSdkVersion')
if (flutterMinSdkVersion == null) {
flutterMinSdkVersion = flutter.minSdkVersion
}
def flutterTargetSdkVersion = localProperties.getProperty('flutter.targetSdkVersion')
if (flutterTargetSdkVersion == null) {
flutterTargetSdkVersion = flutter.targetSdkVersion
}
android { android {
compileSdkVersion flutter.compileSdkVersion compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion ndkVersion flutter.ndkVersion
...@@ -55,8 +45,8 @@ android { ...@@ -55,8 +45,8 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "{{androidIdentifier}}" applicationId "{{androidIdentifier}}"
minSdkVersion flutterMinSdkVersion minSdkVersion flutter.minSdkVersion
targetSdkVersion flutterTargetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
} }
......
...@@ -26,16 +26,6 @@ if (flutterVersionName == null) { ...@@ -26,16 +26,6 @@ if (flutterVersionName == null) {
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def flutterMinSdkVersion = localProperties.getProperty('flutter.minSdkVersion')
if (flutterMinSdkVersion == null) {
flutterMinSdkVersion = flutter.minSdkVersion
}
def flutterTargetSdkVersion = localProperties.getProperty('flutter.targetSdkVersion')
if (flutterTargetSdkVersion == null) {
flutterTargetSdkVersion = flutter.targetSdkVersion
}
group '{{androidIdentifier}}' group '{{androidIdentifier}}'
version '1.0' version '1.0'
...@@ -49,8 +39,8 @@ android { ...@@ -49,8 +39,8 @@ android {
} }
defaultConfig { defaultConfig {
minSdkVersion flutterMinSdkVersion minSdkVersion flutter.minSdkVersion
targetSdkVersion flutterTargetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
} }
......
...@@ -2479,7 +2479,7 @@ void main() { ...@@ -2479,7 +2479,7 @@ void main() {
expect(env['flutter'].allows(Version(2, 4, 9)), false); expect(env['flutter'].allows(Version(2, 4, 9)), false);
}); });
testUsingContext('default app uses local properties or flutter default versions', () async { testUsingContext('default app uses flutter default versions', () async {
Cache.flutterRoot = '../..'; Cache.flutterRoot = '../..';
final CreateCommand command = CreateCommand(); final CreateCommand command = CreateCommand();
...@@ -2493,8 +2493,7 @@ void main() { ...@@ -2493,8 +2493,7 @@ void main() {
expect(buildContent.contains('compileSdkVersion flutter.compileSdkVersion'), true); expect(buildContent.contains('compileSdkVersion flutter.compileSdkVersion'), true);
expect(buildContent.contains('ndkVersion flutter.ndkVersion'), true); expect(buildContent.contains('ndkVersion flutter.ndkVersion'), true);
expect(buildContent.contains('minSdkVersion flutterMinSdkVersion'), true); expect(buildContent.contains('targetSdkVersion flutter.targetSdkVersion'), true);
expect(buildContent.contains('targetSdkVersion flutterTargetSdkVersion'), true);
}); });
testUsingContext('Linux plugins handle partially camel-case project names correctly', () async { testUsingContext('Linux plugins handle partially camel-case project names correctly', () async {
......
...@@ -770,15 +770,16 @@ assembleProfile ...@@ -770,15 +770,16 @@ assembleProfile
'\n' '\n'
'┌─ Flutter Fix ─────────────────────────────────────────────────────────────────────────────────┐\n' '┌─ Flutter Fix ─────────────────────────────────────────────────────────────────────────────────┐\n'
'│ The plugin webview_flutter requires a higher Android SDK version. │\n' '│ The plugin webview_flutter requires a higher Android SDK version. │\n'
'│ Fix this issue by adding the following to the file /android/local.properties: │\n' '│ Fix this issue by adding the following to the file /android/app/build.gradle: │\n'
'│ │\n' '│ android { │\n'
'│ flutter.minSdkVersion=19 │\n' '│ defaultConfig { │\n'
'│ minSdkVersion 19 │\n'
'│ } │\n'
'│ } │\n'
'│ │\n' '│ │\n'
"│ Note that your app won't be available to users running Android SDKs below 19. │\n" "│ Note that your app won't be available to users running Android SDKs below 19. │\n"
'│ Alternatively, try to find a version of this plugin that supports these lower versions of the │\n' '│ Alternatively, try to find a version of this plugin that supports these lower versions of the │\n'
'│ Android SDK. │\n' '│ Android SDK. │\n'
'│ For more information, see: │\n'
'│ https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration │\n'
'└───────────────────────────────────────────────────────────────────────────────────────────────┘\n' '└───────────────────────────────────────────────────────────────────────────────────────────────┘\n'
) )
); );
......
...@@ -28,16 +28,6 @@ if (flutterVersionName == null) { ...@@ -28,16 +28,6 @@ if (flutterVersionName == null) {
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def flutterMinSdkVersion = localProperties.getProperty('flutter.minSdkVersion')
if (flutterMinSdkVersion == null) {
flutterMinSdkVersion = flutter.minSdkVersion
}
def flutterTargetSdkVersion = localProperties.getProperty('flutter.targetSdkVersion')
if (flutterTargetSdkVersion == null) {
flutterTargetSdkVersion = flutter.targetSdkVersion
}
android { android {
compileSdkVersion flutter.compileSdkVersion compileSdkVersion flutter.compileSdkVersion
...@@ -49,8 +39,8 @@ android { ...@@ -49,8 +39,8 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.integration_test_example" applicationId "com.example.integration_test_example"
minSdkVersion flutterMinSdkVersion minSdkVersion flutter.minSdkVersion
targetSdkVersion flutterTargetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment