Don't swallow UnsatisfiedLinkError

When loading the library fails, the user will be faced with this error:

java.lang.UnsatisfiedLinkError: No implementation found for void org.webrtc.PeerConnectionFactory.nativeInitializeAndroidGlobals()

With no context, however.

Bug: webrtc:13619
Change-Id: I88565f085773ad1e8c2f5742d7fdba96fb6043d8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/253960
Reviewed-by: Christoffer Jansson <jansson@google.com>
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Commit-Queue: Xavier Lepaul‎ <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36150}
This commit is contained in:
Saúl Ibarra Corretgé 2022-03-08 14:11:36 +01:00 committed by WebRTC LUCI CQ
parent c7c5764eae
commit 775ce76b66

View File

@ -17,12 +17,9 @@ class NativeLibrary {
@Override
public boolean load(String name) {
Logging.d(TAG, "Loading library: " + name);
try {
System.loadLibrary(name);
} catch (UnsatisfiedLinkError e) {
Logging.e(TAG, "Failed to load native library: " + name, e);
return false;
}
System.loadLibrary(name);
// Not relevant, but kept for API compatibility.
return true;
}
}