Android Studio: Add jar as library?

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

    In Android Studio 2.1 I follow the this way,

    Goto app -> src-> main -> assets folder (If not available create it) -> put your JAR files

    In your build.gradle add dependency like this,

    implementation files('src/main/assets/jsoup.jar')
    implementation files('src/main/assets/org-apache-xmlrpc.jar')
    implementation files('src/main/assets/org.apache.commons.httpclient.jar')
    implementation files('src/main/assets/ws-commons-util-1.0.2.jar')
    

    Sync now. Now your JAR files ready to use.

提交回复
热议问题