Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include a .so lib in Intellij IDEA for Android project?

I have an Android project that loads a custom .so lib. I'm having trouble w/ IntelliJ IDEA to include this .so as part of the build.

Does anyone know where to config the project settings to include this .so file?

Thanks

UPDATE: Found it!

In Project Structure -> Modules -> Android -> Native libs directory.

My project is referring to a .so from another project, that's why the path needs to be updated here to find the .so file

like image 382
lordhong Avatar asked Sep 08 '11 02:09

lordhong


People also ask

How do I add an external library to IntelliJ?

From the main menu, select File | Project Structure | Project Settings | Modules. Select the module for which you want to add a library and click Dependencies. button and select Library. In the dialog that opens, select a project or a global library that you want to add to the module.

How do I add natives to IntelliJ?

On the right panel, select the little + Symbol (below "Name" and above "Classes") Select the directory you want to specify as Native Library Location and confirm. Select Native Library Location in the next dialog.

How do I link to a source in IntelliJ?

From the main menu, select File | Project Structure Ctrl+Alt+Shift+S and click Modules. Select the necessary module and open the Sources tab. to the right of the necessary folder (folder path). Specify the path relative to the output folder root, and click OK.


1 Answers

Solution:

In Project Structure -> Modules -> Android -> Native libs directory.

My project is referring to a .so from another project, that's why the path needs to be updated here to find the .so file

like image 171
lordhong Avatar answered Oct 16 '22 23:10

lordhong