Android Error:Could not find commons-codec.jar (commons-codec:commons-codec:1.6)

版权声明:本文为博主原创文章,未经博主允许不得转载、不得商业用途。 https://blog.csdn.net/chenlove1/article/details/79530341

升级了Android studio 3.0+出现了:

Error:Could not find commons-codec.jar (commons-codec:commons-codec:1.6).
Searched in the following locations:
    file:/C:/Program Files/Android Studio/gradle/m2repository/commons-codec/commons-codec/1.6/commons-codec-1.6.jar

路径下少了commons-codec-1.6.jar(下载) jar包功能用于加密,参考:

总结:commons-codec.jar中常用方法

再出现了:

Failed to resolve: com.android.support:support-v4:27.1.0 Show in File Show in Project Structure dialog
Failed to resolve: com.android.support:appcompat-v7:27.1.0 Show in File Show in Project Structure dialog
Failed to resolve: com.android.support:recyclerview-v7:27.1.0 Show in File Show in Project Structure dialog

Failed to resolve: com.android.support:multidex:1.0.3 Show in File Show in Project Structure dialog


解决:

原来工程根 build.gradle里配置:

buildscript {
    repositories {
        jcenter()
        flatDir { dirs 'libs' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
    }
}
repositories {
    google()
}

改为: 

扫描二维码关注公众号,回复: 5701565 查看本文章

buildscript {

    allprojects {

        repositories {
            flatDir { dirs 'libs' }
            jcenter()
            google()
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
    }
}
repositories {
    google()
}

还不行可以参考:http://blog.csdn.net/rrkdddd33/article/details/79236367


猜你喜欢

转载自blog.csdn.net/chenlove1/article/details/79530341