How to add a jar in External Libraries in android studio

前端 未结 14 2280
北海茫月
北海茫月 2020-11-22 16:17

I am new to Android Studio. What I need to do is add a few jar files in the External Libraries below the < JDK > folder.

14条回答
  •  孤城傲影
    2020-11-22 16:34

    The GUI based approach would be to add an additional module in your project.

    1. From the File menu select Project Structure and click on the green plus icon on the top left.
    2. The new Module dialog pops
    3. From the phone and tablet application group select the "Import JAR or AAR package" option and click next.
    4. Follow the steps to create a new module that contains your JAR file.
    5. Click on the entry that corresponds to your main project and select the dependencies tab.
    6. Add a dependency to the module that you created in step 4.

    One final piece of advice. Make sure that the JAR file you include is build with at most JDK 1.7. Many problems relating to error message "com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)" root straight to this :0.

提交回复
热议问题