Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile Fail with NDK 24.0.8215888 #8

Open
lt3stus3el opened this issue Apr 19, 2022 · 3 comments
Open

Compile Fail with NDK 24.0.8215888 #8

lt3stus3el opened this issue Apr 19, 2022 · 3 comments

Comments

@lt3stus3el
Copy link

Cloned and compiled with NDK 24.0.8215888 in linux. error log:

KeepAlivePerfect/library/src/main/cpp/binder_libs/armeabi-v7a/libbinder.so: invalid sh_info in symbol table
@lt3stus3el
Copy link
Author

same result in windows! missing some libraries?

@lt3stus3el
Copy link
Author

Compiled with following CMakeLists.txt:

  1. Changed SHARED to STATIC
  2. add set_target_properties to so files.
# Sets the minimum version of CMake required to build the native library.

cmake_minimum_required(VERSION 3.4.1)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/)

add_compile_options(-fno-rtti -O3 -v)

message(@@@${CMAKE_CURRENT_SOURCE_DIR})

link_directories(binder_libs/${CMAKE_ANDROID_ARCH_ABI})

aux_source_directory(. SRC_LIST) # 搜索当前目录下的所有.cpp文件

add_library( # Sets the name of the library.
        keep_alive

        # Sets the library as a shared library.
        STATIC

        # 提供源文件的相对路径。
        ${SRC_LIST} main.cpp art.cpp)

set_target_properties(keep_alive PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/binder_libs/${ANDROID_ABI}/libutils.so)
set_target_properties(keep_alive PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/binder_libs/${ANDROID_ABI}/libc.so)
set_target_properties(keep_alive PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/binder_libs/${ANDROID_ABI}/libcutils.so)
set_target_properties(keep_alive PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/binder_libs/${ANDROID_ABI}/libutils.so)

find_library(log-lib log)

target_link_libraries(
        keep_alive
        ${log-lib}
)

@MIkeeJY
Copy link

MIkeeJY commented Mar 26, 2024

@lt3stus3el still missing java.lang.UnsatisfiedLinkError: dlopen failed: library "libkeep_alive.so" not found

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

No branches or pull requests

2 participants