forked from flutter/flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 1p plugin template #1
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Nguyen Huy <[email protected]>
huycozy
pushed a commit
that referenced
this pull request
Aug 16, 2023
This is a follow up to the following pull requests: - flutter#124514 I was finally able to reproduce this bug and found out why it was happening. Consider this code: ```dart GestureDetector( behavior: HitTestBehavior.translucent, // Note: Make sure onTap is not null to ensure events // are captured by `GestureDetector` onTap: () {}, child: _shouldShowSlider ? Slider(value: _value, onChanged: _handleSlide) : const SizedBox.shrink(). ) ``` Runtime exception happens when: 1. User taps and holds the Slider (drag callback captured by `GestureDetector`) 2. `_shouldShowSlider` changes to false, Slider disappears and unmounts, and unregisters `_handleSlide`. But the callback is still registered by `GestureDetector` 3. Users moves finger as if Slider were still there 4. Drag callback is invoked, `_SliderState.showValueIndicator` is called 5. Exception - Slider is already disposed This pull request fixes it by adding a mounted check inside `_SliderState.showValueIndicator` to ensure the Slider is actually mounted at the time of invoking drag event callback. I've added a unit test that will fail without this change. The error stack trace is: ``` The following assertion was thrown while handling a gesture: This widget has been unmounted, so the State no longer has a context (and should be considered defunct). Consider canceling any active work during "dispose" or using the "mounted" getter to determine if the State is still active. When the exception was thrown, this was the stack: #0 State.context.<anonymous closure> (package:flutter/src/widgets/framework.dart:950:9) #1 State.context (package:flutter/src/widgets/framework.dart:956:6) #2 _SliderState.showValueIndicator (package:flutter/src/material/slider.dart:968:18) #3 _RenderSlider._startInteraction (package:flutter/src/material/slider.dart:1487:12) #4 _RenderSlider._handleDragStart (package:flutter/src/material/slider.dart:1541:5) #5 DragGestureRecognizer._checkStart.<anonymous closure> (package:flutter/src/gestures/monodrag.dart:531:53) #6 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:275:24) #7 DragGestureRecognizer._checkStart (package:flutter/src/gestures/monodrag.dart:531:7) #8 DragGestureRecognizer._checkDrag (package:flutter/src/gestures/monodrag.dart:498:5) #9 DragGestureRecognizer.acceptGesture (package:flutter/src/gestures/monodrag.dart:431:7) #10 _CombiningGestureArenaMember.acceptGesture (package:flutter/src/gestures/team.dart:45:14) #11 GestureArenaManager._resolveInFavorOf (package:flutter/src/gestures/arena.dart:281:12) #12 GestureArenaManager._resolve (package:flutter/src/gestures/arena.dart:239:9) flutter#13 GestureArenaEntry.resolve (package:flutter/src/gestures/arena.dart:53:12) flutter#14 _CombiningGestureArenaMember._resolve (package:flutter/src/gestures/team.dart:85:15) flutter#15 _CombiningGestureArenaEntry.resolve (package:flutter/src/gestures/team.dart:19:15) flutter#16 OneSequenceGestureRecognizer.resolve (package:flutter/src/gestures/recognizer.dart:375:13) flutter#17 DragGestureRecognizer.handleEvent (package:flutter/src/gestures/monodrag.dart:414:13) flutter#18 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:98:12) flutter#19 PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:143:9) flutter#20 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:625:13) flutter#21 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:141:18) flutter#22 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:127:7) flutter#23 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:488:19) flutter#24 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:468:22) flutter#25 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:439:11) flutter#26 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:413:7) flutter#27 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:376:5) flutter#28 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:323:7) flutter#29 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:292:9) flutter#30 _invoke1 (dart:ui/hooks.dart:186:13) flutter#31 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:433:7) flutter#32 _dispatchPointerDataPacket (dart:ui/hooks.dart:119:31) Handler: "onStart" Recognizer: HorizontalDragGestureRecognizer#a5df2 ``` *List which issues are fixed by this PR. You must list at least one issue.* Internal bug: b/273666179, b/192329942 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
goderbauer
pushed a commit
that referenced
this pull request
Oct 10, 2023
huycozy
pushed a commit
that referenced
this pull request
Oct 26, 2023
flutter#137242) This reverts commit d36a843 (flutter#136809) This fails even tho golden files were approved and `golden test` pending was cleared and green and `autosubmit` successfully merged the PR. ```console 02:42 +4618 ~5: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/outlined_button_test.dart: Material3 - OutlinedButton, OutlinedButton.icon defaults ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════ The following SkiaException was thrown while running async test code: Skia Gold received an unapproved image in post-submit testing. Golden file images in flutter/flutter are triaged in pre-submit during code review for the given PR. Visit https://flutter-gold.skia.org/ to view and approve the image(s), or revert the associated change. For more information, visit the wiki: https://github.com/flutter/flutter/wiki/Writing-a-golden-file-test-for-package:flutter Debug information for Gold -------------------------------- stdout: Given image with hash 37275e74c51f98d7abd7f301c5c94ac1 for test material.outlined_button.ink_sparkle.default Expectation for test: 531f5fa74908d2e6db2b8fd86a6b8662 (positive) Expectation for test: 683e368ff51d947a3d63c2a5f4568cf6 (positive) Expectation for test: 749241ff0fa21595b2c6cb551fd40b68 (positive) Expectation for test: aaf9ac1328614d6c9f4540308bc86f62 (positive) Expectation for test: b31a50440c7dd31b10cacd9e7b5c6b86 (positive) Expectation for test: c0a7c8c625b69ddc695a770f28abd403 (positive) Expectation for test: f1f66ce931c2ef33ebcb699a637025a6 (positive) Expectation for test: 2d32e34efc1d7ca4cd12965402fb76ff (positive) Untriaged or negative image: https://flutter-gold.skia.org/detail?grouping=name%3Dmaterial.outlined_button.ink_sparkle.default%26source_type%3Dflutter&digest=37275e74c51f98d7abd7f301c5c94ac1 stderr: Test: material.outlined_button.ink_sparkle.default FAIL result-state.json: No result file found. When the exception was thrown, this was the stack: #0 SkiaGoldClient.imgtestAdd (package:flutter_goldens_client/skia_client.dart:243:7) <asynchronous suspension> #1 MatchesGoldenFile.matchAsync.<anonymous closure> (package:flutter_test/src/_matchers_io.dart:118:32) <asynchronous suspension> <asynchronous suspension> (elided one frame from dart:async) The exception was caught asynchronously. ════════════════════════════════════════════════════════════════════════════════════════════════════ 02:42 +4618 ~5 -1: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/menu_anchor_test.dart: Menu functions keyboard directional traversal works 02:42 +4618 ~5 -1: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/outlined_button_test.dart: Material3 - OutlinedButton, OutlinedButton.icon defaults [E] Test failed. See exception logs above. The test description was: Material3 - OutlinedButton, OutlinedButton.icon defaults 02:42 +4619 ~5 -1: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/menu_anchor_test.dart: Menu functions keyboard directional traversal works ``` ## 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
huynguyennovem
pushed a commit
that referenced
this pull request
Apr 12, 2024
A test was failing silently because of this (see flutter#144353 and fixed in flutter#144709). The failure went undetected for months. Ideally, this should have been a regular non-silent failure. This change makes that so. `package:test` can properly handle reported exceptions outside of test cases. With this change, the test fails as follows: ``` 00:03 +82: Smoke test material/color_scheme/dynamic_content_color.0.dart ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════ The following assertion was thrown running a test (but after the test had completed): setState() called after dispose(): _DynamicColorExampleState#1cd37(lifecycle state: defunct, not mounted) This error happens if you call setState() on a State object for a widget that no longer appears in the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error can occur when code calls setState() from a timer or an animation callback. The preferred solution is to cancel the timer or stop listening to the animation in the dispose() callback. Another solution is to check the "mounted" property of this object before calling setState() to ensure the object is still in the tree. This error might indicate a memory leak if setState() is being called because another object is retaining a reference to this State object after it has been removed from the tree. To avoid memory leaks, consider breaking the reference to this object during dispose(). When the exception was thrown, this was the stack: #0 State.setState.<anonymous closure> (package:flutter/src/widgets/framework.dart:1167:9) #1 State.setState (package:flutter/src/widgets/framework.dart:1202:6) #2 _DynamicColorExampleState._updateImage (package:flutter_api_samples/material/color_scheme/dynamic_content_color.0.dart:191:5) <asynchronous suspension> ════════════════════════════════════════════════════════════════════════════════════════════════════ 00:03 +81 -1: Smoke test material/context_menu/context_menu_controller.0.dart 00:03 +81 -1: Smoke test material/color_scheme/dynamic_content_color.0.dart [E] Test failed. See exception logs above. The test description was: Smoke test material/color_scheme/dynamic_content_color.0.dart This test failed after it had already completed. Make sure to use a matching library which informs the test runner of pending async work. ```
huynguyennovem
pushed a commit
that referenced
this pull request
Apr 12, 2024
…r#144706)" (flutter#144970) Reverts: flutter#144706 Initiated by: gspencergoog Reason for reverting: This has broken the tree because some tests are still failing post completion. This particular one looks like it might have to do with a gold image not existing. Original PR Author: goderbauer Reviewed By: {Piinks} This change reverts the following previous change: A test was failing silently because of this (see flutter#144353 and fixed in flutter#144709). The failure went undetected for months. Ideally, this should have been a regular non-silent failure. This change makes that so. `package:test` can properly handle reported exceptions outside of test cases. With this change, the test fails as follows: ``` 00:03 +82: Smoke test material/color_scheme/dynamic_content_color.0.dart ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════ The following assertion was thrown running a test (but after the test had completed): setState() called after dispose(): _DynamicColorExampleState#1cd37(lifecycle state: defunct, not mounted) This error happens if you call setState() on a State object for a widget that no longer appears in the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error can occur when code calls setState() from a timer or an animation callback. The preferred solution is to cancel the timer or stop listening to the animation in the dispose() callback. Another solution is to check the "mounted" property of this object before calling setState() to ensure the object is still in the tree. This error might indicate a memory leak if setState() is being called because another object is retaining a reference to this State object after it has been removed from the tree. To avoid memory leaks, consider breaking the reference to this object during dispose(). When the exception was thrown, this was the stack: #0 State.setState.<anonymous closure> (package:flutter/src/widgets/framework.dart:1167:9) #1 State.setState (package:flutter/src/widgets/framework.dart:1202:6) #2 _DynamicColorExampleState._updateImage (package:flutter_api_samples/material/color_scheme/dynamic_content_color.0.dart:191:5) <asynchronous suspension> ════════════════════════════════════════════════════════════════════════════════════════════════════ 00:03 +81 -1: Smoke test material/context_menu/context_menu_controller.0.dart 00:03 +81 -1: Smoke test material/color_scheme/dynamic_content_color.0.dart [E] Test failed. See exception logs above. The test description was: Smoke test material/color_scheme/dynamic_content_color.0.dart This test failed after it had already completed. Make sure to use a matching library which informs the test runner of pending async work. ```
huynguyennovem
pushed a commit
that referenced
this pull request
Jul 19, 2024
New analyze error in an unrelated PR ``` ╔═╡ERROR #1╞════════════════════════════════════════════════════════════════════ ║ /b/s/w/ir/x/w/flutter/CODEOWNERS:13: trailing U+0020 space character ╚═══════════════════════════════════════════════════════════════════════════════ ``` https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8744032390138579057/+/u/run_test.dart_for_analyze_shard_and_subshard_None/stdout On this commit flutter@2537b49
huycozy
pushed a commit
that referenced
this pull request
Aug 27, 2024
When attempting to release the Flutter 3.24.1 hotfix, Flutter framework post submits failed due to the following error: ``` ���ERROR #1��������������������������������������������������������������������� � UNEXPECTED ERROR! � Exception: Found unexpected binary in cache: /Volumes/Work/s/w/ir/x/w/flutter/bin/cache/artifacts/engine/ios-release/extension_safe/Flutter.xcframework/ios-arm64_x86_64-simulator/dSYMs/Flutter.framework.dSYM/Contents/Resources/DWARF/Flutter � #0 verifyExist (file:///Volumes/Work/s/w/ir/x/w/flutter/dev/bots/suite_runners/run_verify_binaries_codesigned_tests.dart:150:12) � <asynchronous suspension> � #1 verifyCodesignedTestRunner (file:///Volumes/Work/s/w/ir/x/w/flutter/dev/bots/suite_runners/run_verify_binaries_codesigned_tests.dart:28:3) � <asynchronous suspension> � #2 _runFromList (file:///Volumes/Work/s/w/ir/x/w/flutter/dev/bots/utils.dart:601:5) � <asynchronous suspension> � #3 main (file:///Volumes/Work/s/w/ir/x/w/flutter/dev/bots/test.dart:125:5) � <asynchronous suspension> � � The test.dart script should be corrected to catch this error and call foundError(). � Some tests are likely to have been skipped. �������������������������������������������������������������������������������� ``` I've updated the tests to include the listed artifact. ### Open questions 1. Is it possible that the test failed only on the first binary? 2. Do we expect a need to add the remainder of the [entitlement changes](flutter/engine@c9b9d57)? 3. I am under the assumption that the bots pull from master and are not branch specific, is this a correct assumption? CC @christopherfujino @cbracken
huynguyennovem
pushed a commit
that referenced
this pull request
Sep 24, 2024
…lutter#154715) Fixes: flutter#154580 Previous PR: flutter#154677 More info: flutter#154580 (comment) The errors described in the original issue [are still occurring](flutter#154580 (comment)) after flutter#154677. Before this change, the repro [broken_demo](https://github.com/rajveermalviya/broken_demo) mentioned in the original issue logs: ```shell-session $ flutter run --release Launching lib/main.dart on sdk gphone64 arm64 in release mode... Running Gradle task 'assembleRelease'... 14.5s â�� Built build/app/outputs/flutter-apk/app-release.apk (7.4MB) Installing build/app/outputs/flutter-apk/app-release.apk... 739ms Flutter run key commands. h List all available interactive commands. c Clear the screen q Quit (terminate the application on the device). W/FlutterEngineCxnRegstry(13284): Attempted to register plugin (a0.a@53b33b6) but it was already registered with this FlutterEngine (d0.c@8baa8b7). E/flutter (13284): [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null) E/flutter (13284): #0 PathProviderApi.getApplicationSupportPath (package:path_provider_android/messages.g.dart:65) E/flutter (13284): <asynchronous suspension> E/flutter (13284): #1 getApplicationSupportDirectory (package:path_provider/path_provider.dart:78) E/flutter (13284): <asynchronous suspension> E/flutter (13284): #2 _BorkenDemoHomePageState.build.<anonymous closure> (package:broken_demo/main.dart:44) E/flutter (13284): <asynchronous suspension> E/flutter (13284): ``` After this change: ```shell-session $ flutter run --release Launching lib/main.dart on sdk gphone64 arm64 in release mode... Running Gradle task 'assembleRelease'... 15.2s â�� Built build/app/outputs/flutter-apk/app-release.apk (7.4MB) Installing build/app/outputs/flutter-apk/app-release.apk... 857ms Flutter run key commands. h List all available interactive commands. c Clear the screen q Quit (terminate the application on the device). I/flutter (13040): path_provider: Directory: '/data/user/0/com.example.broken_demo/files' ```
huynguyennovem
pushed a commit
that referenced
this pull request
Sep 24, 2024
flutter#154645) ### Problem Enabling the Swift Package Manager feature caused post-submit tests to fail on Mac x64 hosts: <details> <summary>Example error...</summary> https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_ios%20rrect_blur_perf_ios__timeline_summary/575/overview ``` â�¦ ... flutter --verbose assemble ... -dIosArchs=x86_64 ... profile_unpack_ios Target profile_unpack_ios failed: Exception: Binary ... build/ios/Profile-iphoneos/Flutter.framework/Flutter does not contain x86_64. Running lipo -info: Non-fat file: ... build/ios/Profile-iphoneos/Flutter.framework/Flutter is architecture: arm64 #0 UnpackIOS._thinFramework (package:flutter_tools/src/build_system/targets/ios.dart:351:7) <asynchronous suspension> #1 UnpackIOS.build (package:flutter_tools/src/build_system/targets/ios.dart:298:5) <asynchronous suspension> ... ``` </details> ### Reproduction On a mac x64 host: 1. Switch to the latest master channel: `flutter channel master ; flutter upgrade` 1. Disable the Swift Package Manager feature: `flutter config --no-enable-swift-package-manager` 2. Create a Flutter project 2. [Edit the Xcode project manually to add the prepare pre-action](https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-app-developers#step-2-add-run-prepare-flutter-framework-script-pre-action) 3. Run `flutter run` (`flutter build ios` does not reproduce this issue). ### Background Previously, the Flutter framework was unpacked in the Xcode target's build. Unfortunately, this happens after Swift packages are built; this prevented Swift packages from using the Flutter framework. To fix this, we added an Xcode pre-action that unpacks the Flutter framework _before_ Swift Package Manager builds packages. The Xcode target still runs the Flutter framework unpack step, but this step no-ops if the unpack step has the exact same inputs. ```mermaid flowchart LR A[flutter run -d iphone] --> B(Build Xcode project) B --> C(Xcode 'prepare framework' pre-action) B --> G[Build Swift packages] B --> D(Build 'Runner' target) C --> E[Unpack Flutter framework #1] D --> F[" Unpack Flutter framework #2 (No-ops if inputs are same as #1) "] ``` flutter#150052 added an optimization that made it more likely the second unpack step no-ops by fixing a case where the target architecture input could be different: > When using SwiftPM, we use `flutter assemble` in an Xcode Pre-action to run the `debug_unpack_macos` (or profile/release) target. This target is also later used in a Run Script build phase. Depending on `ARCHS` build setting, the Flutter/FlutterMacOS binary is thinned. In the Run Script build phase, `ARCHS` is filtered to the active arch. However, in the Pre-action it doesn't always filter to the active arch. As a workaround, assume arm64 if the [`NATIVE_ARCH`](https://developer.apple.com/documentation/xcode/build-settings-reference/#NATIVEARCH) is arm, otherwise assume x86_64. This optimization is only applied if [`ONLY_ACTIVE_ARCH`](https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW157) is `YES`. > [!IMPORTANT] > [`ONLY_ACTIVE_ARCH`](https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW157)'s name is misleading. It specifies whether the product includes only object code for the native architecture. > > A value of `YES` means the product includes only code for the native architecture ([NATIVE_ARCH](https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW59)). > > A value of `NO` means the product includes code for the architectures specified in [ARCHS (Architectures)](https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW62). ### Problem `buildXcodeProject` incorrectly always sets `ONLY_ACTIVE_ARCH` to `YES` if the Xcode built is for a single architecture: https://github.com/flutter/flutter/blob/6abef222514e8039bde5c47ab7864abbc4caf7e8/packages/flutter_tools/lib/src/ios/mac.dart#L353-L361 This is incorrect! If the host architecture is `x64` but the target architecture is `arm64`, [`ONLY_ACTIVE_ARCH`](https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW157) should be `NO`. This caused the prepare pre-action to incorrectly use x64 as the target architecture for arm64 devices on an x64 host, which in turn caused builds to fail if Swift Package Manager was enabled. ### Solution This change updates `buildXcodeProject` to set `ONLY_ACTIVE_ARCH` correctly. This change also updates the prepare pre-action's to be more conservative in applying the optimization that filters the target architecture. This ensures that the build still works (but without the optimization) if `ONLY_ACTIVE_ARCH` is incorrectly set. Follow-up PR: flutter#154649 This unblocks: flutter#151567 ### DeviceLab test This problem reproduces if you `flutter run` to an iPhone Arm64 device from an x64 mac host with the Swift Package Manager feature enabled. I ran an affected DeviceLab test to verify the fix works as expected: Description | CI test | Result -- | -- | -- SwiftPM enabled without this fix: flutter#154750 | [Link](https://ci.chromium.org/ui/p/flutter/builders/try.shadow/Mac_ios%20rrect_blur_perf_ios__timeline_summary/7/overview) | â�� SwiftPM enabled with this fix: flutter#154749 | [Link](https://ci.chromium.org/ui/p/flutter/builders/try.shadow/Mac_ios%20rrect_blur_perf_ios__timeline_summary/8/overview) | â�
huynguyennovem
pushed a commit
that referenced
this pull request
Feb 27, 2025
The crash indicates that FlutterJNI is returning a nullptr SurfaceControl.Transaction. That likely indicates that we're trying to rasterize a frame before the platform view controller is setup. Potentially a startup race? At any rate, if the PVC is null that means there is no platform views - so it should be safe to create a tx on the fly. Interestingly I cannot repro this locally even on the same device. ``` [2025-02-11 21:50:37.462356] [STDOUT] stdout: [ +173 ms] *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** [2025-02-11 21:50:37.462539] [STDOUT] stdout: [ ] Build fingerprint: 'google/cheetah/cheetah:13/TQ3A.230901.001/10750268:user/release-keys' [2025-02-11 21:50:37.462564] [STDOUT] stdout: [ ] Revision: 'MP1.0' [2025-02-11 21:50:37.463914] [STDOUT] stdout: [ +1 ms] ABI: 'arm64' [2025-02-11 21:50:37.463946] [STDOUT] stdout: [ ] Timestamp: 2025-02-11 21:57:42.183302140-0800 [2025-02-11 21:50:37.463959] [STDOUT] stdout: [ ] Process uptime: 3s [2025-02-11 21:50:37.464054] [STDOUT] stdout: [ ] Cmdline: dev.benchmarks.platform_views_layout [2025-02-11 21:50:37.464174] [STDOUT] stdout: [ ] pid: 15185, tid: 15246, name: 1.raster >>> dev.benchmarks.platform_views_layout <<< [2025-02-11 21:50:37.464354] [STDOUT] stdout: [ ] uid: 10250 [2025-02-11 21:50:37.464398] [STDOUT] stdout: [ ] tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE) [2025-02-11 21:50:37.464440] [STDOUT] stdout: [ ] signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000000 [2025-02-11 21:50:37.464602] [STDOUT] stdout: [ ] Cause: null pointer dereference [2025-02-11 21:50:37.464651] [STDOUT] stdout: [ ] x0 b400007b82ff2e70 x1 000000000000002d x2 b400007c3309f370 x3 0000007abbcc6a23 [2025-02-11 21:50:37.464745] [STDOUT] stdout: [ ] x4 0000007a30d286b0 x5 0000007a4f6dd47b x6 0000000000000000 x7 61686b4b11ff3a78 [2025-02-11 21:50:37.464831] [STDOUT] stdout: [ ] x8 0000000000000000 x9 1417c2bd490e1f78 x10 0000000000000010 x11 000000000000009c [2025-02-11 21:50:37.464933] [STDOUT] stdout: [ ] x12 0000000000000adb x13 b400007ba2fe9510 x14 0000000000000e6b x15 b400007ba2fe9510 [2025-02-11 21:50:37.465012] [STDOUT] stdout: [ ] x16 0000000000000001 x17 0000000000000067 x18 0000007a2f996000 x19 b400007b82ff2e70 [2025-02-11 21:50:37.465082] [STDOUT] stdout: [ ] x20 000000000000002d x21 b400007ae3064b60 x22 b400007af30d0fa8 x23 0000000000000001 [2025-02-11 21:50:37.465155] [STDOUT] stdout: [ ] x24 0000007a30d2a000 x25 b400007b73028fb0 x26 0000007a3a22da20 x27 000000003b9bf6c8 [2025-02-11 21:50:37.465235] [STDOUT] stdout: [ ] x28 b400007af30d0fa8 x29 b400007ad3022cd0 [2025-02-11 21:50:37.465318] [STDOUT] stdout: [ ] lr 0000007a3a8c7918 sp 0000007a30d28940 pc 0000000000000000 pst 0000000040001000 [2025-02-11 21:50:37.465401] [STDOUT] stdout: [ ] backtrace: [2025-02-11 21:50:37.465491] [STDOUT] stdout: [ ] #00 pc 0000000000000000 <unknown> [2025-02-11 21:50:37.465596] [STDOUT] stdout: [ ] #1 pc 000000000088b914 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (flutter::PlatformViewAndroidJNIImpl::createTransaction()+104) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.465688] [STDOUT] stdout: [ ] #2 pc 000000000087f738 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (std::_fl::__function::__func<flutter::AndroidSurfaceVKImpeller::SetNativeWindow(fml::RefPtr<flutter::AndroidNativeWindow>, std::_fl::shared_ptr<flutter::PlatformViewAndroidJNI> const&)::$_0, std::_fl::allocator<flutter::AndroidSurfaceVKImpeller::SetNativeWindow(fml::RefPtr<flutter::AndroidNativeWindow>, std::_fl::shared_ptr<flutter::PlatformViewAndroidJNI> const&)::$_0>, impeller::android::SurfaceTransaction ()>::operator()()+16) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.465785] [STDOUT] stdout: [ ] #3 pc 0000000000bdbf1c /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (std::_fl::__function::__func<impeller::AHBSwapchainImplVK::AcquireNextDrawable()::$_0, std::_fl::allocator<impeller::AHBSwapchainImplVK::AcquireNextDrawable()::$_0>, bool ()>::operator()()+1716) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.465874] [STDOUT] stdout: [ ] #4 pc 0000000000b1d180 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (flutter::SurfaceFrame::Submit()+148) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.465989] [STDOUT] stdout: [ ] #5 pc 0000000000beb2b4 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (flutter::Rasterizer::DrawToSurfacesUnsafe(flutter::FrameTimingsRecorder&, std::_fl::vector<std::_fl::unique_ptr<flutter::LayerTreeTask, std::_fl::default_delete<flutter::LayerTreeTask> >, std::_fl::allocator<std::_fl::unique_ptr<flutter::LayerTreeTask, std::_fl::default_delete<flutter::LayerTreeTask> > > >)+1284) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.466400] [STDOUT] stdout: [ ] #6 pc 0000000000beac58 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (flutter::Rasterizer::DrawToSurfaces(flutter::FrameTimingsRecorder&, std::_fl::vector<std::_fl::unique_ptr<flutter::LayerTreeTask, std::_fl::default_delete<flutter::LayerTreeTask> >, std::_fl::allocator<std::_fl::unique_ptr<flutter::LayerTreeTask, std::_fl::default_delete<flutter::LayerTreeTask> > > >)+112) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.466444] [STDOUT] stdout: [ ] #7 pc 0000000000bec144 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (std::_fl::__function::__func<flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem> > const&)::$_0, std::_fl::allocator<flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem> > const&)::$_0>, void (std::_fl::unique_ptr<flutter::FrameItem, std::_fl::default_delete<flutter::FrameItem> >)>::operator()(std::_fl::unique_ptr<flutter::FrameItem, std::_fl::default_delete<flutter::FrameItem> >&&)+192) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.466468] [STDOUT] stdout: [ ] #8 pc 0000000000bebc48 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem> > const&)+360) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.466521] [STDOUT] stdout: [ ] #9 pc 0000000000bf9f7c /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (std::_fl::__function::__func<fml::internal::CopyableLambda<flutter::Shell::OnAnimatorDraw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem> >)::$_0>, std::_fl::allocator<fml::internal::CopyableLambda<flutter::Shell::OnAnimatorDraw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem> >)::$_0> >, void ()>::operator()()+84) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.466543] [STDOUT] stdout: [ ] #10 pc 00000000008a09ec /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (fml::MessageLoopImpl::RunExpiredTasksNow()+728) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.466667] [STDOUT] stdout: [ ] #11 pc 00000000008a4600 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (fml::MessageLoopAndroid::MessageLoopAndroid()::$_0::__invoke(int, int, void*)+84) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.466746] [STDOUT] stdout: [ ] #12 pc 0000000000011178 /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+808) (BuildId: 0b4a793fa8045c04066d988c68bac8bb) [2025-02-11 21:50:37.466784] [STDOUT] stdout: [ ] flutter#13 pc 00000000000185e4 /system/lib64/libandroid.so (ALooper_pollOnce+100) (BuildId: 682dab490c18361d5d6527bcdd86cdfa) [2025-02-11 21:50:37.466865] [STDOUT] stdout: [ ] flutter#14 pc 00000000008a470c /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (fml::MessageLoopAndroid::Run()+28) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.466903] [STDOUT] stdout: [ ] flutter#15 pc 00000000008a283c /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (std::_fl::__function::__func<fml::Thread::Thread(std::_fl::function<void (fml::Thread::ThreadConfig const&)> const&, fml::Thread::ThreadConfig const&)::$_0, std::_fl::allocator<fml::Thread::Thread(std::_fl::function<void (fml::Thread::ThreadConfig const&)> const&, fml::Thread::ThreadConfig const&)::$_0>, void ()>::operator()()+116) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.466943] [STDOUT] stdout: [ ] flutter#16 pc 00000000008a2670 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (fml::ThreadHandle::ThreadHandle(std::_fl::function<void ()>&&)::$_0::__invoke(void*)+8) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.467002] [STDOUT] stdout: [ ] flutter#17 pc 00000000000c226c /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+204) (BuildId: dc4001c2ef2dfc23467040797a96840c) [2025-02-11 21:50:37.467058] [STDOUT] stdout: [ ] flutter#18 pc 0000000000054a30 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: dc4001c2ef2dfc23467040797a96840c) [2025-02-11 21:50:37.525275] [STDOUT] stdout: [ +57 ms] 00:00 �[32m+0�[0m�[31m -1�[0m: scrolling performance test (setUpAll) �[1m�[31m[E]�[0m�[0m ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.
List which issues are fixed by this PR. You must list at least one issue.
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.