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

[Deferred components] Always stuck when executing loadLibrary() #145876

Open
mrhabibi opened this issue Mar 28, 2024 · 9 comments
Open

[Deferred components] Always stuck when executing loadLibrary() #145876

mrhabibi opened this issue Mar 28, 2024 · 9 comments
Labels
engine flutter/engine repository. See also e: labels. P2 Important issues not at the top of the work list platform-android Android applications specifically team-android Owned by Android platform team triaged-android Triaged by Android platform team

Comments

@mrhabibi
Copy link

mrhabibi commented Mar 28, 2024

Steps to reproduce

Simply following https://docs.flutter.dev/perf/deferred-components on a simple flutter app, and upload the AAB to internal app sharing. (No issue when testing locally using bundletool)

Install the app and open the app normally, and when downloading the dynamic module, it's stuck on infinite loading (while executing loadLibrary()). When force closing the app, the dynamic module is listed as downloaded. When reopening the app, the app's stuck on the splash screen and can never be opened again (the loadLibrary() is now done in startup because the dynamic module has been downloaded).

Notes:

  • Obfusaction active or not has no impact.
  • Emulator or real device has no impact.
  • I've made some Android apps before with Play Core SDK but never got this kind of issue
  • The code is stuck when executing loadLibrary()

Expected results

loadLibrary() can be finished bringing the downloaded dynamic module and I can normally use the feature inside the dynamic module.

Actual results

Stuck on infinite loading when executing loadLibrary() regardless the dynamic module has been downloaded or not.

Code sample

Content of deferred_components_loading_units.yaml
loading-units:
  - id: 2
    libraries:
      - package:example/navigation/other_entry.dart
      - package:example/navigation/other_module.dart
      - package:example/page/deferred_page.dart
      - package:example/page/deferred_tab.dart
      - package:example/page/deferred_component.dart
Minimum reproducible example repository

https://github.com/mrhabibi/deferred_component_example

Screenshots or Video

Video demonstration
evidence.mp4

Logs

Suspicious logs
2024-03-28 08:37:50.233  4960-4960  ziparchive              com.bukalapak.seller.android         W  Unable to open '/data/app/~~v4oL6MBa3Rdrm2NQkMZjHQ==/com.bukalapak.seller.android-LC5xaYbuBfQ3c8ssY89HwQ==/split_other.dm': No such file or directory
2024-03-28 08:37:50.233  4960-4960  ziparchive              com.bukalapak.seller.android         W  Unable to open '/data/app/~~v4oL6MBa3Rdrm2NQkMZjHQ==/com.bukalapak.seller.android-LC5xaYbuBfQ3c8ssY89HwQ==/split_other.dm': No such file or directory
2024-03-28 08:37:50.235  4960-4960  ziparchive              com.bukalapak.seller.android         W  Unable to open '/data/app/~~v4oL6MBa3Rdrm2NQkMZjHQ==/com.bukalapak.seller.android-LC5xaYbuBfQ3c8ssY89HwQ==/split_other.config.arm64_v8a.dm': No such file or directory
2024-03-28 08:37:50.235  4960-4960  ziparchive              com.bukalapak.seller.android         W  Unable to open '/data/app/~~v4oL6MBa3Rdrm2NQkMZjHQ==/com.bukalapak.seller.android-LC5xaYbuBfQ3c8ssY89HwQ==/split_other.config.arm64_v8a.dm': No such file or directory
2024-03-28 08:37:50.237  4960-4960  .seller.android         com.bukalapak.seller.android         W  Entry not found
2024-03-28 08:37:50.237  4960-4960  ziparchive              com.bukalapak.seller.android         W  Unable to open '/data/app/~~v4oL6MBa3Rdrm2NQkMZjHQ==/com.bukalapak.seller.android-LC5xaYbuBfQ3c8ssY89HwQ==/split_other.config.xxhdpi.dm': No such file or directory
2024-03-28 08:37:50.237  4960-4960  ziparchive              com.bukalapak.seller.android         W  Unable to open '/data/app/~~v4oL6MBa3Rdrm2NQkMZjHQ==/com.bukalapak.seller.android-LC5xaYbuBfQ3c8ssY89HwQ==/split_other.config.xxhdpi.dm': No such file or directory
2024-03-28 08:37:50.237  4960-4960  .seller.android         com.bukalapak.seller.android         W  Entry not found

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.7.12, on macOS 14.4.1 23E224 darwin-arm64, locale en-ID)
    • Flutter version 3.7.12 on channel stable at /Users/mrhabibi/flutter/3.7
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4d9e56e694 (12 months ago), 2023-04-17 21:47:46 -0400
    • Engine revision 1a65d409c7
    • Dart version 2.19.6
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/mrhabibi/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/mrhabibi/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.14.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

[!] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio 2.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] VS Code (version 1.87.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.84.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 14.4.1 23E224 darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 123.0.6312.87

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.
@mrhabibi mrhabibi changed the title [Deferred component] Always stuck after downloading the dynamic module [Deferred components] Always stuck after downloading the dynamic module Mar 28, 2024
@mrhabibi
Copy link
Author

mrhabibi commented Mar 28, 2024

I've made a repository to reproduce the issue: https://github.com/mrhabibi/deferred_component_example which following the deferred component guideline.

The loadLibrary() is never finished regardless the boxComponent module has been downloaded or not

@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Mar 28, 2024
@darshankawar
Copy link
Member

@mrhabibi
You are on very old version of stable, can you upgrade to latest (3.19.4) and re-run your scenario to check if the reported behavior still persists or not ?

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 28, 2024
@mrhabibi
Copy link
Author

mrhabibi commented Apr 1, 2024

Hi @darshankawar, thanks for your suggestion, I'm using flutter 3.7.12 to maintain the project which hasn't been ready to use the newer version.

But after I adapt the flutter 3.19.5 SDK on my example repository (the changes have been pushed as well) and I uploaded the AAB to the internal app sharing, the problem still persists.

So I guess flutter version isn't the culprit, seems like I miss adding a small config to make the deferred component works.

Here's the screen recording showing it's stuck when executing loadLibrary():

screencast-Genymotion-2024-04-01_11.01.22.39.webm
Here's my new flutter doctor output
[✓] Flutter (Channel stable, 3.19.5, on macOS 14.4.1 23E224 darwin-arm64, locale en-ID)
    • Flutter version 3.19.5 on channel stable at /Users/mrhabibi/flutter/3.19
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 300451adae (4 days ago), 2024-03-27 21:54:07 -0500
    • Engine revision e76c956498
    • Dart version 3.3.3
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/mrhabibi/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/mrhabibi/Library/Android/sdk
    • Java binary at: /Applications/Android Studio 2.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.14.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

[✓] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio 2.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.87.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.84.0

[✓] Connected device (3 available)            
    • A50 (mobile)    • 127.0.0.1:6555 • android-arm64  • Android 13 (API 33)
    • macOS (desktop) • macos          • darwin-arm64   • macOS 14.4.1 23E224 darwin-arm64
    • Chrome (web)    • chrome         • web-javascript • Google Chrome 123.0.6312.87

[✓] Network resources
    • All expected network resources are available.

• No issues found!

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 1, 2024
@mrhabibi mrhabibi changed the title [Deferred components] Always stuck after downloading the dynamic module [Deferred components] Always stuck when executing loadLibrary() Apr 1, 2024
@darshankawar
Copy link
Member

Thanks for the update.
Please check if your issue resembles #97149 or not.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 1, 2024
@mrhabibi
Copy link
Author

mrhabibi commented Apr 1, 2024

@darshankawar after reading the issue until the last reply, I think it's a bit different where my issue occurs every time since the first download, where the issue you mentioned occurs next app launch after the first successful download.

I've tried some solutions given on the replies, but unfortunately none works.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 1, 2024
@darshankawar darshankawar added platform-android Android applications specifically engine flutter/engine repository. See also e: labels. team-android Owned by Android platform team and removed in triage Presently being triaged by the triage team labels Apr 2, 2024
@gmackall gmackall added P2 Important issues not at the top of the work list triaged-android Triaged by Android platform team labels Apr 11, 2024
@gmackall
Copy link
Member

from android triage: @darshankawar were ever able to reproduce this following the getting started documentation?

@darshankawar
Copy link
Member

were ever able to reproduce this following the getting started documentation?

@gmackall Hello, no, I wasn't able to replicate it. I tried locally in release mode but maybe we need to upload it on playstore and then install it on device to check if it persists or not.

@mrhabibi
Copy link
Author

but maybe we need to upload it on playstore and then install it on device to check if it persists or not.

Exactly that's where the problem occurs, I couldn't reproduce the problem as well when testing locally with bundletool.jar based on this.

@MICKEY88661
Copy link

I am facing the same problem here.
I could found the same warning in the logcat
Unable to open '/data/app/~~edDJVlV2ZaNE5FTk6JVTHw==/com.xxxM2jqH0QDHEcImNlUFFuO1A==/split_audiosComponent.dm': No such file or directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine flutter/engine repository. See also e: labels. P2 Important issues not at the top of the work list platform-android Android applications specifically team-android Owned by Android platform team triaged-android Triaged by Android platform team
Projects
None yet
Development

No branches or pull requests

4 participants