Error:(1, 0) Plugin with id 'com.android.application' not found - no build.gradle file

こ雲淡風輕ζ 提交于 2019-12-25 09:05:11

问题


i have imported an Android Studio project, into Android Studio yet the error appears:

First Screenshot

Error:(1, 0) Plugin with id 'com.android.application' not found.

It appears on import that the Build.gradle file for the project and the settings.gradle file were not created

Second Screenshot

this is log file :

2017-01-05 15:07:25,745 [ 381987]   INFO - ls.idea.gradle.GradleSyncState - Sync with Gradle for project 'app' failed: Plugin with id 'com.android.application' not found.

Consult IDE log for more details (Help | Show Log) 
2017-01-05 15:07:25,755 [ 381997]   WARN - roid.tools.ndk.GradleWorkspace - NDK support for project 'app' is disabled because the project doesn't contain any valid native configurations. 
2017-01-05 15:07:25,795 [ 382037]   INFO -       #com.jetbrains.cidr.lang - Clearing symbols finished in 0 s. 
2017-01-05 15:07:25,797 [ 382039]   INFO -       #com.jetbrains.cidr.lang - Loading symbols finished in 0 s. 
2017-01-05 15:07:25,798 [ 382040]   INFO -       #com.jetbrains.cidr.lang - Building symbols finished in 0 s. 
2017-01-05 15:07:25,799 [ 382041]   INFO -       #com.jetbrains.cidr.lang - Saving symbols finished in 0 s. 

回答1:


Create new file called build.gradle in the folder that contains your app folder. Paste the following content into it:

// 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.2.3'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

So the structure would be:

Project Name
  - app
      - src
      - build
      - build.gradle
  - build
  - gradle
  - build.gradle (add this file)


来源:https://stackoverflow.com/questions/41488653/error1-0-plugin-with-id-com-android-application-not-found-no-build-gradl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!