Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Crash on OnePlus X (libtango_hal.so is missing) #7

Open
rafaelvcaetano opened this issue Aug 30, 2017 · 14 comments
Open

Crash on OnePlus X (libtango_hal.so is missing) #7

rafaelvcaetano opened this issue Aug 30, 2017 · 14 comments

Comments

@rafaelvcaetano
Copy link

rafaelvcaetano commented Aug 30, 2017

Sample app fails to initialize with the following stack trace:

E AndroidRuntime: FATAL EXCEPTION: main
E AndroidRuntime: Process: com.google.tango, PID: 22402
E AndroidRuntime: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.google.tango-1/base.apk"],nativeLibraryDirectories=[/data/app/com.google.tango-1/lib/arm, /system/fake-libs, /data/app/com.google.tango-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]] couldn't find "libtango_hal.so"
E AndroidRuntime:        at java.lang.Runtime.loadLibrary0(Runtime.java:984)
E AndroidRuntime:        at java.lang.System.loadLibrary(System.java:1562)
E AndroidRuntime:        at com.google.atap.tango.TangoVirtualHalService.<clinit>(TangoVirtualHalService.java:41)
E AndroidRuntime:        at java.lang.Class.newInstance(Native Method)
E AndroidRuntime:        at android.app.ActivityThread.handleCreateService(ActivityThread.java:3198)
E AndroidRuntime:        at android.app.ActivityThread.-wrap5(ActivityThread.java)
E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1586)
E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:102)
E AndroidRuntime:        at android.os.Looper.loop(Looper.java:154)
E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:6186)
E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
E AndroidRuntime:        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
W DropBoxManagerService: Dropping: data_app_crash (1388 > 0 bytes)
I OpenGLRenderer: Initialized EGL, version 1.4
D OpenGLRenderer: Swap behavior 1
I Unity   : windowFocusChanged: false```

This is the same error that appears when I attempt to run a project with the official"unitygar.aar"
@tomthecarrot
Copy link
Owner

From the log it looks like the sample app cannot load the Tango shared library. Did you install the ARCore Service? See the "Preparing your Device" section of Google's instructions https://developers.google.com/ar/develop/java/getting-started

@rafaelvcaetano
Copy link
Author

Yes. Also, I forgot to mention I'm running Lineage OS with Android 7.1.2

@rafaelvcaetano
Copy link
Author

rafaelvcaetano commented Aug 30, 2017

Found more information in the logcat that might prove useful:

I ActivityManager: Displayed com.tomthecarrot.helloar/com.unity3d.player.UnityPlayerActivity: +288ms
I TangoClientLibLoader: Pure Java path, not loading libtango_client_api.so at all.
D ApplicationLoaders: ignored Vulkan layer search path /data/app/com.google.tango-1/lib/arm:/system/fake-libs:/data/app/com.google.tango-1/base.apk!/lib/armeabi-v7a for namespace 0x82f21090```

@tomthecarrot
Copy link
Owner

Thanks for that info. not loading libtango_client_api.so at all is an interesting error. I don't remember seeing that in any other logs.

Also interesting that it's ignoring the Vulkan layer search path; I believe that the referenced path is the correct one for ARCore.

Did that log appear before the first log you posted?

@rafaelvcaetano
Copy link
Author

It happened before. Here is a full logcat since launch untill crash: https://pastebin.com/3eD1pu9d

@tomthecarrot
Copy link
Owner

Thanks for posting that. The following line indicates that the native library cannot find a suitable camera.

ndk_camera: Zero cameras detected. Camera system initialization complete

Can you ensure the camera permission (in Android App Settings) is enabled for both TangoCore and the sample app?

@rafaelvcaetano
Copy link
Author

Permissions were disabled for both apps (nice catch!) but the same error is still happening.

@tomthecarrot
Copy link
Owner

Could be Vulkan-specific. See #5

@tomthecarrot
Copy link
Owner

Added the known devices to a research document to try to isolate the issue. OnePlus X is the only device on the list with an Adreno 330, so it's possible that the architecture is currently unsupported. Let's try to fix that :)

@rafaelvcaetano
Copy link
Author

rafaelvcaetano commented Aug 31, 2017

I went a bit deeper into the problem and decompiled the arcore-preview.apk. Inside I found some methods that check if the current device is one of the supported. You can find this method:

private static boolean deviceCalibrationAvailable()
{
    return (Build.FINGERPRINT.contains("sailfish:7")) || (Build.FINGERPRINT.contains("sailfish:O")) || (Build.FINGERPRINT.contains("sailfish:8")) || (Build.FINGERPRINT.contains("marlin:7")) || (Build.FINGERPRINT.contains("marlin:O")) || (Build.FINGERPRINT.contains("marlin:8")) || (Build.FINGERPRINT.contains("walleye:O")) || (Build.FINGERPRINT.contains("walleye:8")) || (Build.FINGERPRINT.contains("taimen:O")) || (Build.FINGERPRINT.contains("taimen:8")) || (Build.FINGERPRINT.contains("SC-02J/SC-02J:7")) || (Build.FINGERPRINT.contains("SCV36_jp_kdi/SCV36:7")) || (Build.FINGERPRINT.contains("dreamqlteue/dreamqlteue:7")) || (Build.FINGERPRINT.contains("dreamqltesq/dreamqltesq:7")) || (Build.FINGERPRINT.contains("dreamqlteldusq/dreamqltesq:7")) || (Build.FINGERPRINT.contains("dreamqltezm/dreamqltecmcc:7")) || (Build.FINGERPRINT.contains("dreamqltevl/dreamqltecan:7")) || (isSupportedExynosDevice());
}

These translate to the following:

  • Salfish - Pixel
  • Marlin - Pixel XL
  • Taimen - Pixel 2 (apparently)
  • Walleye - Pixel 2 XL (apparently)
  • All others - Galaxy S8 variants

These methods are inside the class com.google.atap.tangoservice.SupportedDevices and is accessed by com.google.tango.jni.TangoCameraNative on its initialize() method. So, I would say that this is a pretty decent place to start looking. Unfortunately I'm not experienced with recompiling jars and APKs. @tomthecarrot do you think you can take a look at it?

@tomthecarrot
Copy link
Owner

Thanks for your research! I'll look into it now. Your information is useful for this idea.

This was referenced Sep 1, 2017
@tomthecarrot
Copy link
Owner

tomthecarrot commented Sep 1, 2017

I built an early version of a modified ARCore Service, which seems to be functional without per-app modifications, all on my "unsupported" device.

Please try it on your device and let me know if it works. You'll need to uninstall the existing "Tango Core" first. Thanks!

@rafaelvcaetano
Copy link
Author

Thanks for your effort! Unfortunately the same error is still occurring.

@cleitner
Copy link

cleitner commented Sep 9, 2017

I have the same couldn't find "libtango_hal.so" error on the bq Aquaris X5 Plus. I suspect the error in this case is an unsupported CPU, because the arcore-preview(-modified).apk only contains arm64 precompiled libraries and my phone has an armv7l CPU.

09-09 14:03:38.820  2790  4426 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.google.ar.core.examples.java.helloar/.HelloArActivity (has extras)} from uid 10113 on display 0
09-09 14:03:38.826  2790  4426 D ActivityTrigger: ActivityTrigger activityPauseTrigger 
09-09 14:03:38.857  4346  4349 E ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only
09-09 14:03:38.890 27157 27157 E SupportedDevices: Device calibration unavailable. Just kidding! ;)
09-09 14:03:38.893 27157 27157 I tango_camera_native_jni: Attaching texture_window 0x90daa008
09-09 14:03:38.893 27157 27157 D TangoVhs: about to bind as vhs
09-09 14:03:38.898 21151 21151 I ServiceManager: Waiting for service AtCmdFwd...
09-09 14:03:38.910  2790  2800 I ActivityManager: Start proc 27917:com.google.tango/u0a160 for service com.google.tango/com.google.atap.tango.TangoVirtualHalService
09-09 14:03:38.910 27157 27157 D TangoVhs: finished bind as vhs
09-09 14:03:38.974 27917 27917 D AndroidRuntime: Shutting down VM
09-09 14:03:38.975 27917 27917 E AndroidRuntime: FATAL EXCEPTION: main
09-09 14:03:38.975 27917 27917 E AndroidRuntime: Process: com.google.tango, PID: 27917
09-09 14:03:38.975 27917 27917 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.google.tango-1/base.apk"],nativeLibraryDirectories=[/data/app/com.google.tango-1/lib/arm, /system/fake-libs, /data/app/com.google.tango-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]] couldn't find "libtango_hal.so"
09-09 14:03:38.975 27917 27917 E AndroidRuntime: 	at java.lang.Runtime.loadLibrary0(Runtime.java:984)
09-09 14:03:38.975 27917 27917 E AndroidRuntime: 	at java.lang.System.loadLibrary(System.java:1530)
09-09 14:03:38.975 27917 27917 E AndroidRuntime: 	at com.google.atap.tango.TangoVirtualHalService.<clinit>(TangoVirtualHalService.java:41)
09-09 14:03:38.975 27917 27917 E AndroidRuntime: 	at java.lang.Class.newInstance(Native Method)
09-09 14:03:38.975 27917 27917 E AndroidRuntime: 	at android.app.ActivityThread.handleCreateService(ActivityThread.java:3173)
09-09 14:03:38.975 27917 27917 E AndroidRuntime: 	at android.app.ActivityThread.-wrap5(ActivityThread.java)
09-09 14:03:38.975 27917 27917 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1567)
09-09 14:03:38.975 27917 27917 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:102)
09-09 14:03:38.975 27917 27917 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:154)
09-09 14:03:38.975 27917 27917 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6119)
09-09 14:03:38.975 27917 27917 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
09-09 14:03:38.975 27917 27917 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
09-09 14:03:38.975 27917 27917 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants