0

I recently upgraded from libjpeg-turbo 1.5.0 to 3.0.2 and attempted to integrate libturbojpeg.so into an Android Studio project using ndk-build. However, the build process fails during ndkClean or ndk-build.cmd clean with the following error:

Android NDK: ERROR: /UVCCamera/Android.mk:turbojpeg: LOCAL_SRC_FILES points to a missing file Android NDK: Check that /libs/armeabi-v7a/libturbojpeg.so exists or that its path is correct

Despite placing libturbojpeg.so in the correct libs/armeabi-v7a/ and libs/arm64-v8a/ folders, the build process still fails. The integration works when the file is manually copied, but the cleaning process fails unless all ABI .so files are present — even if the build only targets one ABI.

Environment

  • libjpeg-turbo version: 3.0.2
  • NDK version: 23.1.7779620
  • Android Studio version: Hedgehog | Chipmunk
  • Gradle plugin: 7.x
  • Build system: ndk-build via Gradle (externalNativeBuild.ndkBuild)
  • Target ABI: armeabi-v7a and arm64-v8a
  • minSdkVersion: 21

Steps to Reproduce

  1. Build libturbojpeg.so using CMake for armeabi-v7a and arm64-v8a
  2. Place .so files into appropriate libs/<ABI>/ folders
  3. Declare LOCAL_SRC_FILES := ../../libs/$(TARGET_ARCH_ABI)/libturbojpeg.so in Android.mk
  4. Run ndk-build.cmd clean or ./gradlew clean
  5. See error if any one ABI .so is missing

Expected Behavior

ndkClean should not fail if only the selected APP_ABI is built, or it should provide a clearer fallback mechanism if a .so is not used by the current ABI.

Workaround

  • Manually copy .so files into all ABI folders, even if not building for that ABI
  • Or temporarily limit APP_ABI to only one target in Application.mk

Request

Can you please confirm?

  • If this behavior is intended?
  • If there’s a cleaner way to integrate prebuilt .so without hitting LOCAL_SRC_FILES errors for unused ABIs?
  • Whether a default cmake + ndk-build integration sample can be included for Android prebuilt use?

Thank you for your work on this fast and robust JPEG library!

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.