0

我的 .android 依赖项都没有解决。

例子:

无法解决:com.android.support:appcompat-v7:28.1.0 Show in File Show in Project Structure 对话框

无法解决:com.android.support:support-v4:28.1.0 Show in File Show in Project Structure 对话框

我的 gradle 版本是 4.6,我刚刚更新到最新的 android studio 版本 3.2.1。

我基于项目的 gradle 如下所示:

buildscript {
    repositories {
        jcenter()
     mavenCentral()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.0.1'

    }
}

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

        google()
    }
}

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

和我基于应用程序的 gradle 文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'

    defaultConfig {
        applicationId "com.example.sanchez.worldgramproject"
        minSdkVersion 21
        targetSdkVersion 28
        multiDexEnabled true
        versionCode 0
        versionName "0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            debuggable true
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.github.madrapps:pikolo:1.1.6'
    implementation 'com.android.support:design:28.1.0'
    implementation 'com.firebaseui:firebase-ui-database:4.2.0'
    implementation 'com.github.bumptech.glide:glide:3.8.0'
    implementation 'com.firebaseui:firebase-ui-storage:2.3.0'
    implementation 'com.google.android.gms:play-services-auth:16.0.1'
    implementation 'com.android.support:appcompat-v7:28.1.0'
    implementation 'com.android.support:cardview-v7:28.1.0'
    implementation 'com.android.support:recyclerview-v7:28.1.0'
    implementation 'com.jakewharton:butterknife:8.8.1'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.6'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.android.support:support-v4:28.1.0'
    implementation 'com.android.support:exifinterface:28.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.google.firebase:firebase-auth:16.0.5'
    implementation 'com.google.firebase:firebase-database:16.0.4'
    implementation 'com.google.firebase:firebase-storage:16.0.4'
}

apply plugin: 'com.google.gms.google-services'
4

2 回答 2

0

由于版本未匹配与 buildTool 更改 BuildTollVersion 而更改这样的错误依赖项

 buildToolsVersion '28.1.3'

如果它不起作用改变

com.android.support:appcompat-v7:28.0.0
com.android.support:support-v4:28.0.0 

你需要将所有 28.1... 版本更改为 28.0...

于 2018-10-27T11:46:33.290 回答
0

删除buildToolsVersion '28.0.3'28.0.0用于所有支持库。

于 2018-10-27T11:56:54.247 回答