1

Hello I'm still a real beginner, and I'd need to add a library to my project in android studio, from the answers I've seen on the web, you should go in file - project structure - modules. When I open project structure I only have platform settings - android sdk as option.

Has anything changed from the first versions?

thanks

VirtualFlyer
  • 43
  • 1
  • 6

3 Answers3

1

Just follow the few steps to add library files in android studio.

1)In Explorer, Click Project -> app -> libs -> (paste your jar file).

2)In Explorer, Click Android -> Gradle Scripts -> build.gradle(Module:app)[Double click it].

3)In the Dependencies { } add the following code

compile files('libs/your file name.jar')

4) Build and clean the project .

Now your jar file is successfully added.

sudharsan
  • 11
  • 1
0

You should go in file - project structure - modules.. this is correct. At the top of the second column, click the + sign and select New module if you are creating a new library from scratch or Import module if you already have the library.

JustinMorris
  • 7,259
  • 3
  • 30
  • 36
  • The problem in this case is that the "modules" item doesn't even exist in the Project Structure window. See duplicate: http://stackoverflow.com/questions/18877728/android-studio-project-structure-is-almost-empty – Cypress Frankenfeld Sep 26 '13 at 00:46
0

In Android Studio 0.2.10, this workaround seems to work for me:

Step 1: Select Project > Right Click > Open Module Settings (F12) > Projects Settings > Click Modules.

Step 2: Click your Project > you will see 3 tabs : Sources/Path/Dependencies. Step 3 : Select Dependencies tab. You will see green '+' button to the right of 'Scope' title. Click on this and it will allow you to add Jars and libs.

PS: make the scope of the added jars/libs as Compile

Community
  • 1
  • 1
Cypress Frankenfeld
  • 2,317
  • 2
  • 28
  • 40