Skip to content
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

Image Assets are not loaded in driver tests for me on v1.5.4-hotfix.2 #35720

Closed
leishuai opened this issue Jul 8, 2019 · 7 comments

Comments

@leishuai
Copy link

commented Jul 8, 2019

All images assets load from local assets dir is not displayed while running thru flutter drive where I wanna run some integration tests. iOS Simulator, Android/iOS devices all failed to show images.
P.S. images loaded from network works fine. Manually tapping on the icon built from flutter drive works fine.

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.4 18E226, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2)
[✓] Android Studio (version 3.4)
[✓] Connected device (2 available)

• No issues found!

@leishuai leishuai changed the title Assets are not loaded in driver tests for me on v1.5.4-hotfix.2 Image Assets are not loaded in driver tests for me on v1.5.4-hotfix.2 Jul 9, 2019

@chunhtai

This comment has been minimized.

Copy link
Contributor

commented Jul 9, 2019

Would you able to share you app that can reproduce this issue, and as well as any log you can gather? It will be easier for us if we can reproduce it locally

@leishuai

This comment has been minimized.

Copy link
Author

commented Jul 11, 2019

@chunhtai Logs are as followed:

leishuaideMacBook-Pro:feed_flutter leishuai$ flutter drive --target=test_driver/app.dart
Using device iPhone Xʀ.
Starting application: test_driver/app.dart
Running Xcode build...

├─Assembling Flutter resources... 2.7s
└─Compiling, linking and signing... 12.0s
Xcode build done. 18.0s
"signalStrengthChanged:info:",
"cellChanged:cell:",
"connectionStateChanged:connection:dataConnectionStatusInfo:",
"carrierBundleChange:"
)
"signalStrengthChanged:info:",
"cellChanged:cell:",
"connectionStateChanged:connection:dataConnectionStatusInfo:",
"carrierBundleChange:"
)
"signalStrengthChanged:info:",
"cellChanged:cell:",
"connectionStateChanged:connection:dataConnectionStatusInfo:",
"carrierBundleChange:"
)
"signalStrengthChanged:info:",
"cellChanged:cell:",
"connectionStateChanged:connection:dataConnectionStatusInfo:",
"carrierBundleChange:"
)
"signalStrengthChanged:info:",
"cellChanged:cell:",
"connectionStateChanged:connection:dataConnectionStatusInfo:",
"carrierBundleChange:"
)
"signalStrengthChanged:info:",
"cellChanged:cell:",
"connectionStateChanged:connection:dataConnectionStatusInfo:",
"carrierBundleChange:"
)
"signalStrengthChanged:info:",
"cellChanged:cell:",
"connectionStateChanged:connection:dataConnectionStatusInfo:",
"carrierBundleChange:"
)
"signalStrengthChanged:info:",
"cellChanged:cell:",
"connectionStateChanged:connection:dataConnectionStatusInfo:",
"carrierBundleChange:"
)
"signalStrengthChanged:info:",
"cellChanged:cell:",
"connectionStateChanged:connection:dataConnectionStatusInfo:",
"carrierBundleChange:"
)
"signalStrengthChanged:info:",
"cellChanged:cell:",
"connectionStateChanged:connection:dataConnectionStatusInfo:",
"carrierBundleChange:"
)
"signalStrengthChanged:info:",
"cellChanged:cell:",
"connectionStateChanged:connection:dataConnectionStatusInfo:",
"carrierBundleChange:"
)
"signalStrengthChanged:info:",
"cellChanged:cell:",
"connectionStateChanged:connection:dataConnectionStatusInfo:",
"carrierBundleChange:"
)
Debug -[TTTrackerSessionHandler setLaunchFrom:]: >>>> set launchFrom : 1
Debug -[TTTrackerStorageManager checkDBFile]: db
file:/Users/leishuai/Library/Developer/CoreSimulator/Devices/E682D2E1-0B99-433B-8310-C957353ABCA4/data/Containers/Data/
Application/82F3472B-F01D-4E5E-91C3-43C46503F975/Library/tracker.sqlite
Debug -[TTTrackerStorageManager checkDBFile]_block_invoke_2: rs :wal
Debug -[TTTrackerStorageManager checkV3DBFile]: v3db
file:/Users/leishuai/Library/Developer/CoreSimulator/Devices/E682D2E1-0B99-433B-8310-C957353ABCA4/data/Containers/Data/
Application/82F3472B-F01D-4E5E-91C3-43C46503F975/Library/tracker_v3.sqlite
Debug -[TTTrackerStorageManager checkV3DBFile]_block_invoke_4: rs :wal
Debug -[TTTrackerSessionHandler startSession:]: >>>>placeHolder terminate trackID BF663155-8BE6-4312-B93C-1A63908ADE1D
[I][Heimdallr] DB
Path:/Users/leishuai/Library/Developer/CoreSimulator/Devices/E682D2E1-0B99-433B-8310-C957353ABCA4/data/Containers/Data/
Application/82F3472B-F01D-4E5E-91C3-43C46503F975/Library/Heimdallr/heimdallr.db
flutter: Observatory listening on http://127.0.0.1:56145/OBeAO0DnZx0=/
"signalStrengthChanged:info:",
"cellChanged:cell:",
"connectionStateChanged:connection:dataConnectionStatusInfo:",
"carrierBundleChange:"
)
"signalStrengthChanged:info:",
"cellChanged:cell:",
"connectionStateChanged:connection:dataConnectionStatusInfo:",
"carrierBundleChange:"
)
"signalStrengthChanged:info:",
"cellChanged:cell:",
"connectionStateChanged:connection:dataConnectionStatusInfo:",
"carrierBundleChange:"
)
"signalStrengthChanged:info:",
"cellChanged:cell:",
"connectionStateChanged:connection:dataConnectionStatusInfo:",
"carrierBundleChange:"
)
"signalStrengthChanged:info:",
"cellChanged:cell:",
"connectionStateChanged:connection:dataConnectionStatusInfo:",
"carrierBundleChange:"
)
"signalStrengthChanged:info:",
"cellChanged:cell:",
"connectionStateChanged:connection:dataConnectionStatusInfo:",
"carrierBundleChange:"
)
"signalStrengthChanged:info:",
"cellChanged:cell:",
"connectionStateChanged:connection:dataConnectionStatusInfo:",
"carrierBundleChange:"
)
"signalStrengthChanged:info:",
"cellChanged:cell:",
"connectionStateChanged:connection:dataConnectionStatusInfo:",
"carrierBundleChange:"
)
00:00 +0: app test demo: (setUpAll)
[info ] FlutterDriver: Connecting to Flutter application at http://127.0.0.1:56145/OBeAO0DnZx0=/
[trace] FlutterDriver: Isolate found with number: 453306234
[trace] FlutterDriver: Isolate is paused at start.
[trace] FlutterDriver: Attempting to resume isolate
[trace] FlutterDriver: Waiting for service extension
flutter: Flutter_Router:init
flutter: version channel result: 1.3.0
[info ] FlutterDriver: Connected to Flutter application.
00:00 +0: app test demo: jump to mine_page
flutter: _leanCountDownShowFlag:true
flutter: user readFromDisk result: null
flutter: debug server:null
flutter: debug server:null
flutter: debug server:null
flutter: hwRatio:0.2915451895043732 height:111.37026239067056
flutter: _leanCountDownShowFlag:true
flutter: version channel result: 1.3.0
00:02 +1: app test demo: (tearDownAll)
00:02 +1: All tests passed!
Stopping application instance.

@leishuai

This comment has been minimized.

Copy link
Author

commented Jul 11, 2019

I also found the space that the image should occupy is collapsed.
Besides, when I try await DefaultAssetBundle.of(context).loadString("assets/datas/country.json"), I never get the future actual value.

@chunhtai

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2019

@leishuai

This comment has been minimized.

Copy link
Author

commented Jul 14, 2019

Besides again, such code works using PlatformAssetBundle. It can display the correct image.

ByteData byteData = await PlatformAssetBundle().load('assets/images/user_default_avatar.png');
_avatarImgData = byteData.buffer.asUint8List();
Image.memory(_avatarImgData).

It seems loadString/loadStructuredData's future never calls the 'then callback'

@leishuai

This comment has been minimized.

Copy link
Author

commented Jul 17, 2019

@chunhtai @jonahwilliams
After days of investigation, I've found that it may have the same cause with #24703. When the AssetManifest.json file size larger than 10 * 1024, it will call compute, then Isolate.spawn will be called which won't work for flutter drive. So images can NOT be displayed. However when AssetManifest.json file size smaller than 10*1024, then It works well. That's why image assets can be displayed for some certain apps.

@liyuqian

This comment has been minimized.

Copy link
Contributor

commented Jul 18, 2019

The issue seems to be a duplicate of #30641. But thanks to @leishuai, it seems that we got some really promising lead here. Thank you so much!

I'm closing this to re-route everyone to the earlier report of #30641 as this happened before v1.5.4.

@liyuqian liyuqian closed this Jul 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.