- 29 Jan, 2024 2 commits
-
-
Camille Simon authored
This reverts commit f5ac225c, i.e. https://github.com/flutter/flutter/pull/137115. This is a continuation of https://github.com/flutter/flutter/pull/142266 that was redone based on feedback to make this easier to revert in the future. The exact steps I took to create this revert: 1. Revert commit noted above 2. Fix merge conflicts, that notably involved reverting some changes in https://github.com/flutter/flutter/pull/140744 ~and https://github.com/flutter/flutter/pull/141417~ (fixed my merge to avoid the second PR from being affected) 3. Delete `packages/flutter_tools/test/integration.shard/android_plugin_skip_unsupported_test.dart` as this was added in the commit noted above cc @Gustl22 since I couldn't tag as a reviewer
-
Zachary Anderson authored
This PR increases Android's `minSdkVersion` to 21. There are two changes in this PR aside from simply increasing the number from 19 to 21 everywhere. First, tests using `flutter_gallery` fail without updating the lockfiles. The changes in the PR are the results of running `dev/tools/bin/generate_gradle_lockfiles.dart` on that app. Second, from [here](https://developer.android.com/build/multidex#mdex-pre-l): > if your minSdkVersion is 21 or higher, multidex is enabled by default and you don't need the multidex library. As a result, the `multidex` option everywhere is obsolete. This PR removes all logic and tests related to that option that I could find. `Google testing` and `customer_tests` pass on this PR, so it seems like this won't be too breaking if it is at all. If needed I'll give this some time to bake in the framework before landing the flutter/engine PRs. Context: https://github.com/flutter/flutter/issues/138117, https://github.com/flutter/flutter/issues/141277, b/319373605
-
- 26 Jan, 2024 1 commit
-
-
Bartek Pacia authored
This PR fixes 2 small mistakes in `FlutterExtension`: - all fields must be `public` in order to be used in Gradle Kotlin DSL the same as in Gradle Groovy DSL - using `logger` instead of `project.logger` throws an error when executed This PR re-adds a subset of changes from #141541 which broke the tree and has been reverted.
-
- 23 Jan, 2024 1 commit
-
-
auto-submit[bot] authored
Reverts flutter/flutter#141541 Initiated by: yusuf-goog This change reverts the following previous change: Original Description: This PR introduces the first app in this repo that fully uses Gradle Kotlin DSL. It also fixes a bug I found in the process – fields of `FlutterExtensions` must be `public`.
-
- 22 Jan, 2024 1 commit
-
-
Bartek Pacia authored
This PR introduces the first app in this repo that fully uses Gradle Kotlin DSL. It also fixes a bug I found in the process â fields of `FlutterExtensions` must be `public`.
-
- 19 Jan, 2024 1 commit
-
-
Reid Baker authored
packages Roller breakage https://ci.chromium.org/ui/p/flutter/builders/try/Linux_android%20android_build_all_packages%20master/5504/overview Fixes flutter/flutter/issues/141897 ``` FAILURE: Build failed with an exception. * Where: Script '/b/s/w/ir/x/w/flutter/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy' line: 168 * What went wrong: Could not compile script '/b/s/w/ir/x/w/flutter/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy'. > startup failed: script '/b/s/w/ir/x/w/flutter/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy': 168: primitive type parameters not allowed here; solution: use the corresponding wrapper type, such as Integer for int @ line 168, column 41. e static final Map<String, int> ABI_VERS ``` Covered by tests in packages.
-
- 18 Jan, 2024 1 commit
-
-
Reid Baker authored
Move static methods together. Fix property uses of duplicate strings. Add types wherever obvious Fix format depth Add whitespace to top and bottom of classes Ignore line length for file Ignore prefer single quote for file Ignore correction for getFoo used instead of foo Loosely related to flutter/flutter/issues/123934
-
- 16 Jan, 2024 2 commits
-
-
Anis Alibegić authored
I continued [my mission](https://github.com/flutter/flutter/pull/141431) to find as many typos as I could. This time it's a smaller set than before. There is no need for issues since it's a typo fix.
-
Reid Baker authored
- handle number format exceptions and strip rc information from version compare - add test that handles rc format part 2/n https://github.com/flutter/flutter/issues/138523 Helpfully pointed out by [asaarnak](https://github.com/asaarnak) https://github.com/flutter/flutter/pull/139325#issuecomment-1892554584
-
- 12 Jan, 2024 4 commits
-
-
Bartek Pacia authored
There's no issue for this PR. I can create one if requested. ## Summary This PR makes public fields of `FlutterExtension` non-static. The aim is to make migrating from Gradle Groovy DSL to Gradle Kotlin DSL easier for Flutter developers, because... ### Without this PR **android/app/build.gradle.kts** ```kotlin plugins { id "com.android.application" id "dev.flutter.flutter-gradle-plugin" } android { namespace = "io.flutter.examples.hello_world" compileSdk = FlutterExtension.compileSdkVersion defaultConfig { applicationId = "io.flutter.examples.hello_world" minSdk = FlutterExtension.minSdkVersion targetSdk = FlutterExtension.targetSdkVersion // ... } } // ... ``` Groovy and Java allow accessing static fields of a class through its instance, but Kotlin is being more "correct" and disallows that. ### With this PR Thanks to this PR, the user won't have to replace `flutter` with FlutterExtension in some places, thus decreasing possible confusion. ```kotlin plugins { id "com.android.application" id "dev.flutter.flutter-gradle-plugin" } android { namespace = "io.flutter.examples.hello_world" compileSdk = flutter.compileSdkVersion defaultConfig { applicationId = "io.flutter.examples.hello_world" minSdk = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion // ... } } // ... ```
-
hangyu authored
[deep link] Update a gradle task to add flag check and intent filter check to the AppLinkSettings (#141231) These check result is used in devtool deep link validation issue: https://github.com/flutter/flutter/issues/120408 ## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [Features we expect every widget to implement]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat
-
Bartek Pacia authored
This PR has no issue. I got this cool idea and decided to quickly try it out, and it works. ### Summary This will allow Flutter Developers to have less code in their Android Gradle buildscripts. ```diff plugins { id "com.android.application" id "dev.flutter.flutter-gradle-plugin" id "kotlin-android" } -def localProperties = new Properties() -def localPropertiesFile = rootProject.file("local.properties") -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader("UTF-8") { reader -> - localProperties.load(reader) - } -} - -def flutterVersionCode = localProperties.getProperty("flutter.versionCode") -if (flutterVersionCode == null) { - flutterVersionCode = "1" -} - -def flutterVersionName = localProperties.getProperty("flutter.versionName") -if (flutterVersionName == null) { - flutterVersionName = "1.0" -} - -def keystorePropertiesFile = rootProject.file("keystore.properties") -def keystoreProperties = new Properties() - keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) android { applicationId "pl.baftek.discoverrudy" minSdk 21 targetSdk 34 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName + versionCode flutter.versionCode() + versionName flutter.versionName() } ``` The boilerplate that loads 'local.properties' can live in Flutter Gradle Plugin. ### Concerns I was worried about lifecycle/ordering issues, so I tested it. To Flutter Gradle Plugin, I added: ```diff class FlutterPlugin implements Plugin<Project> { //... @Override void apply(Project project) { + project.logger.quiet("Start applying FGP") // ... } } ``` and to my `android/app/build.gradle` I added: ```diff android { + logger.quiet("Start evaluating android block") namespace "pl.bartekpacia.awesomeapp" compileSdk 34 defaultConfig { applicationId "pl.baftek.discoverrudy" minSdk 21 targetSdk 34 versionCode flutter.versionCode() versionName flutter.versionName() } ``` Gradle first applies the plugins (which sets versionCode and versionName on FlutterExtension), and then it executes the `android {}` extension block: ``` $ ./gradlew :app:assembleDebug > Configure project :app Start applying FGP Start evaluating android block BUILD SUCCESSFUL in 2s 383 actionable tasks: 10 executed, 373 up-to-date ``` So ordering is fine.
-
Bartek Pacia authored
This PR resolves #140548. It's based on my work in #118067.
-
- 09 Jan, 2024 1 commit
-
-
Daco Harkes authored
Support for FFI calls with @Native external functions through Native assets on Android add to app. This enables bundling native code without any build-system boilerplate code. For more info see: * https://github.com/flutter/flutter/issues/129757 ## Implementation details for Android add2app The `.so` files are bundled with the same mechanism that bundles `libapp.so`.
-
- 22 Dec, 2023 1 commit
-
-
Reid Baker authored
Following https://developer.android.com/build/migrate-to-kotlin-dsl 2/n Use double quotes instead of single quotes. Should be a no-op change. If you see a behavioral change please flag it.
-
- 21 Dec, 2023 1 commit
-
-
Gustl22 authored
Relands #97823 When the tool migrated to `.flutter-plugins-dependencies`, the Gradle plugin was never changed. Until now, the plugin had the heuristic that a plugin with a `android/build.gradle` file supported the Android platform. Also applies schema of `getPluginDependencies` to `getPluginList` which uses a `List` of Object instead of `Properties`. Fixes #97729 Cause of the error: https://github.com/flutter/flutter/blob/5f105a6ca7a5ac7b8bc9b241f4c2d86f4188cf5c/packages/flutter_tools/gradle/flutter.gradle#L421C25-L421C25 Fixes #98048 The deprecated line `include ":$name"` in `settings.gradle` (pluginEach) in old projects causes the `project.rootProject.findProject` to also find the plugin "project", so it is not failing on the `afterEvaluate` method. But the plugin shouldn't be included in the first place as it fails with `Could not find method implementation() for arguments` error in special cases. Related to #48918, see [_writeFlutterPluginsListLegacy](https://github.com/flutter/flutter/blob/27bc1cf61a5b54bf655062be63050123abb617e4/packages/flutter_tools/lib/src/flutter_plugins.dart#L248). Co-authored-by: Emmanuel Garcia <egarciad@google.com>
-
- 20 Dec, 2023 1 commit
-
-
Reid Baker authored
Following https://developer.android.com/build/migrate-to-kotlin-dsl 1/n Add parentheses to method calls Should be a no-op change. If you see a behavioral change please flag it.
-
- 14 Dec, 2023 2 commits
-
-
-
Andrew Kolos authored
Reland of https://github.com/flutter/flutter/pull/132985. Fixes the path to AssetManifest.bin in flavors_test_ios
-
- 13 Dec, 2023 1 commit
-
-
Reid Baker authored
- Use copy task that branches for 8.3 and above to avoid using project.exec in a dolast block. part 1/n for flutter/flutter/issues/138523 This PR does not test the 8.3 branch but instead builds the ability to write a branching gradle test. After fixing this project.exec action there I discovered a second that needs to be removed or migrated in order for the build to work. Related reading https://docs.gradle.org/8.0/userguide/configuration_cache.html#config_cache:requirements https://docs.gradle.org/current/javadoc/org/gradle/process/ExecOperations.html (not used but considered) https://docs.gradle.org/8.2/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:fileMode
-
- 12 Dec, 2023 1 commit
-
-
Gray Mackall authored
Fixes https://github.com/flutter/flutter/issues/124748 Based (heavily) off https://github.com/flutter/flutter/pull/104662
-
- 08 Dec, 2023 1 commit
-
-
auto-submit[bot] authored
Reverts flutter/flutter#132985 Initiated by: christopherfujino This change reverts the following previous change: Original Description: Provides support for conditional bundling of assets through the existing `--flavor` option for `flutter build` and `flutter run`. Closes https://github.com/flutter/flutter/issues/21682. Resolves https://github.com/flutter/flutter/issues/136092 ## Change Within the `assets` section pubspec.yaml, the user can now specify one or more `flavors` that an asset belongs to. Consider this example: ```yaml # pubspec.yaml flutter: assets: - assets/normal-asset.png - path: assets/vanilla/ice-cream.png flavors: - vanilla - path: assets/strawberry/ice-cream.png flavors: - strawberry ``` With this pubspec, * `flutter run --flavor vanilla` will not include `assets/strawberry/ice-cream.png` in the build output. * `flutter run --flavor strawberry` will not include `assets/vanilla/ice-cream.png`. * `flutter run` will only include `assets/normal-asset.png`. ## Open questions * Should this be supported for all platforms, or should this change be limited to ones with documented `--flavor` support (Android, iOS, and (implicitly) MacOS)? This PR currently only enables this feature for officially supported platforms. ## Design thoughts, what this PR does not do, etc. ### This does not provide an automatic mapping/resolution of asset keys/paths to others based on flavor at runtime. The implementation in this PR represents a simplest approach. Notably, it does not give Flutter the ability to dynamically choose an asset based on flavor using a single asset key. For example, one can't use `Image.asset('config.json')` to dynamically choose between different "flavors" of `config.json` (such as `dev-flavor/config.json` or `prod-flavor/config.json`). However, a user could always implement such a mechanism in their project or in a library by examining the flavor at runtime. ### When multiple entries affect the same file and 1) at least one of these entries have a `flavors` list provided and 2) these lists are not equivalent, we always consider the manifest to be ambiguous and will throw a `ToolExit`. <details> For example, these manifests would all be considered ambiguous: ```yaml assets: - assets/ - path: assets/vanilla.png flavors: - vanilla assets: - path: assets/vanilla/ flavors: - vanilla - path: assets/vanilla/cherry.png flavor: - cherry # Thinking towards the future where we might add glob/regex support and more conditions other than flavor: assets: - path: assets/vanilla/** flavors: - vanilla - path: assets/**/ios/** platforms: - ios # Ambiguous in the case of assets like "assets/vanilla/ios/icon.svg" since we # don't know if flavor `vanilla` and platform `ios` should be combined using or-logic or and-logic. ``` See [this review comment thread](https://github.com/flutter/flutter/pull/132985#discussion_r1381909942) for the full story on how I arrived at this decision. </details> ### This does not support Android's multidimensional flavors feature (in an intuitive way) <details> Conder this excerpt from a Flutter project's android/app/build.gradle file: ```groovy android { // ... flavorDimensions "mode", "api" productFlavors { free { dimension "mode" applicationIdSuffix ".free" } premium { dimension "mode" applicationIdSuffix ".premium" } minApi23 { dimension "api" versionNameSuffix "-minApi23" } minApi21 { dimension "api" versionNameSuffix "-minApi21" } } } ``` In this setup, the following values are valid `--flavor` are valid `freeMinApi21`, `freeMinApi23`, `premiumMinApi21`, and `premiumMinApi23`. We call these values "flavor combinations". Consider the following from the Android documentation[^1]: > In addition to the source set directories you can create for each individual product flavor and build variant, you can also create source set directories for each combination of product flavors. For example, you can create and add Java sources to the src/demoMinApi24/java/ directory, and Gradle uses those sources only when building a variant that combines those two product flavors. > > Source sets you create for product flavor combinations have a higher priority than source sets that belong to each individual product flavor. To learn more about source sets and how Gradle merges resources, read the section about how to [create source sets](https://developer.android.com/build/build-variants#sourcesets). This feature will not behave in this way. If a user utilizes this feature and also Android's multidimensional flavors feature, they will have to list out all flavor combinations that contain the flavor they want to limit an asset to: ```yaml assets: - assets/free/ flavors: - freeMinApi21 - freeMinApi23 ``` This is mostly due to a technical limitation in the hot-reload feature of `flutter run`. During a hot reload, the tool will try to update the asset bundle on the device, but the tool does not know the flavors contained within the flavor combination (that the user passes to `--flavor`). Gradle is the source of truth of what flavors were involved in the build, and `flutter run` currently does not access to that information since it's an implementation detail of the build process. We could bubble up this information, but it would require a nontrivial amount of engineering work, and it's unclear how desired this functionality is. It might not be worth implementing. </details> See https://flutter.dev/go/flavor-specific-assets for the (outdated) design document. <summary>Pre-launch Checklist</summary> </details> [^1]: https://developer.android.com/build/build-variants#flavor-dimensions
-
- 07 Dec, 2023 2 commits
-
-
Andrew Kolos authored
Provides support for conditional bundling of assets through the existing `--flavor` option for `flutter build` and `flutter run`. Closes https://github.com/flutter/flutter/issues/21682. Resolves https://github.com/flutter/flutter/issues/136092 ## Change Within the `assets` section pubspec.yaml, the user can now specify one or more `flavors` that an asset belongs to. Consider this example: ```yaml # pubspec.yaml flutter: assets: - assets/normal-asset.png - path: assets/vanilla/ice-cream.png flavors: - vanilla - path: assets/strawberry/ice-cream.png flavors: - strawberry ``` With this pubspec, * `flutter run --flavor vanilla` will not include `assets/strawberry/ice-cream.png` in the build output. * `flutter run --flavor strawberry` will not include `assets/vanilla/ice-cream.png`. * `flutter run` will only include `assets/normal-asset.png`. ## Open questions * Should this be supported for all platforms, or should this change be limited to ones with documented `--flavor` support (Android, iOS, and (implicitly) MacOS)? This PR currently only enables this feature for officially supported platforms. ## Design thoughts, what this PR does not do, etc. ### This does not provide an automatic mapping/resolution of asset keys/paths to others based on flavor at runtime. The implementation in this PR represents a simplest approach. Notably, it does not give Flutter the ability to dynamically choose an asset based on flavor using a single asset key. For example, one can't use `Image.asset('config.json')` to dynamically choose between different "flavors" of `config.json` (such as `dev-flavor/config.json` or `prod-flavor/config.json`). However, a user could always implement such a mechanism in their project or in a library by examining the flavor at runtime. ### When multiple entries affect the same file and 1) at least one of these entries have a `flavors` list provided and 2) these lists are not equivalent, we always consider the manifest to be ambiguous and will throw a `ToolExit`. <details> For example, these manifests would all be considered ambiguous: ```yaml assets: - assets/ - path: assets/vanilla.png flavors: - vanilla assets: - path: assets/vanilla/ flavors: - vanilla - path: assets/vanilla/cherry.png flavor: - cherry # Thinking towards the future where we might add glob/regex support and more conditions other than flavor: assets: - path: assets/vanilla/** flavors: - vanilla - path: assets/**/ios/** platforms: - ios # Ambiguous in the case of assets like "assets/vanilla/ios/icon.svg" since we # don't know if flavor `vanilla` and platform `ios` should be combined using or-logic or and-logic. ``` See [this review comment thread](https://github.com/flutter/flutter/pull/132985#discussion_r1381909942) for the full story on how I arrived at this decision. </details> ### This does not support Android's multidimensional flavors feature (in an intuitive way) <details> Conder this excerpt from a Flutter project's android/app/build.gradle file: ```groovy android { // ... flavorDimensions "mode", "api" productFlavors { free { dimension "mode" applicationIdSuffix ".free" } premium { dimension "mode" applicationIdSuffix ".premium" } minApi23 { dimension "api" versionNameSuffix "-minApi23" } minApi21 { dimension "api" versionNameSuffix "-minApi21" } } } ``` In this setup, the following values are valid `--flavor` are valid `freeMinApi21`, `freeMinApi23`, `premiumMinApi21`, and `premiumMinApi23`. We call these values "flavor combinations". Consider the following from the Android documentation[^1]: > In addition to the source set directories you can create for each individual product flavor and build variant, you can also create source set directories for each combination of product flavors. For example, you can create and add Java sources to the src/demoMinApi24/java/ directory, and Gradle uses those sources only when building a variant that combines those two product flavors. > > Source sets you create for product flavor combinations have a higher priority than source sets that belong to each individual product flavor. To learn more about source sets and how Gradle merges resources, read the section about how to [create source sets](https://developer.android.com/build/build-variants#sourcesets). This feature will not behave in this way. If a user utilizes this feature and also Android's multidimensional flavors feature, they will have to list out all flavor combinations that contain the flavor they want to limit an asset to: ```yaml assets: - assets/free/ flavors: - freeMinApi21 - freeMinApi23 ``` This is mostly due to a technical limitation in the hot-reload feature of `flutter run`. During a hot reload, the tool will try to update the asset bundle on the device, but the tool does not know the flavors contained within the flavor combination (that the user passes to `--flavor`). Gradle is the source of truth of what flavors were involved in the build, and `flutter run` currently does not access to that information since it's an implementation detail of the build process. We could bubble up this information, but it would require a nontrivial amount of engineering work, and it's unclear how desired this functionality is. It might not be worth implementing. </details> See https://flutter.dev/go/flavor-specific-assets for the (outdated) design document. <summary>Pre-launch Checklist</summary> </details> [^1]: https://developer.android.com/build/build-variants#flavor-dimensions
-
Daco Harkes authored
Support for FFI calls with `@Native external` functions through Native assets on Android. This enables bundling native code without any build-system boilerplate code. For more info see: * https://github.com/flutter/flutter/issues/129757 ### Implementation details for Android. Mainly follows the design of the previous PRs. For Android, we detect the compilers inside the NDK inside SDK. And bundling of the assets is done by the flutter.groovy file. The `minSdkVersion` is propagated from the flutter.groovy file as well. The NDK is not part of `flutter doctor`, and users can omit it if no native assets have to be build. However, if any native assets must be built, flutter throws a tool exit if the NDK is not installed. Add 2 app is not part of this PR yet, instead `flutter build aar` will tool exit if there are any native assets.
-
- 16 Nov, 2023 1 commit
-
-
chunhtai authored
-
- 09 Nov, 2023 1 commit
-
-
Camille Simon authored
Re-lands https://github.com/flutter/flutter/pull/137191. The fix for the issue causing that PR to be reverted was tested in this PR but ultimately landed separately in https://github.com/flutter/flutter/pull/138093.
-
- 03 Nov, 2023 1 commit
-
-
auto-submit[bot] authored
Reverts flutter/flutter#137191 Initiated by: camsim99 This change reverts the following previous change: Original Description: Adds support for Android 34 in the following ways: - Bumps integration tests compile SDK versions 33 --> 34 - Bumps template compile SDK version 33 --> 34 - Also changes deprecated `compileSdkVersion` to `compileSdk` Part of https://github.com/flutter/flutter/issues/134220
-
- 02 Nov, 2023 1 commit
-
-
Camille Simon authored
Adds support for Android 34 in the following ways: - Bumps integration tests compile SDK versions 33 --> 34 - Bumps template compile SDK version 33 --> 34 - Also changes deprecated `compileSdkVersion` to `compileSdk` Part of https://github.com/flutter/flutter/issues/134220
-
- 27 Oct, 2023 2 commits
-
-
auto-submit[bot] authored
Reverts flutter/flutter#136880 Initiated by: camsim99 This change reverts the following previous change: Original Description: Since the original PR that supposedly enabled proguard, it was using the android proguard rules that disable optimizations. See initial PR in [0] This PR changes the flutter gradle plugin to use the `proguard-android-optimize.txt` (instead of `proguard-android.txt`) which will enable optimizations/shrinking of platform code (i.e. java/kotlin). For a simple flutter hello world this results in a 25% reduction in the resulting DEX file (`classes.dex` of the APK). [0] f098de1f Fixes https://github.com/flutter/flutter/issues/136879
-
Martin Kustermann authored
Since the original PR that supposedly enabled proguard, it was using the android proguard rules that disable optimizations. See initial PR in [0] This PR changes the flutter gradle plugin to use the `proguard-android-optimize.txt` (instead of `proguard-android.txt`) which will enable optimizations/shrinking of platform code (i.e. java/kotlin). For a simple flutter hello world this results in a 25% reduction in the resulting DEX file (`classes.dex` of the APK). Note for users: For some users this may result in issues because their java/kotlin code is now better optimized & tree shaken and thereby symbols may be no longer available or being obfuscated. To fix those issues it's best to craft precise proguard rules describing the extra symbols that are needed by the app (see [1]). But it's also possible to opt out entirely of optimizations by using the unoptimized proguard rules. To add custom proguard rules or use the unoptimized android rules, one can update `android/app/build.gradle`: ``` android { ... buildTypes { release { ... + proguardFiles( + // Not ideal: Disables optimizations by using unoptimized android rules. + getDefaultProguardFile("proguard-android.txt"), + + // Better: Have precise keep rules to only keep things that are needed. + "custom-rules.pro", + ) } } } ``` [0] f098de1f [1] https://developer.android.com/build/shrink-code Fixes https://github.com/flutter/flutter/issues/136879
-
- 26 Oct, 2023 1 commit
-
-
Gray Mackall authored
Fixes https://github.com/flutter/flutter/issues/129471. Does so by doing a very similar thing that is done by https://github.com/flutter/flutter/pull/121958, but for a task that is specific to the add to app build process.
-
- 22 Sep, 2023 1 commit
-
-
Bartek Pacia authored
Refactor "app plugin loader" Gradle Plugin so it can be applied using the declarative `plugins {}` block (#127897) This PR fixes #125009.
-
- 21 Sep, 2023 1 commit
-
-
Derek Xu authored
-
- 18 Aug, 2023 1 commit
-
-
chunhtai authored
1. Remove vm service registration 2. combine print<variant>ApplicationId and print<variant>AppLinkDomain into one task dump<variant>AppLinkSettings, which dump all the data in a json file The deeplink validation tool will be a static app in devtool instead of regular app. A Static app doesn't require a running app; therefore, we can't call these API through vmservices. I decided to convert these API into flutter analyzer command, which will be done in a separate PR https://github.com/flutter/flutter/pull/131009. The reason these print tasks are converted into file dumps is to reduce the amount of data encoding and decoding. Instead of passing data through stdout, the devtool can read the files generated by gradle tasks instead.
-
- 16 Aug, 2023 1 commit
-
-
William Hesse authored
PR #132346 added the use of --local-engine-host to flutter_tools internals, and had an error on one line. Fix that error, to use the correct field name. The error occurs when building plugins with the changed tools.
-
- 15 Aug, 2023 1 commit
-
-
Matan Lurey authored
Partial work towards https://github.com/flutter/flutter/issues/132245. I made a minor refactor to test-only code because it was too confusing to have 2 optional parameters that are technically required together, but otherwise all other changes *should* be pass throughs. That being said, I can't say I totally understand the Gradle stuff so I could use a hand double checking that.
-
- 09 Aug, 2023 1 commit
-
-
Zachary Anderson authored
Context: https://github.com/flutter/flutter/issues/131862 This PR injects a "realm" component to the storage base URL when the contents of the file `bin/internal/engine.realm` is non-empty. As documented in the PR, when the realm is `flutter_archives_v2`, and `bin/internal/engine.version` contains the commit hash for a commit in a `flutter/engine` PR, then the artifacts pulled by the tool will be the artifacts built by the presubmit checks for the PR. This works for everything but the following two cases: 1. Fuchsia artifacts are not uploaded to CIPD by the Fuchsia presubmit builds. 2. Web artifacts are not uploaded to gstatic by the web engine presubmit builds. For (1), the flutter/flutter presubmit `fuchsia_precache` is driven by a shell script outside of the repo. It will fail when the `engine.version` and `engine.realm` don't point to a post-submit engine commit. For (2), the flutter/flutter web presubmit tests that refer to artifacts in gstatic hang when the artifacts aren't found, so this PR skips them.
-
- 02 Aug, 2023 1 commit
-
-
Gray Mackall authored
Add documentation in flutter.groovy noting that we always use the latest available android version (#131705) Last piece of/ Fixes https://github.com/flutter/flutter/issues/131425 Also added a period to a comment line that was missing one.
-
- 07 Jun, 2023 1 commit
-
-
chunhtai authored
fixes https://github.com/flutter/flutter/issues/120408 Added two gradle tasks, one for grabing the application id, one for grabbing app link domains. Added a new vmservices to call these two gradle tasks and return the result. The expected work flow is that the devtool will first call a vmservices to grab all avaliable build variants. It will then choose one of the build variant and call this new services to get application id and app link domains.
-
- 05 May, 2023 1 commit
-
-
ChenRenJie authored
When I include flutter in my exist android project by `include_flutter.groovy`, it hint me: ``` Project :app doesn't exist. To custom the host app project name, set `org.gradle.project.flutter.hostAppProjectName=<project-name>` in gradle.properties. ``` But set `org.gradle.project.flutter.hostAppProjectName` has no effect, acutally need to set `flutter.hostAppProjectName`. This pr is to fix this incorrect hint. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [Features we expect every widget to implement]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat
-