【问题标题】:Failed to resolve: com.android.support:support-v7:27.1.1无法解决:com.android.support:support-v7:27.1.1
【发布时间】:2018-04-30 15:27:39
【问题描述】:

我的成绩:我不知道应该改变什么,此外还会生成这些错误,并且我已经将文件从编译更新到实现。

配置“编译”已过时,已替换为“实施”和“API”。 它将在 2018 年底被删除。更多信息请参阅:http://d.android.com/r/tools/update-dependency-configurations.html

配置“debugCompile”已过时,已替换为“debugImplementation”和“debugApi”。 它将在 2018 年底被删除。更多信息请参阅:http://d.android.com/r/tools/update-dependency-configurations.html

 buildscript {
 repositories {
    maven { url 'http://download.crashlytics.com/maven' }
  }

 dependencies {
    //noinspection GradleDynamicVersion
    classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
  }
}
apply plugin: 'com.android.application'
apply plugin: 'crashlytics'

repositories {
maven { url 'http://download.crashlytics.com/maven' }
}

apply plugin: 'hugo'

android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
    applicationId 'com.code44.finance'
    targetSdkVersion 27
    minSdkVersion 23
    versionCode 81
    versionName '0.18.3'
    buildConfigField "boolean", "USE_LOCAL_SERVER", "true"
    buildConfigField "String", "LOCAL_SERVER_IP", "\"192.168.0.7\""
    buildConfigField "long", "BUILD_TIME", "" + buildTime() + "L"
  }
   lintOptions {
    abortOnError false
  }
   compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
  }
   buildTypes {
    debug {
        applicationIdSuffix '.debug'
        versionNameSuffix '-debug'
    }
    release {
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
       'proguard-rules.pro'
        minifyEnabled true
        shrinkResources true
    }
   }
   sourceSets {
    androidTest.setRoot('src/test')
  }
  signingConfigs {
    debug {
        storeFile file('debug.keystore')
     }
   }
 }

 dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(path: ':backend', configuration: 'android-endpoints')
implementation project(path: ':common')
implementation 'com.google.api-client:google-api-client-android:1.23.0'
implementation 'com.android.support:support-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.google.android.gms:play-services-base:15.0.0'
implementation 'com.google.android.gms:play-services-drive:15.0.0'
implementation 'com.google.android.gms:play-services-plus:15.0.0'
implementation 'com.github.castorflex.smoothprogressbar:library:1.0.0'
implementation 'com.github.castorflex.smoothprogressbar:library- 
 circular:1.0.0'
implementation 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
implementation 'com.squareup.okhttp:okhttp:2.4.0'
implementation 'com.squareup.retrofit:retrofit:1.7.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.squareup.dagger:dagger:1.2.2'
compileOnly 'com.squareup.dagger:dagger-compiler:1.2.2'
implementation 'org.beanshell:bsh-core:2.0b4'
implementation 'com.astuetz:pagerslidingtabstrip:1.0.1'
implementation 'com.larswerkman:HoloColorPicker:1.4'
implementation 'com.readystatesoftware.systembartint:systembartint:1.0.3'
implementation 'net.danlew:android.joda:2.4.0'
implementation 'me.grantland:autofittextview:0.2.1'
implementation 'com.squareup:otto:1.3.5'
implementation 'se.emilsjolander:stickylistheaders:2.5.0'
implementation 'com.nononsenseapps:filepicker:3.1.0'
implementation project(':common')
implementation 'com.crashlytics.android:crashlytics:1.1.13'
implementation(name: 'hellocharts-library-1.3', ext: 'aar')
implementation 'uk.co.chrisjenx:calligraphy:2.0.1'
annotationProcessor 'com.google.auto.value:auto-value:1.5.2'
}

def buildTime() {
return System.currentTimeMillis();
}

存储库

buildscript {
repositories {
    mavenCentral()
    maven {
        url 'https://maven.google.com/'
        name 'Google'
    }
    google()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2'
    classpath 'com.google.gms:google-services:3.2.1'
    classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
   }
  }

   allprojects {
  repositories {
    jcenter()
    mavenCentral()
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
    flatDir {
        dirs 'libs'
    }
    maven {
        url 'https://maven.google.com/'
        name 'Google'
     }
   }
}

如果您想帮助我编译,我将不胜感激发送完整的项目链接 project link

【问题讨论】:

标签: android android-studio


【解决方案1】:

我希望这对你有用

在项目 gradle 文件中添加这个

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

【讨论】:

    【解决方案2】:

    它自己说的很简单。

    无法解决:com.android.support:support-v7:27.1.1

    它不是可用的依赖项。也许你给出了错误的依赖。 你很可能需要 appCompactv7 使用

    com.android.support:appcompat-v7:27.1.1
    

    如果你指的是这个,或者这个。

    com.android.support:support-compat:27.1.1
    

    【讨论】:

      【解决方案3】:

      com.android.support:support-v7:27.1.1 替换为com.android.support:design:27.1.1 对我有用。

      【讨论】:

        【解决方案4】:
        allprojects {
                repositories {
                    jcenter()
                    maven {
                        url "https://maven.google.com"
                    }
                }
            }
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2018-10-17
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2018-12-26
          • 2018-11-26
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多