Adding external library in Android studio

前端 未结 19 1356
面向向阳花
面向向阳花 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:17

    For the simplest way just follow these steps

    1. Go to File -> New -> Import Module -> choose library or project folder

    2. Add library to include section in settings.gradle file and sync the project (After that you can see new folder with library name is added in project structure)

      include ':mylibraryName'

    3. Go to File -> Project Structure -> app -> dependency tab -> click on plus button

    4. Select module dependency -> select library (your library name should appear there) and put scope (compile or implementation)

    5. Add this line in build.gradle in app level module in dependency section

      implementation project(':mylibraryName')

提交回复
热议问题