Vendor apk cannot find libbinder - AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "libbinder.so" not found

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Vendor apk cannot find libbinder - AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "libbinder.so" not found

Rafał Kanus

Hi,

I try to build vendor application in AOSP version 9 which will communicate with vendor service over /dev/vndbinder.
I have vendor service running and I can communication with it from native executable program.
However I cannot do that from Java application. The app is building but I get UnsatisfiedLinkError with libbinder.so at runtime.

Here is my Android.mk for JNI library which do binder calls to my vendor service.

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE := libfoo_jni
LOCAL_PROPRIETARY_MODULE := true
LOCAL_SRC_FILES += com_example_fooapp_MainActivity.cpp
LOCAL_HEADER_LIBRARIES += jni_headers
LOCAL_SHARED_LIBRARIES :=   liblog \
                           libutils \
                           libbinder
LOCAL_CFLAGS := -Wall -Werror

include $(BUILD_SHARED_LIBRARY)

and here is Android.mk for Application
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES := $(call all-java-files-under,src)
LOCAL_JNI_SHARED_LIBRARIES := libfoo_jni
LOCAL_PACKAGE_NAME := FooApp

LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res

LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_APPS)

LOCAL_USE_AAPT2 := true

LOCAL_MODULE_TAGS := samples


LOCAL_PROPRIETARY_MODULE
:= true
LOCAL_VENDOR_MODULE := true
LOCAL_USE_VNDK:=true

LOCAL_CERTIFICATE := platform

LOCAL_PROGUARD_ENABLED := disabled
include $(BUILD_PACKAGE)

I know that libbinder is private library and cannot be link by applications developed in Android Studio.
However I am creating vendor application which should be able to use all vendor services.
How can I use binder interface in vendor Java application?





07-13 13:17:34.229  4397  4397 D libnativeloader: classloader namespace configured for unbundled vendor apk. library_path=/vendor/app/FooApp/lib/arm64:/vendor/app/FooApp/FooApp.apk!/lib/arm64-v8a:/vendor/lib64
07-13 13:17:34.236  4397  4397 W .example.fooap: JIT profile information will not be recorded: profile file does not exits.
07-13 13:17:34.269  4397  4397 D AndroidRuntime: Shutting down VM
07-13 13:17:34.270  4397  4397 E AndroidRuntime: FATAL EXCEPTION: main
07-13 13:17:34.270  4397  4397 E AndroidRuntime: Process: com.example.fooapp, PID: 4397
07-13 13:17:34.270  4397  4397 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "libbinder.so" not found
07-13 13:17:34.270  4397  4397 E AndroidRuntime:     at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
07-13 13:17:34.270  4397  4397 E AndroidRuntime:     at java.lang.System.loadLibrary(System.java:1669)
07-13 13:17:34.270  4397  4397 E AndroidRuntime:     at com.example.fooapp.MainActivity.<clinit>(MainActivity.java:38)

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/0b31eb26-dd56-4e05-8ec3-a8a9942769bco%40googlegroups.com.