Android Gradle cannot find symbol class Gson

前端 未结 10 1367
温柔的废话
温柔的废话 2020-12-08 19:07

So i added gson-2.2.4.jar to the libs dir (I\'m using android studio). My project couldn\'t find the gson stuff so I added it as a library dependency to my module in the \"P

10条回答
  •  难免孤独
    2020-12-08 19:25

    Adding it as a dependency in the Project Structure settings is not enough. That setting is only for the IDE. To actually build, Gradle also needs to be aware of it. You must add the .jar file to your build.gradle file like so...

    dependencies {
        compile files('libs/gson-2.2.4.jar')
    }
    

提交回复
热议问题