Android Studio使用时遇见的一些问题+解决方法(持续更新)

1.如果编译时出现“ERROR: Plugin with id 'com.android.application' not found.”错误.

解决方法:请在build.gradle文件中添加以下代码。

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
         //版本号请根据自己的gradle插件版本号自行更改
        classpath 'com.android.tools.build:gradle:3.4.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

 

2.Error:Failed to resolve: com.android.support:support-v4:26.0.0

出现问题的原因:support annotations自25.4.0之后support包不在sdk中更新了,需要用谷歌的maven库,在Project的build.gradle中添加谷歌的地址

解决方法:因此需要我们手动的在Project的build.gradle中添加如下谷歌的地址

allprojects {
        repositories {

            jcenter()
            mavenCentral()

            maven{ url "https://maven.google.com"}
            maven{ url "https://dl.google.com./dl.android/maven2/"}
        }
    }

 

3.报错:The specified Android SDK Build Tools version (26.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.5.1.

 

 

 可以看到在project structure中:

 

 

 解决方法:

根据提示进行修改,就可以了

 

 

 

posted @ 2020-05-24 00:04  似鱼  阅读(796)  评论(0编辑  收藏  举报