2014-12-20 5 views
4

Windows에서 gradlew 테스트 --stacktrace 실행 8.1. 이 오류가 나타납니다.Gradle Build Test Android Studio에서 Robolectric 테스트를 수행 할 때 "Could not normalize ..."

Could not normalize path for file 'C:\Users\Aleesa\Documents\SDK\platforms\android-18\android.jar;C:\Users\Aleesa\Documents\SDK\add-ons\addon-google_apis-google-18\libs\usb.jar;C:\Users\Aleesa\Documents\SDK\add-ons\addon-google_apis-google-18\libs\effects.jar;C:\Users\Aleesa\Documents\SDK\add-ons\addon-google_apis-google-18\libs\maps.jar'.

나는 그 파일이 없기 때문에 그것을 알고 있습니다. 나는 이것을 분리 할 수 ​​있어야하지만 (";") DST에서 어떻게할지는 모르겠다. 여기 내 모듈의 build.gradle입니다 :

buildscript { 
    repositories { 
     mavenCentral() 
     maven { url 'http://download.crashlytics.com/maven' } 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:1.0.0' 
     classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+' 
     classpath 'com.neenbedankt.gradle.plugins:android-apt:+' 
     classpath 'com.jakewharton.hugo:hugo-plugin:1.1.0' 
     classpath 'org.robolectric:robolectric-gradle-plugin:0.14.+' 
    } 
} 

apply plugin: 'com.android.application' 
apply plugin: 'android-apt' 
apply plugin: 'crashlytics' 
apply plugin: 'hugo' 
apply plugin: 'robolectric' 

repositories { 
    maven { url 'http://download.crashlytics.com/maven' } 
} 

android { 
    compileSdkVersion "Google Inc.:Google APIs:18" 
    buildToolsVersion "20.0.0" 

    defaultConfig { 
     minSdkVersion 9 
     targetSdkVersion 18 
    } 

    buildTypes { 
     release { 
      signingConfig signingConfigs.release 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
     } 
    } 

    packagingOptions { 
     exclude 'META-INF/services/javax.annotation.processing.Processor' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/NOTICE.txt' 
     exclude 'META-INF/NOTICE' 
    } 

    lintOptions { 
     abortOnError false 
     disable 'InvalidPackage' 
    } 

    sourceSets { 
     androidTest { 
      setRoot('src/androidTest') 
     } 
    } 
} 

dependencies { 
    compile project(':Dependencies') 
    compile 'com.jakewharton:butterknife:5.1.2' 
    compile 'com.actionbarsherlock:actionbarsherlock:[email protected]' 
    compile 'com.viewpagerindicator:library:[email protected]' 

    compile project(':ALIBShowcaseViewLegacy') 
    compile project(':ALIBDateTimePicker') 
    compile project(':ALIBFancyCoverFlow') 
    compile project(':ALIBFlowLayout') 
    compile project(':ALIBParalloidViews') 
    compile project(':ALIBSlidingUpPanel') 
    compile project(':ALIBTiltEffect') 
    compile project(':ALIBFloatLabel') 

    compile files('libs/android-async-http-1.4.5.jar') 
    compile files('libs/android-viewbadger.jar') 
    compile files('libs/gcm.jar') 
    compile files('libs/PayPalAndroidSDK-2.8.2.jar') 

    compile 'org.scribe:scribe:1.3.5' 
    compile 'com.squareup.picasso:picasso:2.3.4' 
    compile 'commons-io:commons-io:2.4' 
    compile 'org.apache.commons:commons-collections4:4.0' 
    compile 'org.apache.commons:commons-lang3:3.3.2' 
    compile 'com.google.android.gms:play-services:5.0.89' 
    compile 'com.google.code.gson:gson:2.2.4' 
    compile 'joda-time:joda-time:2.3' 
    compile 'com.crashlytics.android:crashlytics:1.+' 
    compile 'fr.avianey:facebook-android-api:[email protected]' 
    compile 'com.nhaarman.listviewanimations:lib-core:[email protected]' 
    compile 'com.nhaarman.listviewanimations:lib-manipulation:[email protected]' 
    compile 'com.nhaarman.listviewanimations:lib-core-slh:[email protected]' 
    compile 'de.greenrobot:eventbus:2.4.0' 

    //We dont use this 
    compile 'com.github.nirhart:parallaxscroll:1.0' 
    compile 'se.emilsjolander:stickylistheaders:2.5.2+' 
    //Auto parcel shit 
    compile 'com.github.frankiesardo:auto-parcel:+' 
    apt 'com.github.frankiesardo:auto-parcel-processor:+' 

    //Genymotion 
    androidTestCompile 'com.genymotion.api:genymotion-api:1.0.0' 

    //Test shit 
    androidTestCompile 'org.hamcrest:hamcrest-integration:1.1' 
    androidTestCompile 'org.hamcrest:hamcrest-core:1.1' 
    androidTestCompile 'org.hamcrest:hamcrest-library:1.1' 

    androidTestCompile('junit:junit:4.+') { 
     exclude module: 'hamcrest-core' 
    } 
    androidTestCompile('org.robolectric:robolectric:2.3') { 
     exclude module: 'classworlds' 
     exclude module: 'commons-logging' 
     exclude module: 'httpclient' 
     exclude module: 'maven-artifact' 
     exclude module: 'maven-artifact-manager' 
     exclude module: 'maven-error-diagnostics' 
     exclude module: 'maven-model' 
     exclude module: 'maven-project' 
     exclude module: 'maven-settings' 
     exclude module: 'plexus-container-default' 
     exclude module: 'plexus-interpolation' 
     exclude module: 'plexus-utils' 
     exclude module: 'support-v4' 
     exclude module: 'wagon-file' 
     exclude module: 'wagon-http-lightweight' 
     exclude module: 'wagon-provider-api' 
    } 

// compile files(myClasspath.split(";")) 
} 

robolectric { 
    // configure the set of classes for JUnit tests 
    include '**/*Test.class' 
    exclude '**/espresso/**/*.class' 

    // configure max heap size of the test JVM 
    maxHeapSize = '2048m' 

    // configure the test JVM arguments 
    jvmArgs '-XX:MaxPermSize=512m', '-XX:-UseSplitVerifier' 

    // Specify max number of processes (default is 1) 
    maxParallelForks = 4 

    // Specify max number of test classes to execute in a test process 
    // before restarting the process (default is unlimited) 
    forkEvery = 150 

    // configure whether failing tests should fail the build 
    ignoreFailures true 

    // use afterTest to listen to the test execution results 
    afterTest { descriptor, result -> 
     println "Executing test for ${descriptor.name} with result: ${result.resultType}" 
    } 
} 
+0

빌드의 어떤 단계에서 위의 에러가 발생합니까? 실패하기 전에 무엇을하려고합니까? –

+0

'compileSdkVersion'을 18로 변경하고'buildToolsVersion'을 21.1.2로 변경한다면? KitKat과 Lollipop을 타겟팅하지 않는 이유는 무엇입니까? –

+0

@AlexFlorescu "gradlew test"를 사용 중입니다. TestDebug 중에 오류가 발생합니다. 이전 줄 testDebugClasses가 성공적이었습니다. 다음은 스택 추적입니다. http://hastebin.com/omunezimim.rb – KennethOXu

답변

1
에 안드로이드 Gradle을 플러그인 버전을 변경

이 제대로 Windows에서 잘못된 문자를 탈출하지 않았다 플러그인의 이전 버전에서이 문제를

dependencies { 
    classpath 'com.android.tools.build:gradle:1.1.2' 
} 

했다 , 그 v1.1.2 고정 :

https://code.google.com/p/android/issues/detail?id=148912