Sentry Answers>Flutter>

Flutter Initialization Failed

Flutter Initialization Failed

Manoel Aranda Neto

The ProblemJump To Solution

When building an Android APK with a segmented —target-platform argument.

Click to Copy
flutter build apk --target-platform=android-arm
Click to Copy
FlutterLoader: Flutter initialization failed. java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dlopen failed: library "" not found. at at java.util.concurrent.FutureTask.get( at io.flutter.embedding.engine.f.c.b(Unknown Source:23) at io.flutter.embedding.engine.a.<init>(Unknown Source:158) at io.flutter.embedding.engine.a.<init>(Unknown Source:16) at Source:106) at Source:7) at Source:20) at at at at at at at at at$H.handleMessage( at android.os.Handler.dispatchMessage( at android.os.Looper.loop( at at java.lang.reflect.Method.invoke(Native Method) at$ at

When an Android App bundles multiple native libraries for multiple ABIs, the —target-platform only splits out Flutter’s native library and not the App’s native libraries.

Flutter’s build system only includes the for the targeted platform to the final APK. But the App’s native libraries still contain the native libraries for every platform, so when running an APK in compatible mode (64 bit device using 32 bit APK), it’s not able to load Flutter’s native library (as it’s missing).

The Solution

Click to Copy
flutter build apk --target-platform=android-arm --split-per-abi

The —split-per-abi argument should be used as well.

Flutter’s build system splits out the App’s native libraries as well (in addition to Flutter’s native library), so when running an APK in compatible mode (64 bit device using 32 bit APK), it’d still be able to load the native libraries correctly.

Further Reading

  • ResourcesSentry vs. Crashlytics: The Mobile Developer's Decision-Making Guide
  • logo
    Listen to the Syntax Podcast

    Tasty Treats for Web Developers brought to you by Sentry. Web development tips and tricks hosted by Wes Bos and Scott Tolinski

    Listen to Syntax

Loved by over 4 million developers and more than 90,000 organizations worldwide, Sentry provides code-level observability to many of the world’s best-known companies like Disney, Peloton, Cloudflare, Eventbrite, Slack, Supercell, and Rockstar Games. Each month we process billions of exceptions from the most popular products on the internet.

© 2024 • Sentry is a registered Trademark
of Functional Software, Inc.