如何添加android工作室库

问题描述:

可能有人解释我如何添加一个库到我的android工作室的项目?如何添加android工作室库

这是库:https://github.com/code-troopers/android-betterpickers

我想使用复发选择器。在此先感谢

enter image description here

打开此文件,并在它的内部,你会发现在旁边的图标可能是不一样的

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    compile 'com.code-troopers.betterpickers:library:3.1.0' //add this line here 
} 

您需要添加此库作为依赖以下在您的项目(假设你使用Android工作室)添加这种依赖在你的gradle 构建脚本:

dependencies { 
     compile group: 'com.code-troopers.betterpickers', name: 'library', version: '3.1.0' 
} 
+0

我已经这样做了。我得到这些错误:http://mygym2017.altervista.org/Screenshot__14_.png –

你需要这个依赖,你可以找到所有的截图下方的链接

enter image description here

然后找到你的项目文件:

enter image description here

把你dependecy在相关模块:

enter image description here

After您将看到gradle文件已更改并需要项目同步的消息。按立即同步