I am trying to add external library (places it in the /libs directory) to my project. When I try to use the methods from that library, I see that they are in red color which means that the library is not recognized. When I click Ctrl+B, I get a message "Cannot find declaration to go to".
I use these steps to add a library (JAR file): 1. copy the library file into /libs dir 2. open Project Structure -> Global Libraries -> Attach clases 3. find the library and click ok
Is this proper way to do it?
PS. I am trying to add AdMob .jar file this way.
In the Project tool window ( Alt+1 ), right-click the node in which you want to create a new file and click New | File. Alternatively, select the node, press Alt+Insert , and click File. Name the new file and specify its extension, for example: File. js, and press Enter .
Easier procedure on latest versions:
Done
I've used this process to attach a 3rd party Jar to an Android project in IDEA.
The library should now be recognised.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With