Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot load WebView: java.lang.UnsatisfiedLinkError, library is 64-bit instead of 32-bit

I start an Activity which has android native webView(android.webkit.WebView), I get the following error in 64-bit device.

error instantiating provider                                                                 java.lang.RuntimeException: Cannot load WebView
at org.chromium.android_webview.AwBrowserProcess.loadLibrary(AwBrowserProcess.java:52)

Caused by: org.chromium.base.library_loader.ProcessInitException

Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.google.android.webview-1/lib/arm/libwebviewchromium.so" is 32-bit instead of 64-bit

Please provide some valuable suggestions.

like image 227
Shijil Avatar asked Jul 01 '16 13:07

Shijil


Video Answer


1 Answers

I just ran into the same error when running tests on a remote device in a device farm. It was a Samsung S6 device running Android 6. I don't think either is particularly specific and this issue is likely to happen on various devices and OS versions.

Our automated tests were failing with the same error:

Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.google.android.webview-1/lib/arm/libwebviewchromium.so" is 32-bit instead of 64-bit
at java.lang.Runtime.loadLibrary(Runtime.java:372)

These errors have been happening for several days. I managed to connect onto the device interactively and found our app wouldn't start on it. I then checked in Google Play and discovered there were various updates pending, including one for the Android System WebView, which had been last updated 31 weeks ago.

I decided to update that one item and then tried running our app again. Our app now works.

The clue was the discussion in the link provided by @Ironman above
https://bugs.chromium.org/p/chromium/issues/detail?id=547842 which included a device that had been upgraded from a 32-bit OS to a 64-bit OS but somehow Google Play was still sending a 32-bit binary of the WebView. No matter... what was key was the problem was related to an old, incorrect version of the binary for the WebView component.

BTW I think the problem surfaced when we updated various components and gradle in our app's gradle configuration. https://github.com/kiwix/kiwix-android/commit/1e03a4ae72f8fe5a9a133913e110add7f3a37631

04-12 17:40:09.605  7979  7979 E dex2oat : Failed to create oat file: /data/dalvik-cache/arm64/data@[email protected]@[email protected]: Permission denied
04-12 17:40:09.615  7946  7946 W art     : Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.google.android.webview-1/base.apk --oat-file=/data/dalvik-cache/arm64/data@[email protected]@[email protected]) because non-0 exit status
04-12 17:40:09.715  7946  7946 E cr_LibraryLoader: Unable to load library: webviewchromium
04-12 17:40:09.715  7946  7946 E WebViewFactory: error instantiating provider
04-12 17:40:09.715  7946  7946 E WebViewFactory: java.lang.reflect.InvocationTargetException
-- cut --
04-12 17:40:09.715  7946  7946 E WebViewFactory: Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.google.android.webview-1/lib/arm/libwebviewchromium.so" is 32-bit instead of 64-bit
-- cut --
04-12 17:40:09.725  7946  7946 E AndroidRuntime: Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.google.android.webview-1/lib/arm/libwebviewchromium.so" is 32-bit instead of 64-bit
like image 60
JulianHarty Avatar answered Sep 29 '22 02:09

JulianHarty