2016-07-07 92 views
0

當我將項目與gradle文件同步時,我有這個問題 錯誤:錯誤原因:未指定buildToolsVersion。構建工具版本未指定

這是的build.gradle項目

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.3" 

    defaultConfig { 
     applicationId "com.example.natalia.ministerioproyecto" 
     minSdkVersion 10 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
    } 
    sourceSets 
      { 
       main 
         { 
          res.srcDirs = 
            [ 
              '/src/main/res/layout/Polo azul/Formulario Dinara' 
            ] 
         } 
      } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.4.0' 
    classpath 'com.android.support:appcompat-v7:23.4.0' 
} 

和THI是模塊:應用

apply plugin:'com.android.application' 

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


     } 
    } 


    allprojects { 
     repositories { 
      jcenter() 

     } 
    } 

    task clean(type: Delete) { 
     delete rootProject.buildDir 
    } 

回答

0

搖籃文件是錯誤的。

的build.gradle項目

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

 

 
    } 
 
} 
 

 

 
allprojects { 
 
    repositories { 
 
     jcenter() 
 

 
    } 
 
} 
 

 
task clean(type: Delete) { 
 
    delete rootProject.buildDir 
 
}

模塊:應用

apply plugin: 'com.android.application' 
 

 
android { 
 
    compileSdkVersion 23 
 
    buildToolsVersion "23.0.3" 
 

 
    defaultConfig { 
 
     applicationId "com.example.natalia.ministerioproyecto" 
 
     minSdkVersion 10 
 
     targetSdkVersion 23 
 
     versionCode 1 
 
     versionName "1.0" 
 
    } 
 
    sourceSets 
 
      { 
 
       main 
 
         { 
 
          res.srcDirs = 
 
            [ 
 
              '/src/main/res/layout/Polo azul/Formulario Dinara' 
 
            ] 
 
         } 
 
      } 
 
    buildTypes { 
 
     release { 
 
      minifyEnabled false 
 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
 
     } 
 
    } 
 
} 
 

 
dependencies { 
 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
 
    testCompile 'junit:junit:4.12' 
 
    compile 'com.android.support:appcompat-v7:23.4.0' 
 
    classpath 'com.android.support:appcompat-v7:23.4.0' 
 
}

相關問題