gpt4 book ai didi

java - 无法在 gradle 中添加依赖项(Android Studio)

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:21:45 25 4
gpt4 key购买 nike

我正在尝试添加此依赖项 https://github.com/hoang8f/android-flat-button进入我的 android studio 项目,我得到了

 Error:(26, 13) Failed to resolve: info.hoang8f:fbutton:1.0.5

我可以毫无问题地轻松添加 google play 服务依赖项。

下面是我的build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
applicationId "com.example.planner"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}


dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.google.android.gms:play-services:7.5.0'
compile 'info.hoang8f:fbutton:1.0.5'
}

尝试过的解决方案:- 1.) Gradle 在在线模式下工作,而不是离线模式。 2.)清理并构建/重建项目。

3.) 改为

repositories {
mavenCentral()
}

在我的根 gradle 文件中

4.) Tools->android->Sync Project with gradle files

仍然没有成功。

P.S.:- 这并不影响问题,我在尝试通过 gradle 添加解析 sdk 时遇到了同样的问题,所以我独立添加了 jar 文件。

最佳答案

添加

存储库{
mavenCentral()

包含android标签

    android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
applicationId "com.example.planner"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
repositories {
mavenCentral()
}}

关于java - 无法在 gradle 中添加依赖项(Android Studio),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34306486/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com