首页 > 解决方案 > 不能声明占位符视图

问题描述

我的 Gradelle 出现问题,响应无法解决“:app@debug/compileClasspath”的依赖关系:无法解析 com.mindorks:placeholderview:0.7.1。

我试着喜欢

一个。设置 > 构建异常部署 > gradle > 取消选中离线工作失败 b。清理并重新处理它失败了 c. 无效并重新启动失败

   apply plugin: 'com.android.application'

   android {
compileSdkVersion 27
buildToolsVersion '26.0.2'
useLibrary 'org.apache.http.legacy'
defaultConfig {
    applicationId "sid.len.mobile"
    minSdkVersion 21
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}
packagingOptions {
    pickFirst 'META-INF/LICENSE.txt' // picks the JavaMail license file
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    }
    }

 repositories {
jcenter()
maven {
    url "https://maven.java.net/content/groups/public/"
      }
      }

      dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})

implementation 'com.android.support:appcompat-v7:27.0.0'
implementation 'com.android.support:gridlayout-v7:27.0.0'
compile 'com.android.support:support-annotations:27.0.0'
implementation 'com.android.support:recyclerview-v7:27.0.0'

compile 'com.android.support:design:27.0.0'

implementation 'com.android.support.constraint:constraint-layout:1.1.3'
compile 'com.android.support:multidex:1.0.3'

implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

compile 'com.google.code.gson:gson:2.6.2'

compile 'com.google.android.gms:play-services-location:11.0.1'
compile 'com.google.android.gms:play-services-maps:11.0.1'
compile 'com.google.android.gms:play-services-safetynet:11.0.1'
compile 'com.google.android.gms:play-services-base:11.0.1'
compile 'com.google.android.gms:play-services-basement:11.0.1'
compile 'com.google.android.gms:play-services-tasks:11.0.1'

compile 'net.zetetic:android-database-sqlcipher:3.4.0@aar'

compile 'com.squareup.okhttp3:logging-interceptor:3.4.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup:otto:1.3.8'

//noinspection OutdatedLibrary
compile 'com.android.volley:volley:1.1.0'

compile files('libs/jtds-1.3.1.jar')
testCompile 'junit:junit:4.12'

compile 'com.mindorks:placeholderview:0.7.1'

}

标签: androidgradle

解决方案


您需要添加此存储库:

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

虽然这build.gradle似乎有不止一个问题,包括重复*.jar的引用和一些过时的库(以防您想知道为什么它仍然无法构建)。

至少使用buildToolsVersion "27.0.3".


推荐阅读