Android Studio: Add jar as library?

后端 未结 30 2449
天命终不由人
天命终不由人 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:50

    I made it work by just adding one line to build.gradle:

    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar']) ----> AS creates this
        implementation 'com.google.code.gson:gson:2.3.1'   ----------> I added this one
    }
    

    Do not forget to click Sync now in the top right corner.

    I'm using Android Studio 1.0.1.

提交回复
热议问题