Android Studio: Add jar as library?

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

    1. Put the jar (in my case, gson-2.2.4.jar) into the libs folder.

    2. Ensure that compile files (libs/gson-2.2.4.jar) is in your build.gradle file.

    3. Now Click on the "Sync Project with Gradle files"(Left to AVD manager Button on the topbar).

    After I did the above three, it started working fine.

提交回复
热议问题