2

I first tried using "Project Settings" and importing .jar -- however then only the .jar file is visible in the left pane.

And I in "Project Settings" try to import as a project I get Gradle sync errors.

Is it possible to install in a way, so I can browse the source code files while also using them in my android project?

Tom
  • 3,587
  • 9
  • 69
  • 124

2 Answers2

1

Add Repository and dependency like this:

repositories {
    maven { url "https://jitpack.io" }
}


dependencies {
    //format for including lib jar files for all flavors
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile project(':baselibrary')
    compile 'com.android.support:cardview-v7:23.1.1'
    compile 'com.github.PhilJay:MPAndroidChart:v2.2.3'
}
Shubham AgaRwal
  • 4,355
  • 8
  • 41
  • 62
0

You can use the library via gradle or maven. If you are having problems, I suggest you read tutorials in that direction.

If you want to browse the source code, you should clone the git repo of the library and reference the library project in your android studio project: How do I add a library project to Android Studio?

Community
  • 1
  • 1
Philipp Jahoda
  • 50,880
  • 24
  • 180
  • 187