Upgrade Android SDK to 33 Tiramisu (flutter/engine#35415)

This commit is contained in:
Gary Qian
2022-08-18 17:26:52 -07:00
committed by GitHub
parent fd9fdbf6b8
commit b30aeada6d
11 changed files with 40 additions and 25 deletions

4
DEPS
View File

@@ -102,7 +102,7 @@ allowed_hosts = [
]
deps = {
'src': 'https://github.com/flutter/buildroot.git' + '@' + '4dfab138e7dcc4d174ad0032c102d0f9055ba904',
'src': 'https://github.com/flutter/buildroot.git' + '@' + '25e5fd0200ff0bbf4761f3e73cab67a16e928955',
# Fuchsia compatibility
#
@@ -546,7 +546,7 @@ deps = {
'packages': [
{
'package': 'flutter/android/sdk/all/${{platform}}',
'version': 'version:32v1'
'version': 'version:33v6'
}
],
'condition': 'download_android_deps',

View File

@@ -23,7 +23,10 @@ public class LocalizationPlugin {
@NonNull private final LocalizationChannel localizationChannel;
@NonNull private final Context context;
@SuppressLint("AppBundleLocaleChanges") // This is optionally turned on by apps.
@SuppressLint({
"AppBundleLocaleChanges",
"DiscouragedApi"
}) // This is optionally turned on by apps.
@VisibleForTesting
final LocalizationChannel.LocalizationMessageHandler localizationMessageHandler =
new LocalizationChannel.LocalizationMessageHandler() {

View File

@@ -33,7 +33,7 @@ println "AVAILABLE PROCESSORS: $availableProcessors"
println "=========================================="
android {
compileSdkVersion 32
compileSdkVersion 33
defaultConfig {
minSdkVersion 16

View File

@@ -16,8 +16,8 @@ android {
// The others are irrelevant for a test application.
disable 'UnpackedNativeCode','MissingApplicationIcon','GoogleAppIndexingApiWarning','GoogleAppIndexingWarning','GradleDependency','NewerVersionAvailable'
}
buildToolsVersion = '33.0.0-rc4'
compileSdkVersion 32
buildToolsVersion = '33.0.0'
compileSdkVersion 33
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
@@ -25,7 +25,7 @@ android {
defaultConfig {
applicationId 'dev.flutter.android_background_image'
minSdkVersion 16
targetSdkVersion 32
targetSdkVersion 33
versionCode 1
versionName '1.0'
}

View File

@@ -18,8 +18,8 @@ android {
// The others are irrelevant for a test application.
disable 'UnpackedNativeCode','MissingApplicationIcon','GoogleAppIndexingApiWarning','GoogleAppIndexingWarning','GradleDependency','NewerVersionAvailable','Registered'
}
buildToolsVersion = '33.0.0-rc4'
compileSdkVersion 32
buildToolsVersion = '33.0.0'
compileSdkVersion 33
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
@@ -27,7 +27,7 @@ android {
defaultConfig {
applicationId 'dev.flutter.scenarios'
minSdkVersion 18
targetSdkVersion 32
targetSdkVersion 33
versionCode 1
versionName '1.0'
testInstrumentationRunner 'dev.flutter.TestRunner'

View File

@@ -73,7 +73,7 @@ Future<int> runLint(ArgParser argParser, ArgResults argResults) async {
<!-- WILL AUTOMATICALLY FIND ALL .java FILES AND INCLUDE THEM HERE -->
<project>
<sdk dir="${androidSdkDir.path}" />
<module name="FlutterEngine" android="true" library="true" compile-sdk-version="android-S">
<module name="FlutterEngine" android="true" library="true" compile-sdk-version="android-T">
<manifest file="${path.join(androidDir.path, 'AndroidManifest.xml')}" />
''');
for (final FileSystemEntity entity in androidDir.listSync(recursive: true)) {
@@ -95,7 +95,7 @@ Future<int> runLint(ArgParser argParser, ArgResults argResults) async {
final List<String> lintArgs = <String>[
path.join(androidSdkDir.path, 'cmdline-tools', 'latest', 'bin', 'lint'),
'--project', projectXmlPath,
'--compile-sdk-version', '31',
'--compile-sdk-version', '33',
'--showall',
'--exitcode', // Set non-zero exit code on errors
'-Wall',

View File

@@ -2,7 +2,7 @@
<!-- WILL AUTOMATICALLY FIND ALL .java FILES AND INCLUDE THEM HERE -->
<project>
<sdk dir="../../../third_party/android_tools/sdk" />
<module name="FlutterEngine" android="true" library="true" compile-sdk-version="android-S">
<module name="FlutterEngine" android="true" library="true" compile-sdk-version="android-T">
<manifest file="../../../flutter/shell/platform/android/AndroidManifest.xml" />
<src file="../../../flutter/shell/platform/android/test/io/flutter/util/KeyCodes.java" />
<src file="../../../flutter/shell/platform/android/test/io/flutter/util/FakeKeyEvent.java" />

View File

@@ -3,11 +3,14 @@
# This script requires depot_tools to be on path.
print_usage () {
echo "Usage: create_cipd_united_package.sh <VERSION_TAG> [PATH_TO_SDK_DIR]"
echo " where:"
echo " - VERSION_TAG is the tag of the cipd packages, e.g. 28r6 or 31v1"
echo " - PATH_TO_SDK_DIR is the path to the sdk folder. If omitted, this defaults to"
echo "Usage:"
echo " ./create_cipd_united_package.sh <VERSION_TAG> [PATH_TO_SDK_DIR]"
echo " Downloads, packages, and uploads Android SDK packages where:"
echo " - VERSION_TAG is the tag of the cipd packages, e.g. 28r6 or 31v1"
echo " - PATH_TO_SDK_DIR is the path to the sdk folder. If omitted, this defaults to"
echo " your ANDROID_SDK_ROOT environment variable."
echo " ./create_cipd_united_package.sh list"
echo " Lists the available packages for use in 'packages.txt'"
echo ""
echo "This script downloads the packages specified in packages.txt and uploads"
echo "them to CIPD for linux, mac, and windows."
@@ -69,10 +72,16 @@ while [ ! -f "$sdkmanager_path" ]; do
((i++))
done
# list available packages
if [ $version_tag == "list" ]; then
$sdkmanager_path --list --include_obsolete
exit 0
fi
# We create a new temporary SDK directory because the default working directory
# tends to not update/re-download packages if they are being used. This guarantees
# a clean install of Android SDK.
temp_dir=`mktemp -d -t android_sdk`
temp_dir=`mktemp -d -t android_sdkXXXX`
for platform in "${platforms[@]}"; do
sdk_root="$temp_dir/sdk_$platform"
@@ -99,8 +108,11 @@ for platform in "${platforms[@]}"; do
done
# Special treatment for NDK to move to expected directory.
mv $upload_dir/sdk/ndk-bundle $upload_dir
mv $upload_dir/ndk-bundle $upload_dir/ndk
mv $upload_dir/sdk/ndk $upload_dir/ndk-bundle
ndk_sub_paths=`find $upload_dir/ndk-bundle -maxdepth 1 -type d`
ndk_sub_paths_arr=($ndk_sub_paths)
mv ${ndk_sub_paths_arr[1]} $upload_dir/ndk
rm -rf $upload_dir/ndk-bundle
# Accept all licenses to ensure they are generated and uploaded.
yes "y" | $sdkmanager_path --licenses --sdk_root=$sdk_root

View File

@@ -1,6 +1,6 @@
platforms;android-32:platforms
platforms;android-33:platforms
cmdline-tools;latest:cmdline-tools
build-tools;33.0.0-rc4:build-tools
build-tools;33.0.0:build-tools
platform-tools:platform-tools
tools:tools
ndk-bundle:ndk-bundle
ndk;22.1.7171670:ndk

View File

@@ -29,7 +29,7 @@ allprojects {
apply plugin: "com.android.application"
android {
compileSdkVersion 32
compileSdkVersion 33
}
configurations {

View File

@@ -58,7 +58,7 @@ def main():
classpath = [
args.android_source_root,
os.path.join(
args.third_party, 'android_tools/sdk/platforms/android-32/android.jar'
args.third_party, 'android_tools/sdk/platforms/android-33/android.jar'
),
os.path.join(
args.third_party, 'android_embedding_dependencies', 'lib', '*'