From 2e5a69f82c77c076af53964fe76573dc33e45b5e Mon Sep 17 00:00:00 2001 From: Gray Mackall <34871572+gmackall@users.noreply.github.com> Date: Wed, 20 Mar 2024 09:37:09 -0700 Subject: [PATCH] Add even more logging for UnsatisfiedLinkError (flutter/engine#51554) follow up to https://github.com/flutter/engine/pull/51534#discussion_r1532301441 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- .../flutter/embedding/engine/loader/FlutterLoader.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/loader/FlutterLoader.java b/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/loader/FlutterLoader.java index 55ae4f20f7..5e800e80f3 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/loader/FlutterLoader.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/loader/FlutterLoader.java @@ -196,7 +196,8 @@ public class FlutterLoader { // cpu architecture. String cpuArch = System.getProperty("os.arch"); - String[] nativeLibs = new File(flutterApplicationInfo.nativeLibraryDir).list(); + File nativeLibsDir = new File(flutterApplicationInfo.nativeLibraryDir); + String[] nativeLibsContents = nativeLibsDir.list(); throw new UnsupportedOperationException( "Could not load libflutter.so this is possibly because the application" @@ -205,8 +206,10 @@ public class FlutterLoader { + " for more detail.\n" + "App is using cpu architecture: " + cpuArch - + ", and the native libraries directory contains the following files: " - + Arrays.toString(nativeLibs), + + ", and the native libraries directory (with path " + + nativeLibsDir.getAbsolutePath() + + ") contains the following files: " + + Arrays.toString(nativeLibsContents), unsatisfiedLinkError); }