将库源添加到Android Studio [英] Adding Library Source into Android Studio

查看:108
本文介绍了将库源添加到Android Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很抱歉问这个新手问题.

I am sorry for asking this newbie question.

我正在尝试在我的项目中使用此库: https://github.com/gfranks/GFMinimalNotifications

I am trying to use this library in my project: https://github.com/gfranks/GFMinimalNotifications

我想导入源代码而不是二进制文件.

I would like to import the source codes and not the binary.

github页面显示Simply copy the source/resource files from the library folder into your project.

The github page says Simply copy the source/resource files from the library folder into your project.

所以我试图直接拖放这些两个文件到我在Android Studio中的libs文件夹中.

So I tried to drag and drop these two files directly to my libs folder in Android Studio.

然后我回到我的活动并尝试在我的代码中使用它.但是自动完成功能似乎无法识别该库.

And I went back to my Activity and try to use it in my code. But the autocomplete does not seem to recognize the library.

有什么需要的吗? 复制到我的libs文件夹后.

Any help, please? After I copied into my libs folder.

考虑到该项目具有许多与库本身无关的资产,导入整个模块似乎很浪费.

我将其复制到app/libs文件夹,然后在build.gradle中添加

I copied it to the app/libs folder, and then in build.gradle I add

sourceSets {
    main.java.srcDirs += 'libs/GFMinimalNotifications/src/main/java'
}

推荐答案

在Android Studio中添加模块的步骤 下载zip文件和遵循步骤

Steps to add modules in Android Studio download zip file & follow steps

这篇关于将库源添加到Android Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆