Recently started to do Android, using Android Studio encountered the import jar did not respond to the problem, checked the data practice to conquer, and now specifically write a blog. Want to be helpful to just using a friend of Android studio.
1. First import your jar package into the Libs (directly copy it directly over).
2. In the Build.gradle
dependencies{} inside
Write on
Compile files (' Libs/xx your jar package. Jar '), write like this.
dependencies { compile files (' Libs/qqbrowser_sdk_v1.2.jar ')}
3. This is assumed to be more jars. You can also directly in build.gradle dependencies{} inside write on
Compile Filetree (include: [' *.jar 'dir' Libs ')
, write like thisdependencies { Compile filetree (include: [' *.jar 'dir' Libs ') }He would take his own initiative to import all the jars under the Libs into the model.
4. All steps are finished, and once again the Gradle is generated (select model, click here to do so.)
, you can see if it's enough to quote.
How Android Studio Imports jars correctly