@Override
public void handleException(Exception e) {
+ // Here is for handling runtime library not found,
+ // Should never happen if runtime is embedded.
+ if (libraryIsEmbedded()) throw new RuntimeException(e);
+
+ // XWalkView will handle UnsatisfiedLinkError which indicates mismatch of CPU architecture.
+ // So exception here should be either library not installed for shared mode or invoke error.
Exception toHandle = e;
- boolean wrongNativeLibraryAbi = false;
if (mRuntimeLoaded) {
toHandle = new XWalkRuntimeLibraryException(
XWalkRuntimeLibraryException.XWALK_RUNTIME_LIBRARY_INVOKE_FAILED, e);
} else {
if (!(e instanceof XWalkRuntimeLibraryException)) {
- Throwable rootCause = e;
- while (rootCause.getCause() != null && rootCause.getCause() != rootCause) {
- rootCause = rootCause.getCause();
- }
- // UnsatisfiedLinkError happens when the libxwalkcore.so is not found.
- // If the runtime library package exist, but the native library not, it can
- // be considered that the installed runtime lib apk is for another cpu
- // architecture.
- if (rootCause instanceof UnsatisfiedLinkError) {
- wrongNativeLibraryAbi = true;
- toHandle = new XWalkRuntimeLibraryException(
- XWalkRuntimeLibraryException.XWALK_CORE_LIBRARY_SO_NOT_EXIST, e);
- } else {
- toHandle = new XWalkRuntimeLibraryException(
- XWalkRuntimeLibraryException.XWALK_RUNTIME_LIBRARY_NOT_INSTALLED, e);
- }
+ toHandle = new XWalkRuntimeLibraryException(
+ XWalkRuntimeLibraryException.XWALK_RUNTIME_LIBRARY_NOT_INSTALLED, e);
}
}
- // Here is for handling runtime library not found or not match,
- // if library is embedded, should not invoke it.
- // Except the error is for incorrect abi, which could also happen for
- // embedded mode.
- if (!libraryIsEmbedded() || wrongNativeLibraryAbi) super.handleException(toHandle);
+ super.handleException(toHandle);
}
public FrameLayout get() {