1. Add a Jar file
Copy the jar file to the Libs folder under the App module directory, then open the configuration file under the App module directory and build.gradle
dependencies
add the configuration command to the item, here
1 introduction of all jar files in Libs directory at once 2 Compile filetree (include: [' *.jar '], dir: ' Libs ')345 importing jar files individually 6 Compile files (' Libs/universal-image-loader-1.8.6-with-sources.jar ')
2. Add a third-party library by configuration
Example: Introduction of Butterknife third-party library
Git:https://github.com/jakewharton/butterknife
1> add apt to the Build.grade file in the project root directory
Buildscript { repositories { mavencentral () } dependencies { ' com.neenbedankt.gradle.plugins:android-apt:1.8 ' }}
2> introduction of APT and Butterknife configuration in the app directory Build.grade
1 Apply plugin: ' Android-apt ' 2 3android { 4 ... 5 } 6 7Dependencies { 8 compile ' com.jakewharton:butterknife : 8.4.0 ' 9 apt ' com.jakewharton:butterknife-compiler:8.4.0 'Ten }
Add a jar package file to Android Studio