I have just installed Android and all relative tools required to run android development. Unfortunately at the initial build of Gradle sync, event log prints out an error message
Error message (Event log):
Gradle sync failed: Plugin with id 'com.android.applications' not found. Consult IDE Log for more details
Here's is the current Project (build.gradle) My application configuration:
// Top-level build file where you can add configuration options common to
// all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And the current Module (build.gradle) configuration:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.example.user.myapplication"
minSdkVersion 9
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
}
Try this
File -> Invalidate caches / Restart
Shutdown Android Studio Rename/remove .gradle
folder in the user home directory
Restart Android Studio let it download all the Gradle stuff it needs Gradle build success !
Rebuild project.... success !
Out of curiousity I compared the structure of the old .gradle
and the new one.
they were pretty different.!
make a file named "settings.gradle".
add this line to this file -> include ':app'
copy this file to the root directory of your project.
Re-open project
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.