From fb2dcebb501ad1759f63ee04011d67853bed8840 Mon Sep 17 00:00:00 2001 From: kairusds <32636532+kairusds@users.noreply.github.com> Date: Sat, 12 Oct 2024 12:56:51 +0800 Subject: [PATCH] Fix build errors for Android builds --- android_jni/avifandroidjni/build.gradle | 4 ++-- android_jni/avifandroidjni/src/main/jni/CMakeLists.txt | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/android_jni/avifandroidjni/build.gradle b/android_jni/avifandroidjni/build.gradle index 7fa66f02b0..2d39570703 100644 --- a/android_jni/avifandroidjni/build.gradle +++ b/android_jni/avifandroidjni/build.gradle @@ -4,12 +4,12 @@ plugins { android { namespace 'org.aomedia.avif.android' - compileSdk 30 + compileSdk 31 ndkVersion "25.2.9519653" defaultConfig { minSdk 21 - targetSdk 30 + targetSdk 31 versionCode 1 versionName "1.0" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' diff --git a/android_jni/avifandroidjni/src/main/jni/CMakeLists.txt b/android_jni/avifandroidjni/src/main/jni/CMakeLists.txt index 185a2b3e27..4fc1e4e5b5 100644 --- a/android_jni/avifandroidjni/src/main/jni/CMakeLists.txt +++ b/android_jni/avifandroidjni/src/main/jni/CMakeLists.txt @@ -35,7 +35,8 @@ add_library("avif_android" SHARED "libavif_jni.cc") # Import the cpu-features module to compute the number of threads used for # decoding. -include(AndroidNdkModules) -android_ndk_import_module_cpufeatures() +set(CPU_FEATURES_DIR "${ANDROID_NDK}/sources/android/cpufeatures") +include_directories(${CPU_FEATURES_DIR}) +add_library(cpufeatures STATIC "${CPU_FEATURES_DIR}/cpu-features.c") target_link_libraries(avif_android jnigraphics avif log cpufeatures)