Issue
I have been trying to add webrtc library to my android app which is being developed on Android Studio.
After compiling the webrtc, it gave me two folders. libs and jni.
libs folder contains libjingle_peerconnection.jar
and base_java.jar
.
jni folder contains the *.so files in subfolders.
I had been using same library files in Eclipse as well. But even after trying lots of questions on SO, I couldn't solve my problem. None of the questions talked about both *.so files and jar wrappers together.
I have tried different combinations of following directory structure:
|--app:
|--|--src:
|--|--|--main
|--|--|--|--jni
|--|--|--|--|--armeabi
|--|--|--|--|--|--.so Files
|--|--|--|--|--x86
|--|--|--|--|--|--.so Files
|--|--|--main
|--|--|--|--|--libs
|--|--|--|--|--|--|--.jar Files
I have looked into following SO questions but couldn't get solution to my problem.
How to include *.so library in Android Studio?
Include .so library in apk in android studio
Android Studio - include and consume .so library
Solution
After working for some time, I was able to resolve this problem. Here is the new directory structure:
|--app:
|--|--libs
|--|--src:
|--|--|--main
|--|--|--|--jniLibs // This should be jniLibs and not just jni, android converts the name to cpp from jni
|--|--|--|--|--armeabi
|--|--|--|--|--|--.so Files
|--|--|--|--|--x86
|--|--|--|--|--|--.so Files
Answered By - SamFast
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.