错误:(1,0)找不到ID为'com.android.application'的插件-没有build.gradle文件 [英] Error:(1, 0) Plugin with id 'com.android.application' not found - no build.gradle file

查看:322
本文介绍了错误:(1,0)找不到ID为'com.android.application'的插件-没有build.gradle文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将一个Android Studio项目导入到Android Studio中,但出现了错误:

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

第一个屏幕截图

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

在导入时似乎没有创建项目的Build.gradle文件和settings.gradle文件

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

第二个屏幕截图

这是日志文件:

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. 

推荐答案

在包含app文件夹的文件夹中创建名为build.gradle的新文件.将以下内容粘贴到其中:

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()
    }
}

因此结构应为:

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

这篇关于错误:(1,0)找不到ID为'com.android.application'的插件-没有build.gradle文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆