我試圖添加到我的Android Studio項目這種依賴https://github.com/hoang8f/android-flat-button和我得到無法在gradle這個添加dependecy(Android Studio中)
Error:(26, 13) Failed to resolve: info.hoang8f:fbutton:1.0.5
我能夠加入谷歌輕鬆播放服務的依賴性不任何問題。
下面是我的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)搖籃在聯機模式下無法脫機工作。 2.)清理和建造/重建項目。
3)變更爲
repositories {
mavenCentral()
}
在我的根文件的gradle
4)工具 - > android->同步項目的gradle與文件
仍然在使其工作沒有運氣。 P:不是它影響問題,我在通過gradle添加解析sdk時面臨同樣的問題,所以我獨立添加了jar文件。
我接着說:編譯「info.hoang8f:fbutton:1.0.5''在我的'build.gradle'和它沒關係,您可以嘗試'建設 - >重建project'。 – tianyu
正如我已經告訴過的問題,我已經清理/重建項目,我的舊項目運行良好,只是新項目給這個問題 – penta
愚蠢的問題,但我需要問?這個圖書館真的有必要嗎?我認爲你可以做你自己的平按鈕像這裏http://stackoverflow.com/questions/26346727/android-material-design-button-styles – piotrek1543