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
This commit is contained in:
Gray Mackall
2024-03-20 09:37:09 -07:00
committed by GitHub
parent e7fe34d3d1
commit 2e5a69f82c

View File

@@ -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);
}