[英]Android Studio Gradle Error:Failed to resolve: com.quickblox:quickblox-android-sdk-core:2.5.1
I'm dabbling in Android development currently and I have an Android Studio project which I am trying to add the QuickBlox sdk to my project. 我目前正在涉足Android开发,并且有一个Android Studio项目,正在尝试将QuickBlox sdk添加到我的项目中。 I've tried following the instructions provided but found it did not work. 我尝试按照提供的说明进行操作,但发现它不起作用。 With some research I found that I probably didn't need the mavenCentral() bit in the gradle file as the provided jcentral() lines were the equivalents and so I have only added the following sections to my gradle files. 通过一些研究,我发现我可能不需要gradle文件中的mavenCentral()位,因为所提供的jcentral()行是等效的,因此我仅将以下部分添加到了gradle文件中。
allprojects {
repositories {
jcenter()
jcenter {
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
}
However when I run this I get the error: 但是,当我运行此命令时,出现错误:
Error:A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugCompile'. 无法解析配置':app:_debugCompile'的所有依赖项。 Could not resolve com.quickblox:quickblox-android-sdk-core:2.5.1. 无法解析com.quickblox:quickblox-android-sdk-core:2.5.1。 Required by: Wext:app:unspecified Could not resolve com.quickblox:quickblox-android-sdk-core:2.5.1. 必需:Wext:app:unspecified无法解析com.quickblox:quickblox-android-sdk-core:2.5.1。 Could not get resource ' https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/com/quickblox/quickblox-android-sdk-core/2.5.1/quickblox-android-sdk-core-2.5.1.pom '. 无法获取资源' https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/com/quickblox/quickblox-android-sdk-core/2.5.1/quickblox-android-sdk-core -2.5.1.pom '。 Could not GET ' https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/com/quickblox/quickblox-android-sdk-core/2.5.1/quickblox-android-sdk-core-2.5.1.pom '. 无法获取' https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/com/quickblox/quickblox-android-sdk-core/2.5.1/quickblox-android-sdk-core- 2.5.1.pom '。 peer not authenticated 对等方未认证
I have found lots of similar questions on here and I have tried some of the suggested answers including adding the github certificate to the java certificate store and reinstalling the JDK but it seems to have no effect. 我在这里发现了很多类似的问题,并且尝试了一些建议的答案,包括将github证书添加到java证书存储区并重新安装JDK,但这似乎没有效果。 I'm not running through a proxy. 我没有通过代理运行。
Can anyone point me in the right direction? 谁能指出我正确的方向?
You have to include this reference at the app level (top level) build.gradle file. 您必须在应用程序级别(顶级)build.gradle文件中包含此参考。 Just add following thing: 只需添加以下内容:
allprojects {
repositories {
jcenter()
maven {
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
}
}
Note: Your url value is written in jcenter tag. 注意:您的url值写在jcenter标记中。 Just replace it to the maven { url .. } tag and sync your project. 只需将其替换为maven {url ..}标签并同步您的项目即可。
Hope it will help you. 希望对您有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.