외부 모듈이 .jar(.aar도 마찬가지)일 경우 우선 build.gradle의 dependencies에 해당 코드를 적어준다.
이 코드는 libs라는 파일에 *.jar로 들어오는 모듈을 임포트하겠다는 의미이다.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation '/libs/~~~'
...
}
그 후 원하는 파일을 /libimplementation files('libs/android-support-v4.jar')이런식으로 적어주면 import할 수있게 된다.
아래와 같이 jniLibs라는 폴더를 생성 한 후 디렉토리를 구성해준다.
그 후 해당 폴더 내에 *.so 파일을 다음과 같이 넣어주면 된다.
|--app:
|--|--src:
|--|--|--main
|--|--|--|--jniLibs
|--|--|--|--|--armeabi
|--|--|--|--|--|—andEnginePhysicsBox2DExtension.so
|--|--|--|--|--X86
|--|--|--|--|--|--andEnginePhysicsBox2DExtension.so
이때 armeabi 혹은 x86같은 것들은 .so파일과 함께 나오는 것이므로 위의 예제대로 X86같이 이름을 만들지 않고 기존에 나온 이름대로 하면 된다.
http://blog.guillaumeagis.eu/setup-andengine-with-android-studio/
Setup AndEngine with Android Studio | Hello.
After spending some times looking for how to use andEngine with android studio, I decided finally to write an article about it. Why ? I have to say that the articles on the net are pretty useful but… none of them are 100% complete and/or don’t cover all er
blog.guillaumeagis.eu
https://stackoverflow.com/questions/24357687/how-to-include-so-library-in-android-studio
How to include *.so library in Android Studio?
I read many threads how to add a *.so library to Android Studio, but none of them works, especially when it comes to the point of text: This does not work with the newer xxx (Android Studio, gradle...
stackoverflow.com
'Basic > Android' 카테고리의 다른 글
[Android] kvm permission denied 해결 방법 (1) | 2020.01.17 |
---|---|
Android에서 폴더 생성(디렉토리 생성)하기 (0) | 2020.01.11 |
[Android] This Handler class should be static or leaks might occur 해결 방법 (0) | 2019.12.15 |
Easing functions 공식 및 그림 (0) | 2019.12.12 |
다각형 영역으로 이미지 자르기 (0) | 2019.11.19 |