Gradle 4.1问题在最新的android studio 3.0.1上 [英] Gradle 4.1 issue on latest android studio 3.0.1
本文介绍了Gradle 4.1问题在最新的android studio 3.0.1上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
错误:找不到com.android.tools.build:gradle:4.1。
在以下位置搜索:
file:/ C:/ Program Files / Android / Android Studio / gradle / m2repository / com / android / tools / build / gradle / 4.1 / gradle-4.1.pom
文件:/ C:/ Program Files / Android / Android Studio / gradle / m2repository / com / android / tools / build / gradle / 4.1 / gradle-4.1.jar
https://jcenter.bintray。 com / com / android / tools / build / gradle / 4.1 / gradle-4.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/4.1/gradle-4.1.jar
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1/gradle-4.1.pom
https://dl.google.com /dl/android/maven2/com/android/tools/build/gradle/4.1/gradle-4.1.jar
我的build.gradle文件是这样的。我将它设置为23,因为我需要在5.0.1手机上运行它。
apply plugin:'com.android.application '
android {
compileSdkVersion 23
buildToolsVersion23.0.1
defaultConfig {
applicationIdcom.example.threewire.myapplication
minSdkVersion 10
targetSdkVersion 23
versionCode 1
versionName1.0
testInstrumentationRunnerandroid.support.test.runner.AndroidJUnitRunner
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
}
依赖关系{
编译fileTree(dir:'libs',include:['* .jar'])
androidTestCompile('com.android.support.test.espresso: espresso-core:2.2.2',{
exclude group:'com.android.support',module:'support-annotations'
})
compile'com.android.support:程序兼容性-V7 :23.1.1'
compile'com.android.support.constraint:constraint-layout:1.0.2'
testCompile'junit:junit:4.12'
}
解决方案
您可以将此语句添加到您的gradle.properties文件中。
$ b
android.enableAapt2 = false
Though I have an updated android studio I am getting the following error but I cannot find gradle 4.1 in the gradle folder but when I check file -> project structure -> gradle plugin is 4.
Error:Could not find com.android.tools.build:gradle:4.1.
Searched in the following locations:
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/4.1/gradle-4.1.pom
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/4.1/gradle-4.1.jar
https://jcenter.bintray.com/com/android/tools/build/gradle/4.1/gradle-4.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/4.1/gradle-4.1.jar
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1/gradle-4.1.pom
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1/gradle-4.1.jar
And my build.gradle file is this. I set it to 23 because I need to run it on 5.0.1 phone.
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.threewire.myapplication"
minSdkVersion 10
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
解决方案
you can add this statement to your gradle.properties file
android.enableAapt2=false
这篇关于Gradle 4.1问题在最新的android studio 3.0.1上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文