rive-app / rive-app/rive-flutter

Flutter app crashes on Android (0.14.0) - Too many open files

Open
#522 17 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug triage
Dominant language
Dart
Stars
1.5k
Forks
240
PR merge metrics
No merged PRs in 30d

Description

Description

My flutter app crashes on Android devices after remaining idle for some time. This happens when I use Factory.rive riveFactor instead of Factory.flutter. I use the feathering features on Rive and it is disabled when I use Factory.flutter.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Run the app on Android
  2. Load a rive file that has feathering enabled
  3. Wait a few seconds
  4. App will freeze and will be unusuable
Logs
E/flutter (29988): [ERROR:flutter/impeller/renderer/backend/vu
  lkan/swapchain/khr/khr_swapchain_impl_vk.cc(483)] Break on 
  'ImpellerValidationBreak' to inspect point of failure: Could not present 
  queue: ErrorInitializationFailed
  5
  E/RiveNative(29988): (12291) EGL_BAD_ALLOC - 
  ../../../../platform/android/rive_native_android.cpp:292
  E/ProcessState(29988): readDriverFeatureFile: cannot open 
  /dev/binderfs/features/extended_error: Too many open files
  E/GraphicBufferAllocator(29988): Failed to allocate (273 x 105) layerCount
   1 format 1 usage 40000000000300: -129
  E/BufferQueueProducer(29988): 
  [ImageReader-273x105f22m5-29988-36](id:752400000026,api:1,p:29988,c:29988)
   dequeueBuffer: createGraphicBuffer failed
  E/GraphicBufferAllocator(29988): Failed to allocate (273 x 105) layerCount
   1 format 1 usage 40000000000300: -129
  E/BufferQueueProducer(29988): 
  [ImageReader-273x105f22m5-29988-36](id:752400000026,api:1,p:29988,c:29988)
   dequeueBuffer: createGraphicBuffer failed
  E/RiveNative(29988): (12301) EGL_BAD_SURFACE - 
  ../../../../platform/android/rive_native_android.cpp:292
  5
  E/RiveNative(29988): (12291) EGL_BAD_ALLOC - 
  ../../../../platform/android/rive_native_android.cpp:292
  E/flutter (29988): [ERROR:flutter/impeller/renderer/backend/vulkan/swapcha
  in/khr/khr_swapchain_impl_vk.cc(208)] Break on 'ImpellerValidationBreak' 
  to inspect point of failure: Could not create swapchain: 
  ErrorNativeWindowInUseKHR
  E/Surface (29988): freeAllBuffers: 1 buffers were freed while being 
  dequeued!
  E/flutter (29988): [ERROR:flutter/impeller/renderer/backend/vulkan/swapcha
  in/khr/khr_swapchain_vk.cc(73)] Break on 'ImpellerValidationBreak' to 
  inspect point of failure: Could not update swapchain.
  2
  E/flutter (29988): 
  [ERROR:flutter/shell/gpu/gpu_surface_vulkan_impeller.cc(95)] No surface 
  available.
Expected behavior
  • It should not be crashing. The exact file and code works fine on iOS
Device & Versions (please complete the following information)
  • Device: Google Pixel 9a
  • OS: Android 16
  • Flutter Version:
Flutter 3.29.3 • channel [user-branch] • unknown source
Framework • revision ea121f8859 (5 months ago) • 2025-04-11 19:10:07 +0000
Engine • revision cf56914b32
Tools • Dart 3.7.2 • DevTools 2.42.3
  • Rive SDK version: rive: ^0.14.0-dev.6
Additional context

This only happens on Android. It works fine on iOS.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Android failure with a Rive file using feathering and Factory.rive, then compare it with Factory.flutter. Start at rive_native_android.cpp:292 and use the supplied Android logs to trace the failure; done means the app remains usable without the reported open-file, EGL, and swapchain errors while preserving the stated Android behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.