Unverified Commit a2e5e074 authored by xster's avatar xster Committed by GitHub

Move Android doctor SDK check to 29 and Cirrus images to 30 (#63517)

parent 9e86e9fb
......@@ -261,7 +261,7 @@ task:
# WINDOWS SHARDS
task:
windows_container:
image: cirrusci/android-sdk:28-windowsservercore-2019
image: cirrusci/android-sdk:30-windowsservercore-2019
os_version: 2019
cpu: $CPU
memory: $MEMORY
......
......@@ -10,7 +10,7 @@
# for performing pushes to production, and so this image is quite a bit larger
# than strictly needed for just building Flutter apps.
# Last manual update 2020-08-05 (changing this comment will re-build image)
# Last manual update 2020-08-11 (changing this comment will re-build image)
# Note: updating past stretch (Debian 9) will bump Java past version 8,
# which will break the Android SDK.
......@@ -80,7 +80,7 @@ RUN unzip -q -d "${ANDROID_TOOLS_ROOT}" "${ANDROID_SDK_ARCHIVE}"
# (it prints install progress WAY too often).
RUN yes "y" | "${ANDROID_TOOLS_ROOT}/tools/bin/sdkmanager" "tools" > /dev/null
RUN yes "y" | "${ANDROID_TOOLS_ROOT}/tools/bin/sdkmanager" "build-tools;28.0.3" > /dev/null
RUN yes "y" | "${ANDROID_TOOLS_ROOT}/tools/bin/sdkmanager" "platforms;android-28" > /dev/null
RUN yes "y" | "${ANDROID_TOOLS_ROOT}/tools/bin/sdkmanager" "platforms;android-30" > /dev/null
RUN yes "y" | "${ANDROID_TOOLS_ROOT}/tools/bin/sdkmanager" "platform-tools" > /dev/null
RUN yes "y" | "${ANDROID_TOOLS_ROOT}/tools/bin/sdkmanager" "extras;android;m2repository" > /dev/null
RUN yes "y" | "${ANDROID_TOOLS_ROOT}/tools/bin/sdkmanager" "extras;google;m2repository" > /dev/null
......
......@@ -5,7 +5,7 @@
<content url="file://$MODULE_DIR$/android">
<sourceFolder url="file://$MODULE_DIR$/android/app/src/main/java" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
<orderEntry type="jdk" jdkName="Android API 29 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Flutter for Android" level="project" />
</component>
......
......@@ -5,7 +5,7 @@
<content url="file://$MODULE_DIR$/android">
<sourceFolder url="file://$MODULE_DIR$/android/app/src/main/java" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
<orderEntry type="jdk" jdkName="Android API 29 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Flutter for Android" level="project" />
</component>
......
......@@ -5,7 +5,7 @@
<content url="file://$MODULE_DIR$/android">
<sourceFolder url="file://$MODULE_DIR$/android/app/src/main/java" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
<orderEntry type="jdk" jdkName="Android API 29 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Flutter for Android" level="project" />
</component>
......
......@@ -5,7 +5,7 @@
<content url="file://$MODULE_DIR$/android">
<sourceFolder url="file://$MODULE_DIR$/android/app/src/main/java" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
<orderEntry type="jdk" jdkName="Android API 29 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Flutter for Android" level="project" />
</component>
......
......@@ -19,7 +19,7 @@
<sourceFolder url="file://$MODULE_DIR$/android/app/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/android/gen" isTestSource="false" generated="true" />
</content>
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
<orderEntry type="jdk" jdkName="Android API 29 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Flutter for Android" level="project" />
</component>
......
......@@ -5,7 +5,7 @@
<content url="file://$MODULE_DIR$/android">
<sourceFolder url="file://$MODULE_DIR$/android/app/src/main/java" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
<orderEntry type="jdk" jdkName="Android API 29 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Flutter for Android" level="project" />
</component>
......
......@@ -22,9 +22,6 @@ const String kAndroidSdkRoot = 'ANDROID_SDK_ROOT';
final RegExp _numberedAndroidPlatformRe = RegExp(r'^android-([0-9]+)$');
final RegExp _sdkVersionRe = RegExp(r'^ro.build.version.sdk=([0-9]+)$');
/// The minimum Android SDK version we support.
const int minimumAndroidSdkVersion = 25;
/// Locate ADB. Prefer to use one from an Android SDK, if we can locate that.
/// This should be used over accessing androidSdk.adbPath directly because it
/// will work for those users who have Android Platform Tools installed but
......
......@@ -25,7 +25,7 @@ import '../globals.dart' as globals;
import 'android_sdk.dart';
import 'android_studio.dart';
const int kAndroidSdkMinVersion = 28;
const int kAndroidSdkMinVersion = 29;
final Version kAndroidJavaMinVersion = Version(1, 8, 0);
final Version kAndroidSdkBuildToolsMinVersion = Version(28, 0, 3);
......@@ -178,7 +178,7 @@ class AndroidValidator extends DoctorValidator {
String sdkVersionText;
if (_androidSdk.latestVersion != null) {
if (_androidSdk.latestVersion.sdkLevel < 28 || _androidSdk.latestVersion.buildToolsVersion < kAndroidSdkBuildToolsMinVersion) {
if (_androidSdk.latestVersion.sdkLevel < kAndroidSdkMinVersion || _androidSdk.latestVersion.buildToolsVersion < kAndroidSdkBuildToolsMinVersion) {
messages.add(ValidationMessage.error(
_userMessages.androidSdkBuildToolsOutdated(
_androidSdk.sdkManagerPath,
......
......@@ -9,7 +9,7 @@ import 'package:uuid/uuid.dart';
import 'package:yaml/yaml.dart';
import '../android/android.dart' as android_common;
import '../android/android_sdk.dart' as android_sdk;
import '../android/android_workflow.dart';
import '../android/gradle_utils.dart' as gradle;
import '../base/common.dart';
import '../base/context.dart';
......@@ -764,7 +764,7 @@ https://flutter.dev/docs/development/packages-and-plugins/developing-packages#pl
'description': projectDescription,
'dartSdk': '$flutterRoot/bin/cache/dart-sdk',
'androidMinApiLevel': android_common.minApiLevel,
'androidSdkVersion': android_sdk.minimumAndroidSdkVersion,
'androidSdkVersion': kAndroidSdkMinVersion,
'withDriverTest': renderDriverTest,
'pluginClass': pluginClass,
'pluginClassSnakeCase': pluginClassSnakeCase,
......
......@@ -2007,6 +2007,24 @@ void main() {
expect(env['flutter'].allows(Version(1, 19, 0)), false);
});
testUsingContext('default app uses Android sdk 29', () async {
Cache.flutterRoot = '../..';
when(mockFlutterVersion.frameworkRevision).thenReturn(frameworkRevision);
when(mockFlutterVersion.channel).thenReturn(frameworkChannel);
final CreateCommand command = CreateCommand();
final CommandRunner<void> runner = createTestCommandRunner(command);
await runner.run(<String>['create', '--no-pub', projectDir.path]);
expect(globals.fs.isFileSync('${projectDir.path}/android/app/build.gradle'), true);
final String buildContent = await globals.fs.file(projectDir.path + '/android/app/build.gradle').readAsString();
expect(buildContent.contains('compileSdkVersion 29'), true);
expect(buildContent.contains('targetSdkVersion 29'), true);
});
}
Future<void> _createProject(
......
......@@ -219,7 +219,7 @@ void main() {
when(sdk.platformToolsAvailable).thenReturn(true);
// Test with invalid SDK and build tools
when(mockSdkVersion.sdkLevel).thenReturn(26);
when(mockSdkVersion.sdkLevel).thenReturn(28);
when(mockSdkVersion.buildToolsVersion).thenReturn(Version(26, 0, 3));
when(sdk.sdkManagerPath).thenReturn('/foo/bar/sdkmanager');
when(sdk.latestVersion).thenReturn(mockSdkVersion);
......@@ -250,7 +250,7 @@ void main() {
);
// Test with valid SDK but invalid build tools
when(mockSdkVersion.sdkLevel).thenReturn(28);
when(mockSdkVersion.sdkLevel).thenReturn(29);
when(mockSdkVersion.buildToolsVersion).thenReturn(Version(28, 0, 2));
validationResult = await androidValidator.validate();
......@@ -279,7 +279,7 @@ void main() {
// Mock a pass through scenario to reach _checkJavaVersion()
when(sdk.licensesAvailable).thenReturn(true);
when(sdk.platformToolsAvailable).thenReturn(true);
when(mockSdkVersion.sdkLevel).thenReturn(28);
when(mockSdkVersion.sdkLevel).thenReturn(29);
when(mockSdkVersion.buildToolsVersion).thenReturn(Version(28, 0, 3));
when(sdk.sdkManagerPath).thenReturn('/foo/bar/sdkmanager');
when(sdk.latestVersion).thenReturn(mockSdkVersion);
......
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