Skip to content

Flutter 3.32.1 causing some ANR [libflutter.so] dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&, dart::Array const&) #169906

Closed

Description

@alihassan143

Steps to reproduce

i cannot reproduce this on my end but getting in playstore

  #00  pc 0x00000000005c0f9c  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #01  pc 0x000000000084c2b0  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #02  pc 0x000000000084c084  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #03  pc 0x000000000084bfe8  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #04  pc 0x000000000086e2f4  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #05  pc 0x000000000040f9ac  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #06  pc 0x000000000040fe54  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #07  pc 0x000000000040fd28  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #08  pc 0x000000000040d28c  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #09  pc 0x0000000000410500  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #10  pc 0x000000000041046c  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #11  pc 0x000000000040f9ac  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #12  pc 0x000000000040fe54  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #13  pc 0x000000000040fd28  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #14  pc 0x000000000040d28c  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #15  pc 0x000000000040cf7c  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #16  pc 0x000000000040cee8  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #17  pc 0x000000000040c9e4  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #18  pc 0x000000000040c8d8  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #19  pc 0x000000000040c89c  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #20  pc 0x00000000003f3bdc  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libapp.so (BuildId: e4f372b4bb13d40e3dca0eab6993ae86)
  #21  pc 0x00000000008d83e4  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libflutter.so (dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&, dart::Array const&)) (BuildId: 9ec216ce9544799f53126039938e2b66e6d4ca1a)
  #22  pc 0x0000000000a1f56c  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libflutter.so (Dart_InvokeClosure) (BuildId: 9ec216ce9544799f53126039938e2b66e6d4ca1a)
  #23  pc 0x000000000083b6fc  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libflutter.so (tonic::DartMicrotaskQueue::RunMicrotasks()) (BuildId: 9ec216ce9544799f53126039938e2b66e6d4ca1a)
  #24  pc 0x00000000004cf4f8  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libflutter.so (fml::MessageLoopImpl::RunExpiredTasksNow()) (BuildId: 9ec216ce9544799f53126039938e2b66e6d4ca1a)
  #25  pc 0x00000000004d2f78  /data/app/~~mXtSLSqnTy4YPR-yLbSr9Q==/com.example.app-bxwQ8N-xg1zi7FYQ0edOtQ==/lib/arm64/libflutter.so (fml::MessageLoopAndroid::MessageLoopAndroid()::$_0::__invoke(int, int, void*)) (BuildId: 9ec216ce9544799f53126039938e2b66e6d4ca1a)
  #26  pc 0x0000000000018224  /system/lib64/libutils.so (android::Looper::pollInner+1060)
  #27  pc 0x0000000000017da0  /system/lib64/libutils.so (android::Looper::pollOnce+112)
  #28  pc 0x0000000000162d0c  /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce+44)
  at android.os.MessageQueue.nativePollOnce (Native method)
  at android.os.MessageQueue.next (MessageQueue.java:335)
  at android.os.Looper.loopOnce (Looper.java:161)
  at android.os.Looper.loop (Looper.java:288)
  at android.app.ActivityThread.main (ActivityThread.java:8194)
  at java.lang.reflect.Method.invoke (Native method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:703)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:911)

Expected results

App should not crash

Actual results

Image

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.32.1, on macOS 15.5 24F74 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0-rc4)
[✓] Xcode - develop for iOS and macOS (Xcode 16.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.3)
[✓] VS Code (version 1.100.2)
[✓] Connected device (2 available)
[✓] Network resources

• No issues found!

Activity

  1. mraleph commented on Jun 3, 2025

    @mraleph
    Member

    You would need to symbolize libapp.so frames using symbols available in your build. Otherwise it is impossible to say what is going on.

  2. alihassan143 commented on Jun 3, 2025

    @alihassan143
    Author

    @mraleph but libapp.so did not contain any symbols how do I do that

  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    and removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jun 3, 2025
  4. tirth-patel-nc commented on Jun 3, 2025

    @tirth-patel-nc
  5. mraleph commented on Jun 3, 2025

    @mraleph
    Member

    @alihassan143 disable stripping, e.g. flutter build apk --release --extra-gen-snapshot-options=--no-strip or use --split-debug-info=symbols-dir which would produce necessary symbols into symbols-dir

  6. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jun 3, 2025
  7. alihassan143 commented on Jun 3, 2025

    @alihassan143
    Author

    @alihassan143 disable stripping, e.g. flutter build apk --release --extra-gen-snapshot-options=--no-strip or use --split-debug-info=symbols-dir which would produce necessary symbols into symbols-dir

    currently i am getting this issue in production app and currently I don't have live bundle symbols
    but I can create new bundle and provide that symobls is that will work ?

  8. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jun 3, 2025
  9. mraleph commented on Jun 3, 2025

    @mraleph
    Member

    Symbols from the current version of the app will not help. But builds are reproducible so if you can go back to the source code state from which you built your released version of the app and rebuild with provided flags then symbols should match.

  10. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jun 3, 2025
  11. delfme commented on Jun 15, 2025

    @delfme

    @aykutuludag @alihassan143 please provide as much information as possible to help debug the ANR issue. This is a critical matter—when the app is affected by ANRs, Google lowers its ranking and reduces its visibility on the Play Store.

  12. alihassan143 commented on Jun 15, 2025

    @alihassan143
    Author

    @delfme currently we don't have live version symbols so we cannot provide much information but it started happening after 3.24.5 flutter version because later versions have default Impeller on android is enabled and that are mostly happening where android webview or platform views are used like google admob I know its not google admob where webview and platform views are used

  13. 6 remaining items

  14. alihassan143 commented on Jun 16, 2025

    @alihassan143
    Author

    Image

    Image

    Image

    Image

    @tirth-patel-nc
    devices currently getting this crash

  15. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jun 16, 2025
  16. mraleph commented on Jun 16, 2025

    @mraleph
    Member

    The only information that is going to help is to symbolize the stack trace. I somewhat doubt that this is related to Impeller because ANR is in the Dart code - which most likely indicates long running (or infinite) loop in the Dart code. It is quite likely that this was already a bug in the code (quite possibly in your own code) but it was simply unnoticed until threads got merged. But hard to actually say without symbols.

    @alihassan143 Is it correct to say that the crashing version of the app is not built with --split-debug-info/--obfuscate? (I assume that this is the case given that you say you don't have symbols saved for it). If that's the case we can actually symbolize the stack trace if we have the APK itself. Could you provide either the crashing APK or the Play package id and version? I can then manually symbolize it using the symbolic information from the Dart snapshot.

  17. mraleph commented on Jun 16, 2025

    @mraleph
    Member

    @alihassan143 is it the most recently released version or some other version? (Currently released version is 2.2.0, as I see).

  18. alihassan143 commented on Jun 16, 2025

    @alihassan143
    Author

    Image
    @mraleph that is using the 3.32.0 and that is currently live

  19. mraleph commented on Jun 16, 2025

    @mraleph
    Member

    Ok, here is symbolization using the information available in the snapshot:

    Crc32.compute
    BinaryReaderImpl.readFrame
    FrameHelper.framesFromBytes
    FrameIoHelper.framesFromFile
    _SuspendState._createAsyncStarCallback.<anonymous closure>
    _RootZone.runUnary
    _FutureListener.handleValue
    _Future._propagateToListeners.handleValueCallback
    _Future._propagateToListeners
    _Future._completeWithResultOf
    _Future._propagateToListeners.handleWhenCompleteCallback.<anonymous closure>
    _RootZone.runUnary
    _FutureListener.handleValue
    _Future._propagateToListeners.handleValueCallback
    _Future._propagateToListeners
    _Future._completeWithValue
    _Future._asyncCompleteWithValue.<anonymous closure>
    _microtaskLoop
    _startMicrotaskLoop
    _startMicrotaskLoop
    

    Quick search reveals that this code is from Hive package. You will have to debug it from here - there is either a bug in Hive which causes it to loop infinitely or it is simply doing too much work (e.g. possibly you are storing too much data in Hive?).

    Fundamentally these ANRs are consequence of thread merging. TLDR is that your code is doing too much work synchronously in the main UI isolate. Native tooling previously did not detect these as ANRs - because UI isolate was running on a different thread, however your app was nevertheless not responsive (user is unable to interact with it, and Flutter UI is effectively frozen when UI isolate is blocked). Now that the threads are merged you are blocking the main thread and native tooling correctly identifies this as ANR.

    As a temporary solution you can opt out of thread merging - but this opt-out will go away in the future. Instead you should understand places where you perform a lot of work synchronously and either split it into small pieces or move it to another isolate.

    That being said it is not a Flutter bug - it is working as intended.

  20. alihassan143 commented on Jun 16, 2025

    @alihassan143
    Author

    Ok, here is symbolization using the information available in the snapshot:

    Crc32.compute
    BinaryReaderImpl.readFrame
    FrameHelper.framesFromBytes
    FrameIoHelper.framesFromFile
    _SuspendState._createAsyncStarCallback.<anonymous closure>
    _RootZone.runUnary
    _FutureListener.handleValue
    _Future._propagateToListeners.handleValueCallback
    _Future._propagateToListeners
    _Future._completeWithResultOf
    _Future._propagateToListeners.handleWhenCompleteCallback.<anonymous closure>
    _RootZone.runUnary
    _FutureListener.handleValue
    _Future._propagateToListeners.handleValueCallback
    _Future._propagateToListeners
    _Future._completeWithValue
    _Future._asyncCompleteWithValue.<anonymous closure>
    _microtaskLoop
    _startMicrotaskLoop
    _startMicrotaskLoop
    

    Quick search reveals that this code is from Hive package. You will have to debug it from here - there is either a bug in Hive which causes it to loop infinitely or it is simply doing too much work (e.g. possibly you are storing too much data in Hive?).

    Fundamentally these ANRs are consequence of thread merging. TLDR is that your code is doing too much work synchronously in the main UI isolate. Native tooling previously did not detect these as ANRs - because UI isolate was running on a different thread, however your app was nevertheless not responsive (user is unable to interact with it, and Flutter UI is effectively frozen when UI isolate is blocked). Now that the threads are merged you are blocking the main thread and native tooling correctly identifies this as ANR.

    As a temporary solution you can opt out of thread merging - but this opt-out will go away in the future. Instead you should understand places where you perform a lot of work synchronously and either split it into small pieces or move it to another isolate.

    That being said it is not a Flutter bug - it is working as intended.

    thanks for the clarification

  21. added
    r: solvedIssue is closed as solved
    r: invalidIssue is closed as not valid
    and removed
    in triagePresently being triaged by the triage team
    r: solvedIssue is closed as solved
    on Jun 16, 2025
  22. github-actions commented on Jun 30, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  23. locked as resolved and limited conversation to collaborators on Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: invalidIssue is closed as not valid

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions