A question using shared library(.so) on the system app

1,179 views
Skip to first unread message

Onesang You

unread,
Apr 9, 2021, 10:54:18 AM4/9/21
to android-porting
Hello,

I am currently developing using a shared library(.so) from a system app (frameworks/base/packages/SystemUI).

However, there is a problem using the shared library(.so) that the system app cannot find lib.so file.

Is there any advice using the shared library(.so) or any additional steps that i missed? 

Current android os version is android-11.0.0_r27

cc_prebuilt_library_shared {
  name: "libmy",
  target: {
    android_arm: {
      srcs: ["libs/libmy.so"],
    },
  android_arm64: {
      srcs: ["libs/libmy.so"],
    },
  },
  shared_libs: ["libc", "libdl"],
  strip: {
    none:true,
  },
}

android_app {
  name: "SystemUI",
  ...
  required: ["privapp_whitelist_com.android.systemui", "libmy"],
  ...
}

04-02 02:53:08.634 15556 15556 E AndroidRuntime: FATAL EXCEPTION: main
04-02 02:53:08.634 15556 15556 E AndroidRuntime: Process: com.android.systemui, PID: 15556
04-02 02:53:08.634 15556 15556 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "libmy.so" not found
04-02 02:53:08.634 15556 15556 E AndroidRuntime: at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
04-02 02:53:08.634 15556 15556 E AndroidRuntime: at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
04-02 02:53:08.634 15556 15556 E AndroidRuntime: at java.lang.System.loadLibrary(System.java:1664)

Thanks and Regards,
Reply all
Reply to author
Forward
0 new messages