Adding external library in Android studio

前端 未结 19 1120
面向向阳花
面向向阳花 2020-11-22 05:51

I want to add external library https://github.com/foursquare/foursquare-android-oauth to my Android application (I use Android Studio, the instructions provided by lib autho

19条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-22 06:28

    I had also faced this problem. Those time I followed some steps like:

    1. File > New > Import module > select your library_project. Then include 'library_project' will be added in settings.gradle file.

    2. File > Project Structure > App > Dependencies Tab > select library_project. If library_project not displaying then, Click on + button then select your library_project.

    3. Clean and build your project. The following lines will be added in your app module build.gradle (hint: this is not the one where classpath is defined).

     dependencies {
         compile fileTree(dir: 'libs', include: ['*.jar'])
         compile project(':library_project')
     }
    
    1. If these lines are not present, you must add them manually and clean and rebuild your project again (Ctrl + F9).

    2. A folder named library_project will be created in your app folder.

    3. If any icon or task merging error is created, go to AndroidManifest file and add

提交回复
热议问题