简体   繁体   English

在Android Studio中添加库依赖

[英]Add Library Dependency Inside Android Studio

I want to search maven central inside the android studio to find my favorite android library.(I know it could be done with a google search and add library manually in gradle). 我想在Android Studio内搜索Maven Central以找到我最喜欢的Android库。 But I found a sweet option in the android studio under Project Settings>app>Dependencies>+Add Library Dependency. 但是我在android studio中的Project Settings>app>Dependencies>+Add Library Dependency.下找到了一个不错的选择Project Settings>app>Dependencies>+Add Library Dependency. I found there is some library listed by default but when I search for the library it shows nothing. 我发现默认情况下列出了一些库,但是当我搜索该库时却什么也没显示。 For example when I typed in search field "butterknife" it shows nothing. 例如,当我在搜索字段“ butterknife”中键入内容时,它什么也没有显示。 Heres it is 这是这里

快照 . But I noticed in the search description it says 但是我在搜索说明中注意到它说

Enter terms for Maven Central Search or fully qualified coordinates(eg com.google.code.gson:gson:2.2.4) 输入Maven中央搜索的字词或完全限定的坐标(例如com.google.code.gson:gson:2.2.4)

As far I understand it search in Maven Central. 据我了解,它可以在Maven Central中搜索。 if so whats wrong with my android studio/process? 如果是这样,我的android studio /进程怎么了?

It's a bug in searching for libraries portion sometimes it shows sometimes it doesn't but if you will type complete name like for example in your case 'com.jakewharton:butterknife:8.8.1' then it will give you the results all the time. 这是在搜索库部分时出现的错误 ,有时表明有时没有,但是如果您输入完整的名称(例如在您的案例'com.jakewharton:butterknife:8.8.1' ,它将始终为您提供结果。 So try searching through giving the whole name and also it's a good idea to submit a query for bug fix. 因此,请尝试通过提供全名进行搜索,并且最好提交一个错误修复查询。

在此处输入图片说明

This issue is already resolved. 这个问题已经解决。 Please update Android studio with latest version 3.1 and also update gradle with latest version 4.4 使用最新版本3.1更新Android Studio,使用最新版本4.4更新gradle。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM