Android 错误:Failed to resolve: multidex
Show in File
Failed to resolve: runtime
Open File
Failed to resolve: common
Open File
求大神指导下。

解决方案 »

  1.   

    apply plugin: 'com.android.application'
    apply plugin: 'com.jakewharton.butterknife'
    android {
        compileSdkVersion 27
        buildToolsVersion '27.0.3'
        defaultConfig {
            applicationId "com.wlkj.ciyun"
            minSdkVersion 17
            targetSdkVersion 27
            versionCode 2
            versionName "2.0.1"
           // testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
            multiDexEnabled true
        }    lintOptions {
            disable "ResourceType"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
        dexOptions {
            jumboMode true
        }    sourceSets {
            main {
                jniLibs.srcDirs = ['libs']
            }
        }}dependencies {
    //        androidTestApi('com.android.support:multidex-instrumentation:1.0.1') {
    //        exclude group: 'com.android.support', module: 'multidex'
    //}
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation 'com.android.support:appcompat-v7:26.+'
        implementation 'com.android.support.constraint:constraint-layout:1.1.0'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'com.android.support.test:runner:1.0.1'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    //
        implementation 'com.jakewharton:butterknife:8.4.0'
        annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'//    implementation 'com.jakewharton:butterknife:8.8.1'
    //    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
        implementation 'jp.wasabeef:glide-transformations:2.0.1'
        //清除缓存
        implementation 'org.kymjs.kjframe:kjframe:2.6'
        //网络请求
        implementation 'com.google.code.gson:gson:2.8.0'
        implementation 'com.squareup.retrofit2:retrofit:2.1.0'
        implementation 'com.squareup.okhttp3:okhttp:3.4.2'
        implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
        implementation 'com.squareup.retrofit2:converter-scalars:2.0.0'
        implementation files('libs/core-3.1.0.jar')
        //数据库
        //compile 'org.litepal.android:core:1.4.1'
        //compile 'org.litepal.android:core:2.0.0'    //    compile project(':easeui')
       // compile 'com.android.support:multidex:1.0.1'
        implementation project(':pulltorefresh')
       // compile files('libs/ShareSDK-QQ-3.1.1.jar')
        implementation files('libs/android-support-multidex.jar')
        //微信
        implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'}      项目的build文件
      

  2.   

    buildscript {
        repositories {
            mavenCentral()
           jcenter()
            google()
            maven {
                url "https://jitpack.io"        }
           
        }
        dependencies {
           classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'
    //        classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1'
        //    classpath 'com.android.tools.build:gradle:3.0.1'
            classpath 'com.android.tools.build:gradle:3.0.1'
        }
    }allprojects {
        repositories {
            jcenter()
            mavenCentral()
            google()
            maven {
                url "https://jitpack.io"
            }
            maven{
                url 'https://maven.google.com'
            }
        }
    }task clean(type: Delete) {
        delete rootProject.buildDir
    }
      工程的build的文件                       求大佬指导下
      

  3.   

    我也遇到了同样的问题,我调整了一下repositories里面代码的顺序如下
     repositories {
            maven { url "https://maven.google.com" }
            jcenter()
            maven { url "https://jitpack.io" }
            mavenCentral()
            maven {
                url 'http://maven.aliyun.com/nexus/content/repositories/releases/'
            }
            google()
        }
    调整之前是
     repositories {
            jcenter()
            mavenCentral()
            maven { url "https://jitpack.io" }
            maven {
                url 'http://maven.aliyun.com/nexus/content/repositories/releases/'
            }
            maven {
                url "https://maven.google.com"
            }
            google()
        }
    楼主试试看能不能解决
      

  4.   

    我解决了 保持google()在第一位置
    allprojects {
        repositories {
            google()//保持这个放在顶部
            mavenCentral()
            maven {
                url "https://jitpack.io"
            }
            maven{
                url 'https://maven.google.com'
            }
            jcenter()//保持这个放在底部
        }
    }