Android Studio: Add jar as library?

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

    IIRC, simply using "Add as library" isn't enough for it to compile with the project.

    Check Intellij's help about adding libraries to a project

    The part that should interest you the most is this:

    (In File > Project Structure) Open the module settings and select the Dependencies tab.

    On the Dependencies tab, click add and select Library.

    In the Choose Libraries dialog, select one or more libraries and click Add Selected.

    If the library doesn't show up in the dialog, add it in the Libraries settings, right below Modules.

    You shouldn't need to add compile files() anymore, and the library should be properly added to your project.

提交回复
热议问题