2014-11-28 2 views
4

이 링크를 따라 가면서 gradle 빌드를 실행하십시오.gradle-android-scala-plugin : 튜토리얼을 수행 한 후 오류가 발생했습니다.

gradle build --daemon -s 

FAILURE: Build failed with an exception. 

* What went wrong: 
A problem occurred configuring root project 'hello-scaloid-gradle-master'. 
> Could not resolve all dependencies for configuration ':_debugCompile'. 
    > Could not find com.android.support:multidex:1.0.0. 
    Searched in the following locations: 
     https://jcenter.bintray.com/com/android/support/multidex/1.0.0/multidex-1.0.0.pom 
     https://jcenter.bintray.com/com/android/support/multidex/1.0.0/multidex-1.0.0.jar 
    Required by: 
     :hello-scaloid-gradle-master:unspecified 

* Try: 
Run with --info or --debug option to get more log output. 

* Exception is: 
org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'hello-scaloid-gradle-master'. 
    at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:91) 
    at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:86) 
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:65) 

Gradle을 설정은 다음과 같습니다 :

buildscript { 
    repositories { 
     mavenCentral() 
    } 

    dependencies { 
     classpath "com.android.tools.build:gradle:1.0.0-rc1" 
     classpath "jp.leafytree.gradle:gradle-android-scala-plugin:1.3.1" 
    } 
} 

repositories { 
    jcenter() 
} 

apply plugin: "com.android.application" 
apply plugin: "jp.leafytree.android-scala" 

android { 
    compileSdkVersion "android-21" 
    buildToolsVersion "21.1.1" 

    defaultConfig { 
     minSdkVersion 8 
     targetSdkVersion 21 
     testInstrumentationRunner "com.android.test.runner.MultiDexTestRunner" 
     versionCode 1 
     versionName "1.0" 
    } 

    sourceSets { 
     main { 
      scala { 
       srcDir "src/main/scala" // default: "src/main/scala" 
      } 
     } 

     androidTest { 
      scala { 
       srcDir "src/androidTest/scala" // default: "src/androidTest/scala" 
      } 
     } 
    } 

    dexOptions { 
     preDexLibraries false 
    } 
} 

dependencies { 
    compile "com.android.support:multidex:1.0.0" 
    compile "org.scala-lang:scala-library:2.11.4" 
} 

tasks.withType(ScalaCompile) { 
    scalaCompileOptions.deprecation = false 
    scalaCompileOptions.additionalParameters = ["-feature"] 
} 

afterEvaluate { 
    tasks.matching { 
     it.name.startsWith("dex") 
    }.each { dx -> 
     if (dx.additionalParameters == null) { 
      dx.additionalParameters = [] 
     } 
     dx.additionalParameters += "--multi-dex" 
     dx.additionalParameters += "--main-dex-list=$rootDir/main-dex-list.txt".toString() 
    } 
} 

답변

1

난 당신이 앱 수준의 build.gradle에 모든 구성을 넣어 것으로 의심

https://github.com/saturday06/gradle-android-scala-plugin

그것은의 오류를 올렸다.

아마 이런 식으로 시도 ->

프로젝트/build.gradle

// 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:1.1.3' 
     classpath "jp.leafytree.gradle:gradle-android-scala-plugin:1.4" 
     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

프로젝트/응용 프로그램/build.gradle

apply plugin: 'com.android.application' 
apply plugin: "jp.leafytree.android-scala" 

android { 
    compileSdkVersion 22 
    buildToolsVersion "22.0.1" 

    defaultConfig { 
     applicationId "your.apps.id" 
     minSdkVersion 15 
     targetSdkVersion 22 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile "org.scala-lang:scala-library:2.11.6" 
    compile 'com.android.support:appcompat-v7:22.0.0' 
} 
+0

이 사람에게 맥주를 구입! – nadavwr

관련 문제