Android Studio: Add jar as library?

后端 未结 30 2387
天命终不由人
天命终不由人 2020-11-21 05:54

I\'m trying to use the new Android Studio but I can\'t seem to get it working correctly.

I\'m using the Gson library to serialize/deserialize JSON-o

30条回答
  •  长情又很酷
    2020-11-21 06:52

    1) create an 'your_libs' folder inside the Project/app/src folder.

    2) Copy your jar file into this 'your_libs' folder

    3) In Android Studio, go to File -> Project Structure -> Dependencies -> Add -> File Dependency and navigate to your jar file, which should be under 'src/your_libs'

    3) Select your jar file and click 'Ok'

    and then you can see on your build.gradle like this : compile files('src/your_libs/your.jar')

提交回复
热议问题