How to add a jar in External Libraries in android studio

前端 未结 14 2379
北海茫月
北海茫月 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:33

    Please provide the jar file location in build.gradle

    implementation fileTree(dir: '', include: ['*.jar'])
    

    Example:

    implementation fileTree(dir: 'C:\Downloads', include: ['*.jar'])
    

    To add single jar file

    implementation files('libs/foo.jar')
    

    Note: compile is deprecated in latest gradle, hence use implementation instead.

提交回复
热议问题