1. 20 Sep, 2023 4 commits
    • Yegor's avatar
      finer grained logging of Chromium launch sequence (#135078) · d6d2e89f
      Yegor authored
      Log the details of how Chromium is about to be launched prior to running
      the Chromium command, as well as the path to the Chromium executable.
      
      This should improve our understanding of what's happening here:
      https://github.com/flutter/flutter/issues/132654#issuecomment-1726630123
      d6d2e89f
    • Camille Simon's avatar
      [Android] Add Java/AGP/Gradle incompatibility warning to `flutter create` (#131444) · 594ff98a
      Camille Simon authored
      Adds warning to `flutter create` command that checks if detected Java version is compatible with the template AGP and template Gradle versions. If a developer is building for Android and their Java version is incompatible with either the AGP or Gradle versions that Flutter currently supports by default for new Flutter projects, then
      
      - a warning will show noting the incompatibility and
      - steps will be shown to fix the issue, the recommended option being to configure a new compatible Java version given that Flutter knows we can support the template Gradle/AGP versions and updating them manually may be risky (feedback on this approach would be greatly appreciated!)
      
      Given that the template AGP and Gradle versions are compatible, this PR assumes that the detected Java version may only conflict with one of the template AGP or Gradle versions because:
       - the minimum Java version for a given AGP version is less than the maximum Java version compatible for the minimum Gradle version required for that AGP version (too low a Java version will fail AGP compatibility test, but not Gradle compatibility).
      - the maximum Java version compatible with minimum Gradle version for a given AGP version is higher than minimum Java version required for that AGP version (too high a Java version will fail Gradle compatibility test, but not AGP compatibility test).
      
      Fixes https://github.com/flutter/flutter/issues/130515 in the sense that `flutter create foo`; `cd foo`; `flutter run` should always be successful.
      594ff98a
    • Gray Mackall's avatar
    • Xilai Zhang's avatar
      [flutter roll] Revert "Native assets support for Linux" (#135069) · 52ef9d88
      Xilai Zhang authored
      Reverts flutter/flutter#134031
      
      context: b/301051367
      Looked at the error message from the broken TAP target, but seems like the failure might be non trivial to resolve. Would it be okay if we revert this for now while it is being triaged?
      52ef9d88
  2. 19 Sep, 2023 2 commits
    • David Iglesias's avatar
      [web] Encode AssetManifest.bin as JSON and use that on the web. (#131382) · c7c9d8ee
      David Iglesias authored
      This PR modifies the web build slightly to create an `AssetManifest.json`, that is a JSON(base64)-encoded version of the `AssetManifest.bin` file.
      
      _(This should enable all browsers to download the file without any interference, and all servers to serve it with the correct headers.)_
      
      It also modifies Flutter's `AssetManifest` class so it loads and uses said file `if (kIsWeb)`.
      
      ### Issues
      
      * Fixes https://github.com/flutter/flutter/issues/124883
      
      ### Tests
      
      * Unit tests added.
      * Some tests that run on the Web needed to be informed of the new filename, but their behavior didn't have to change (binary contents are the same across all platforms).
      * I've deployed a test app, so users affected by the BIN issue may take a look at the PR in action:
        * https://dit-tests.web.app
      c7c9d8ee
    • Greg Spencer's avatar
      Remove 'must be non-null' and 'must not be null' comments from non-framework libraries (#134994) · 4ce7fdd9
      Greg Spencer authored
      ## Description
      
      This removes all of the comments that are of the form "so-and-so must not be null" or "so-and-so must be non-null" from the cases where those values are defines as non-nullable values.
      
      This PR removes them from the library in the repo that don't have anything to do with the framework.
      
      This was done by hand, since it really didn't lend itself to scripting, so it needs to be more than just spot-checked, I think. I was careful to leave any comment that referred to parameters that were nullable, but I may have missed some.
      
      In addition to being no longer relevant after null safety has been made the default, these comments were largely fragile, in that it was easy for them to get out of date, and not be accurate anymore anyhow.
      
      This did create a number of constructor comments which basically say "Creates a [Foo].", but I don't really know how to avoid that in a large scale change, since there's not much you can really say in a lot of cases.  I think we might consider some leniency for constructors to the "Comment must be meaningful" style guidance (which we de facto have already, since there are a bunch of these).
      
      ## Related PRs
      - https://github.com/flutter/flutter/pull/134984
      - https://github.com/flutter/flutter/pull/134991
      - https://github.com/flutter/flutter/pull/134992
      - https://github.com/flutter/flutter/pull/134993
      
      ## Tests
       - Documentation only change.
      4ce7fdd9
  3. 18 Sep, 2023 2 commits
    • Victoria Ashworth's avatar
      Don't uninstall before retrying to connect during app launch (#134542) · abf8361a
      Victoria Ashworth authored
      When retrying to connect to the device during app launch, don't uninstall the app first.
      
      Latest test flake for https://github.com/flutter/flutter/issues/120808:
      https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8770202475999850785/+/u/run_hot_mode_dev_cycle_ios__benchmark/test_stdout
      
      Shows that it uninstalled and then tried debugging and failed, which would make sense since the app wasn't installed anymore.
      ```
      [2023-09-11 18:02:24.555646] [STDOUT] stdout: [   +6 ms] Lost connection to device. Trying to connect again...
      [2023-09-11 18:02:24.556949] [STDOUT] stdout: [   +1 ms] executing: /opt/s/w/ir/x/w/recipe_cleanup/tmp53fs1szo/flutter sdk/bin/cache/artifacts/libimobiledevice/idevicesyslog -u 00008030-00144DA10185402E
      [2023-09-11 18:02:24.557323] [STDOUT] stdout: [        ] executing: script -t 0 /dev/null /opt/s/w/ir/x/w/recipe_cleanup/tmp53fs1szo/flutter sdk/bin/cache/artifacts/ios-deploy/ios-deploy --id 00008030-00144DA10185402E --bundle build/ios/iphoneos/Flutter Gallery.app --app_deltas build/ios/app-delta --uninstall --noinstall --debug --no-wifi --args --enable-dart-profiling --disable-vm-service-publication --enable-checked-mode --verify-entry-points
      [2023-09-11 18:02:24.578010] [STDOUT] stdout: [  +20 ms] [....] Waiting for iOS device to be connected
      [2023-09-11 18:02:24.712631] [STDOUT] stdout: [ +134 ms] [....] Using 00008030-00144DA10185402E (N104AP, iPhone 11, iphoneos, arm64e, 16.2, 20C65) a.k.a. 'iPhone 11'.
      [2023-09-11 18:02:24.712725] [STDOUT] stdout: [        ] ------ Uninstall phase ------
      [2023-09-11 18:02:24.818293] [STDOUT] stdout: [ +105 ms] [ OK ] Uninstalled package with bundle id io.flutter.examples.gallery
      [2023-09-11 18:02:24.906833] [STDOUT] stdout: [  +88 ms] ------ Debug phase ------
      [2023-09-11 18:02:24.906924] [STDOUT] stdout: [        ] Starting debug of 00008030-00144DA10185402E (N104AP, iPhone 11, iphoneos, arm64e, 16.2, 20C65) a.k.a. 'iPhone 11' connected through USB...
      [2023-09-11 18:02:25.285252] [STDOUT] stdout: [ +378 ms] [  0%] Looking up developer disk image
      [2023-09-11 18:02:25.529937] [STDOUT] stdout: [ +244 ms] [ 90%] Mounting developer disk image
      [2023-09-11 18:02:25.545261] [STDOUT] stdout: [  +15 ms] [ 95%] Developer disk image already mounted
      [2023-09-11 18:02:25.587923] [STDOUT] stdout: [  +42 ms] Detected path to iOS debug symbols: "Symbol Path: /Users/swarming/Library/Developer/Xcode/iOS DeviceSupport/16.2 (20C65) arm64e/Symbols"
      [2023-09-11 18:02:25.857177] [STDOUT] stdout: [ +269 ms] Script started, output file is /dev/null
      [2023-09-11 18:02:25.857259] [STDOUT] stdout: [        ] Script done, output file is /dev/null
      [2023-09-11 18:02:25.857511] [STDOUT] stdout: [        ] ios-deploy exited with code 0
      [2023-09-11 18:02:25.858066] [STDOUT] stderr: [        ] Could not run build/ios/iphoneos/Flutter Gallery.app on 00008030-00144DA10185402E.
      [2023-09-11 18:02:25.858130] [STDOUT] stderr: [        ] Try launching Xcode and selecting "Product > Run" to fix the problem:
      [2023-09-11 18:02:25.858214] [STDOUT] stderr: [        ]   open ios/Runner.xcworkspace
      [2023-09-11 18:02:25.858537] [STDOUT] stdout: [        ] Installing and launching... (completed in 52.4s)
      [2023-09-11 18:02:25.858956] [STDOUT] stderr: [        ] Error launching application on iPhone 11.
      ```
      abf8361a
    • Daco Harkes's avatar
      Native assets support for Linux (#134031) · 2337c64d
      Daco Harkes authored
      Support for FFI calls with `@Native external` functions through Native assets on Linux. 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 Linux.
      
      Mainly follows the design of https://github.com/flutter/flutter/pull/130494.
      
      Some differences are:
      
      * Linux does not support cross compiling or compiling for multiple architectures, so this has not been implemented.
      * Linux has no add2app.
      
      The assets copying is done in the install-phase of the CMake build of a flutter app.
      CMake requires the native assets folder to exist, so we create it also when the feature is disabled or there are no assets.
      
      ### Tests
      
      This PR adds new tests to cover the various use cases.
      
      * packages/flutter_tools/test/general.shard/linux/native_assets_test.dart
        * Unit tests the Linux-specific part of building native assets.
      
      It also extends various existing tests:
      
      * packages/flutter_tools/test/integration.shard/native_assets_test.dart
        * Runs (incl hot reload/hot restart), builds, builds frameworks for Linux and flutter-tester.
      2337c64d
  4. 15 Sep, 2023 2 commits
  5. 14 Sep, 2023 1 commit
  6. 13 Sep, 2023 2 commits
  7. 12 Sep, 2023 2 commits
  8. 11 Sep, 2023 1 commit
  9. 10 Sep, 2023 1 commit
    • Daco Harkes's avatar
      Native assets support for MacOS and iOS (#130494) · aa36db1d
      Daco Harkes authored
      Support for FFI calls with `@Native external` functions through Native assets on MacOS and iOS. 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 MacOS and iOS.
      
      Dylibs are bundled by (1) making them fat binaries if multiple architectures are targeted, (2) code signing these, and (3) copying them to the frameworks folder. These steps are done manual rather than via CocoaPods. CocoaPods would have done the same steps, but (a) needs the dylibs to be there before the `xcodebuild` invocation (we could trick it, by having a minimal dylib in the place and replace it during the build process, that works), and (b) can't deal with having no dylibs to be bundled (we'd have to bundle a dummy dylib or include some dummy C code in the build file).
      
      The dylibs are build as a new target inside flutter assemble, as that is the moment we know what build-mode and architecture to target.
      
      The mapping from asset id to dylib-path is passed in to every kernel compilation path. The interesting case is hot-restart where the initial kernel file is compiled by the "inner" flutter assemble, while after hot restart the "outer" flutter run compiled kernel file is pushed to the device. Both kernel files need to contain the mapping. The "inner" flutter assemble gets its mapping from the NativeAssets target which builds the native assets. The "outer" flutter run get its mapping from a dry-run invocation. Since this hot restart can be used for multiple target devices (`flutter run -d all`) it contains the mapping for all known targets.
      
      ### Example vs template
      
      The PR includes a new template that uses the new native assets in a package and has an app importing that. Separate discussion in: https://github.com/flutter/flutter/issues/131209.
      
      ### Tests
      
      This PR adds new tests to cover the various use cases.
      
      * dev/devicelab/bin/tasks/native_assets_ios.dart
        * Runs an example app with native assets in all build modes, doing hot reload and hot restart in debug mode.
      * dev/devicelab/bin/tasks/native_assets_ios_simulator.dart
        * Runs an example app with native assets, doing hot reload and hot restart.
      * packages/flutter_tools/test/integration.shard/native_assets_test.dart
        * Runs (incl hot reload/hot restart), builds, builds frameworks for iOS, MacOS and flutter-tester.
      * packages/flutter_tools/test/general.shard/build_system/targets/native_assets_test.dart
        * Unit tests the new Target in the backend.
      * packages/flutter_tools/test/general.shard/ios/native_assets_test.dart
      * packages/flutter_tools/test/general.shard/macos/native_assets_test.dart
        * Unit tests the native assets being packaged on a iOS/MacOS build.
      
      It also extends various existing tests:
      
      * dev/devicelab/bin/tasks/module_test_ios.dart
         * Exercises the add2app scenario.
      * packages/flutter_tools/test/general.shard/features_test.dart
         * Unit test the new feature flag.
      aa36db1d
  10. 08 Sep, 2023 1 commit
  11. 06 Sep, 2023 1 commit
  12. 05 Sep, 2023 2 commits
  13. 31 Aug, 2023 4 commits
  14. 29 Aug, 2023 1 commit
  15. 25 Aug, 2023 1 commit
  16. 24 Aug, 2023 2 commits
  17. 23 Aug, 2023 5 commits
  18. 22 Aug, 2023 1 commit
  19. 19 Aug, 2023 1 commit
  20. 18 Aug, 2023 4 commits