带有id' com.android.application'的插件找不到

时间:2015-10-01 17:56:22

标签: android android-gradle

我是android的新手。我正在使用android studio 1.1.0。当我正在构建我的项目时,它说 "错误:(1,0)带有id' com.android.application'的插件没找到"。我该怎么办?

这是我的#34; build.gradle"文件 - :\
                                                                                    //顶级构建文件,您可以在其中添加所有子项目/模块共有的配置选项。

buildscript {
    repositories {
       jcenter()
     }
dependencies {
    classpath 'com.android.tools.build:gradle:1.1.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
  }}

  allprojects {
   repositories {
    jcenter()
    }}

这里是" build.gradle"模块文件' app' - :

  apply plugin: 'com.android.application'

  android {
     compileSdkVersion 22
     buildToolsVersion "22.0.1"

 defaultConfig {
     applicationId "healthcare.prescro.com.prescro"
     minSdkVersion 17
     targetSdkVersion 22
     versionCode 1
     versionName "1.0"
   }
 buildTypes {
     release {
         minifyEnabled false
         proguardFiles getDefaultProguardFile('proguard-android.txt'),   'proguard-rules.pro'
       }
  }}

  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:appcompat-v7:22.0.0'
      compile 'com.google.android.gms:play-services:7.0.0'
      compile project(path: ':backend_gcm', configuration: 'android-endpoints')}                                                                                        

这是log-:

  

2015-10-02 00:07:36,306 [73561] WARN - nal.AbstractExternalSystemTask - 带有id' com.android.application'的插件未找到。       com.intellij.openapi.externalSystem.model.LocationAwareExternalSystemException:带有id' com.android.application'的插件未找到。       at org.jetbrains.plugins.gradle.service.project.AbstractProjectImportErrorHandler.createUserFriendlyError(AbstractProjectImportErrorHandler.java:103)       在org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.getUserFriendlyError(BaseProjectImportErrorHandler.java:153)       在org.jetbrains.plugins.gradle.service.project.BaseGradleProjectResolverExtension.getUserFriendlyError(BaseGradleProjectResolverExtension.java:358)       at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.getUserFriendlyError(AbstractProjectResolverExtension.java:151)       在com.android.tools.idea.gradle.project.AndroidGradleProjectResolver.getUserFriendlyError(AndroidGradleProjectResolver.java:322)       在org.jetbrains.plugins.gradle.service.project.GradleProjectResolver $ ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:367)       在org.jetbrains.plugins.gradle.service.project.GradleProjectResolver $ ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:333)       在org.jetbrains.plugins.gradle.service.project.GradleExecutionHelper.execute(GradleExecutionHelper.java:203)       在org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:116)       at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:64)       在com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl $ 1.produce(RemoteExternalSystemProjectResolverImpl.java:41)       在com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl $ 1.produce(RemoteExternalSystemProjectResolverImpl.java:37)       在com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)       at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)       at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)       at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:48)       在com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:137)       在com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:123)       在com.intellij.openapi.externalSystem.util.ExternalSystemUtil $ 2.execute(ExternalSystemUtil.java:406)       在com.intellij.openapi.externalSystem.util.ExternalSystemUtil $ 3 $ 2.run(ExternalSystemUtil.java:483)       在com.intellij.openapi.progress.impl.ProgressManagerImpl $ TaskRunnable.run(ProgressManagerImpl.java:471)       在com.intellij.openapi.progress.impl.ProgressManagerImpl $ 2.run(ProgressManagerImpl.java:178)       在com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)       在com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)       在com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)       在com.intellij.openapi.progress.impl.ProgressManagerImpl $ 8.run(ProgressManagerImpl.java:380)       在com.intellij.openapi.application.impl.ApplicationImpl $ 8.run(ApplicationImpl.java:419)       at java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:471)       在java.util.concurrent.FutureTask.run(FutureTask.java:262)       在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)       at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615)       在java.lang.Thread.run(Thread.java:745)       在com.intellij.openapi.application.impl.ApplicationImpl $ 1 $ 1.run(ApplicationImpl.java:149)

1 个答案:

答案 0 :(得分:5)

替换:

classpath 'com.android.tools.build:gradle:1.1.0.'

使用:

classpath 'com.android.tools.build:gradle:1.3.1'

您的主要问题来自尾随.,导致您的版本与任何内容都不匹配。