NDK: how include *.so files in AndroidStudio

前端 未结 4 602
耶瑟儿~
耶瑟儿~ 2020-11-29 10:50

I have libs jar and *.so. I created Eclipse project as in tutorial (for this libs). I am now doing project in Android Studio, but system can\'t find *.so files. I make how i

4条回答
  •  独厮守ぢ
    2020-11-29 11:25

    You need to put your .so files inside a folder named lib (it's not libs and should be lib). It should be in the same structure it should be in the APK file.

    Structure

    Project:
    |--lib:
    |--|--armeabi:
    |--|--|--.so files.
    

    Then an armeabi folder where insert all .so files. Then zip the folder into a .zip.Rename the .zip file into armeabi.jar and add the line compile fileTree(dir: 'libs', include: '*.jar') into dependencies {} in the gradle's build file.

    For more info and alternate method please see This answer and This answer

提交回复
热议问题