2016-07-24 7 views
1

이 build.gradle 파일ARToolkit의 buildToolsVersion을 찾을 수 없습니다

apply plugin: 'com.android.application' 

    model { 
     android { 
      compileSdkVersion = 23 
      buildToolsVersion = "23.0.3" 

      defaultConfig.with { 
       applicationId = "org.artoolkit.ar.samples.ARSimpleNativeCars" 
       minSdkVersion.apiLevel = 15 
       targetSdkVersion.apiLevel = 22 
       versionCode = 1 
       versionName = "1.0.2" 
       buildConfigFields.with { 
        create() {   
         type = "int"  
         name = "VALUE" 
         value = "1"  
        } 
       } 

       ndk.with { 
        moduleName = "ARSimpleNativeCars" 
       } 
      } 
     } 

     android.buildTypes { 
      release { 
       minifyEnabled = false 
       proguardFiles += file('proguard-rules.pro') 
      } 
     } 

     android.productFlavors { 
     } 

     android.sources { 
      main.jni { 
       source { 
        srcDirs = ['src/main/nop'] 
       } 
      } 
      main.jniLibs { 
       source { 
        srcDirs = ['src/main/libs'] 
       } 
      } 
     } 

     android.compileOptions { 
      sourceCompatibility JavaVersion.VERSION_1_7 
      targetCompatibility JavaVersion.VERSION_1_7 
     } 
    } 

    dependencies { 
     //compile 'com.android.support:support-v4:23.0.1' 
     //compile 'com.android.support:appcompat-v7:23.0.1' 
     compile project(':aRBaseLib') 
    } 

이것은 최상위 build.gradle 파일입니다

// Top-level build file where you can add configuration options common to all sub-projects/modules. 
buildscript { 
    repositories { 
     jcenter() 
    } 

    dependencies { 

     repositories { 
      mavenCentral() 
     } 
     classpath 'com.android.tools.build:gradle:2.1.0' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 
allprojects { 
    repositories { 
     jcenter() 
    } 
} 

이 내가 을 실행하기 위해 노력하고있어 ARToolkit 샘플 안드로이드 프로젝트입니다 이 프로젝트를 실행하려고 할 때마다 그걸 말합니다.

Gradle 'ARSimpleNativeCarsProj' project refresh failed 

Error: Cause: buildToolsVersion is not specified. 

apply plugin: 'com.android.application' <---- in this line it is actually 

apply plugin: 'com.android.model.application' which if I kept it keep saying 
failed to find plugin com.android.model.application 

b 플러그인 부분에서 모델을 제거한 경우 utbuildToolsVersion이 지정되지 않았습니다.

고맙습니다 ...

답변

1

먼저 모델을 유지해야합니다. 이 모델은 Android Studio에서 기본 코드를 지원하는 새로운 실험용 그라디언트 플러그인을 의미합니다. 자세한 내용은 여기를 참조하십시오 :

이전 모델 (현재)의 DSL에 '모델'이 없으므로 모델을 제거하면 buildToolsVersion을 찾을 수 없습니다. 그러므로 gradle.build 파일에서 완전한 'model {...}'섹션을 제거해야합니다. 그러나 그렇지 않으면 당신은이 프로젝트를 만들 수 없기 때문에 필요합니다. 또한

최상위 수준 Gradle을 파일이 실제로 당신이 당신의 다른 Gradle을 버전이 왜 궁금하네요이

buildscript { 
    repositories { 
     jcenter() 
    } 

dependencies { 
    classpath 'com.android.tools.build:gradle-experimental:0.7.0' 

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

과 같이한다 (그래서 이것은 단지 보조 노트입니다). 이

을 도움이된다면 http://artoolkit.org/documentation/doku.php?id=4_Android:android_native

가 알려줘 :이 문서를 읽기를 포기 해주십시오 게다가

네이티브 C/C++ 코드와 NDK를 사용하여 안드로이드 개발을 시작합니다