【问题标题】:How to fix error "Failed to resolve:..." on Android Studio 1.4如何在 Android Studio 1.4 上修复错误“无法解决:...”
【发布时间】:2019-01-04 09:49:16
【问题描述】:

我无法在 Gradle 中添加存储库。

我一直在寻找这个问题的答案,但失败了

应用中的Build.gradle文件:

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
    applicationId "com.mkurbanov.lebap_kwartira"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5@aar'
compile 'com.balysv:material-ripple:1.0.2'
compile 'com.yqritc:recyclerview-flexibledivider:1.4.0'
compile 'com.daimajia.easing:library:2.0@aar'
compile 'com.daimajia.androidanimations:library:2.3@aar'
compile 'com.github.esafirm.android-image-picker:imagepicker:x.y.z'
// for experimental rx picker
compile 'com.github.esafirm.android-image-picker:rximagepicker:x.y.z'
}

项目中的Build.gradle文件:

// Top-level build file where you can add configuration options common to 
 all sub-projects/modules.

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.3.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    jcenter()
    maven { url 'https://maven.google.com' }
    maven { url 'https://jitpack.io' }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

得到这样的错误:

错误:(36, 13) 无法解决:com.github.esafirm.android-image- picker:rximagepicker:x.y.z 在文件中显示
在项目结构中显示 对话框

错误:(34, 13) 无法解决:com.github.esafirm.android-image- picker:imagepicker:x.y.z 在文件中显示
在项目结构中显示 对话框

我需要添加这个repository。 但它不起作用。

【问题讨论】:

  • 您为什么使用 Android Studio 1.4?
  • 我的互联网连接较弱。
  • 将 x.y.x 替换为 1.13.1

标签: android android-studio gradle repository


【解决方案1】:

在您的 Build.gradle 中,将 x.y.z 替换为 1.13.1

【讨论】:

    【解决方案2】:

    compile 'com.github.esafirm.android-image-picker:imagepicker:x.y.z' 更改为compile 'com.github.esafirm.android-image-picker:imagepicker:1.13.1'

    compile 'com.github.esafirm.android-image-picker:rximagepicker:x.y.z'

    compile 'com.github.esafirm.android-image-picker:rximagepicker:1.13.1'
    

    【讨论】:

      猜你喜欢
      • 2016-01-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-09
      • 1970-01-01
      • 2016-12-15
      • 2017-05-30
      相关资源
      最近更新 更多