JNI를 사용하는 JAR에 Android 라이브러리 패키징 (Packing an android library on a JAR that uses JNI)


문제 설명

JNI를 사용하는 JAR에 Android 라이브러리 패키징 (Packing an android library on a JAR that uses JNI)

기본 코드를 사용하는 Android Java 라이브러리가 있습니다. 이 자바 라이브러리를 클라이언트 프로젝트에 추가했습니다.

내 클라이언트 프로젝트의 libs 폴더에 네이티브 라이브러리를 복사하는 스크립트를 추가해야 합니까? 아니면 이 네이티브 라이브러리가 자바 라이브러리의 jar 안에 포함되어 있습니까?

자세한 내용이 필요하거나 이해가 안되는 부분이 있으면 알려주세요.

고마워


참조 솔루션

방법 1:

You should move .so files(libs, obj etc.) from your project(that will be JAR library) to main project(that will use your JAR library). After that, make *.JAR again and attach *.JAR to your main project. I solved this problem in this way. :) I hope my answer will be helpful. bye, VansFannel!

방법 2:

I don't know if you need support any longer. You don't need any scripts when you added the Android library project to your Android project. I have a similar configuration and it works fine.

For more information how to use the JNI, you can look here: Issues with SHA1 hash implementation in Android

(by VansFannelcmcromanceCSchulz)

참조 문서

  1. Packing an android library on a JAR that uses JNI (CC BY‑SA 3.0/4.0)

#android-ndk #Android #java






관련 질문

FFmpeg 1.0 < 오디오 재생 문제 유발 (FFmpeg 1.0 < causing audio playback issues)

Android ImageView가 업데이트되지 않습니다. (Android ImageView is not being updated)

나중에 Android에서 실행해야 하는 데스크탑용 OpenCV 애플리케이션 개발 및 테스트 (Developing and testing an OpenCV application on desktop which should later run on Android)

Android 스튜디오 NDK 해결 방법 (Android Studio NDK workaround)

64비트 Android 장치에서 .so 파일을 찾을 수 없습니다. (Can not find .so file on 64 bit android device)

RUBYMOTION_ANDROID_SDK가 잘못되었습니다. (RUBYMOTION_ANDROID_SDK is incorrect)

NDK: 자바 클래스에서 .c 상수를 사용하는 방법 (NDK: How to use .c constants in java class)

Android ndk(cmake): '두 번째 jni 라이브러리에서 로그 API를 사용할 때 '__android_log_write'에 대한 정의되지 않은 참조 (Android ndk(cmake): 'undefined reference to `__android_log_write' when using log api in the second jni library)

~SkSpriteBlitter()를 반환할 때 스키어 네이티브 충돌이 발생했습니다. (I got skia native crash when return ~SkSpriteBlitter())

JNI를 사용하는 JAR에 Android 라이브러리 패키징 (Packing an android library on a JAR that uses JNI)

CMake가 서버에 통신 오류가 발생했습니다. (CMake communicate to server error occurred)

armv7-linux-androideabi 대상에서 Rust 라이브러리 충돌 (Rust library crashing on target armv7-linux-androideabi)







코멘트