Ошибка dlopen: невозможно найти символ "_ZN11SkJpegCodec6IsJpegEPKvj", на который ссылается libmyskia.so
Я пытаюсь собрать Skia для Android с помощью мастер-ветви. Но я получил следующую ошибку:
java.lang.UnsatisfiedLinkError: сбой dlopen: невозможно найти символ "_ZN11SkJpegCodec6IsJpegEPKvj", на который ссылается ".../libmyskia.so"... на java.lang.Runtime.loadLibrary0(Runtime.java:1016)
Некоторые детали:
1) Команда для сборки лыжи:
#!/usr/bin/env bash
echo "generating ninja build files..."
bin/gn gen out/x86 --args='ndk="/Users/rowandjj/Library/Android/sdk/ndk-bundle/" target_cpu="x86" ndk_api=21 target_os="android" is_official_build=false is_component_build=true is_debug=false skia_use_system_expat=false skia_use_system_freetype2=false skia_use_system_libpng=false skia_use_icu=false skia_use_libjpeg_turbo=false skia_use_libwebp=false skia_use_piex=false'
echo "ninja compiling and linking..."
/usr/local/bin/ninja -C out/x86
echo "job done!"
2) CMakeLists:
cmake_minimum_required(VERSION 3.4.1)
set(distribution_DIR ${CMAKE_SOURCE_DIR}/libs)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/android)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/atlastext)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/c)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/codec)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/config)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/core)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/effects)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/encode)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/gpu)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/pathops)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/ports)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/private)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/svg)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/utils)
add_library( # Sets the name of the library.
myskia
# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
IMPORTED )
set_target_properties(
myskia
PROPERTIES IMPORTED_LOCATION
${distribution_DIR}/${ANDROID_ABI}/libmyskia.so
)
add_library( # Sets the name of the library.
native-lib
# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
src/main/cpp/native-lib.cpp)
find_library( # Sets the name of the path variable.
log-lib
# Specifies the name of the NDK library that
# you want CMake to locate.
log)
target_link_libraries( # Specifies the target library.
native-lib
myskia
# Links the target library to the log library
# included in the NDK.
${log-lib})
3) моя версия NDK: 18.1.5063045
4) версия Gradle: 4.6 / версия плагина Gradle: 3.2.1
5) build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.foo.android.helloskia"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
arguments "-DANDROID_PLATFORM=android-26"
cppFlags "-frtti -fexceptions"
}
}
ndk {
abiFilters 'armeabi-v7a',"x86"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
sourceSets {
main {
jniLibs.srcDir "./libs"
}
}
}