Test Fail on $ (./gradlew assembleDebug)

android
circle.yml

#1

I’m trying to run tests of my Android project using Kotlin and it fails during $ (./gradlew assembleDebug) below is the log

> Configuring > 2/2 projects
> Configuring > 2/2 projects > Resolving dependencies ':app:_debugUnitTestCompi > Resolving dependencies ':app:_debugUnitTestApk' > Resolving dependencies ':app:releaseWearApp' > Resolving dependencies ':app:wearApp' > Resolving dependencies ':app:_releaseUnitTestCom > Resolving dependencies ':app:_releaseUnitTestApk > Resolving dependencies ':app:_debugAndroidTestCo > Resolving dependencies ':app:_debugAndroidTestAp > Resolving dependencies ':app:kapt'> Building 0% > :app:preBuild:app:preBuild 
> Building 0%UP-TO-DATE
> Building 0%
> Building 0%1% > :app:preDebugBuild:app:preDebugBuild 
> Building 1%UP-TO-DATE
> Building 1%
> Building 1%3% > :app:checkDebugManifest:app:checkDebugManifest
> Building 3%4% > :app:preReleaseBuild:app:preReleaseBuild 
> Building 4%UP-TO-DATE
> Building 4%
> Building 4%6% > :app:prepareComAndroidSupportAnimatedVectorDrawable2321Library:app:prepareComAndroidSupportAnimatedVectorDrawable2321Library
> Building 6%8% > :app:prepareComAndroidSupportAppcompatV72321Library:app:prepareComAndroidSupportAppcompatV72321Library
> Building 8%9% > :app:prepareComAndroidSupportCardviewV72321Library:app:prepareComAndroidSupportCardviewV72321Library
> Building 9%11% > :app:prepareComAndroidSupportDesign2321Library:app:prepareComAndroidSupportDesign2321Library
> Building 11%2% > :app:prepareComAndroidSupportGridlayoutV72310Library:app:prepareComAndroidSupportGridlayoutV72310Library
> Building 12%4% > :app:prepareComAndroidSupportRecyclerviewV72321Library:app:prepareComAndroidSupportRecyclerviewV72321Library
> Building 14%6% > :app:prepareComAndroidSupportSupportV132400Library:app:prepareComAndroidSupportSupportV132400Library
> Building 16%7% > :app:prepareComAndroidSupportSupportV42400Library:app:prepareComAndroidSupportSupportV42400Library
> Building 17%9% > :app:prepareComAndroidSupportSupportVectorDrawable2321Library:app:prepareComAndroidSupportSupportVectorDrawable2321Library
> Building 19%20% > :app:prepareComCrashlyticsSdkAndroidAnswers136Library:app:prepareComCrashlyticsSdkAndroidAnswers136Library
> Building 20%2% > :app:prepareComCrashlyticsSdkAndroidBeta114Library:app:prepareComCrashlyticsSdkAndroidBeta114Library
> Building 22%4% > :app:prepareComCrashlyticsSdkAndroidCrashlytics255Library:app:prepareComCrashlyticsSdkAndroidCrashlytics255Library
> Building 24%5% > :app:prepareComCrashlyticsSdkAndroidCrashlyticsCore238Library:app:prepareComCrashlyticsSdkAndroidCrashlyticsCore238Library
> Building 25%7% > :app:prepareComGetkeepsafeRelinkerRelinker121Library:app:prepareComGetkeepsafeRelinkerRelinker121Library
> Building 27%9% > :app:prepareComGithubKittinunfFuelFuelAndroid131Library:app:prepareComGithubKittinunfFuelFuelAndroid131Library
> Building 29%30% > :app:prepareComGithubKittinunfReactiveandroidReactiveandroidAp:app:prepareComGithubKittinunfReactiveandroidReactiveandroidAppcompatV70218Library
> Building 30%2% > :app:prepareComGithubKittinunfReactiveandroidReactiveandroidDe:app:prepareComGithubKittinunfReactiveandroidReactiveandroidDesign0218Library
> Building 32%3% > :app:prepareComGithubKittinunfReactiveandroidReactiveandroidUi:app:prepareComGithubKittinunfReactiveandroidReactiveandroidUi0218Library
> Building 33%5% > :app:prepareComJoanzapataIconifyAndroidIconify222Library:app:prepareComJoanzapataIconifyAndroidIconify222Library
> Building 35%7% > :app:prepareComJoanzapataIconifyAndroidIconifyFontawesome222Li:app:prepareComJoanzapataIconifyAndroidIconifyFontawesome222Library
> Building 37%8% > :app:prepareComOgaclejapanSmarttablayoutLibrary161Library:app:prepareComOgaclejapanSmarttablayoutLibrary161Library
> Building 38%40% > :app:prepareIoFabricSdkAndroidFabric1310Library:app:prepareIoFabricSdkAndroidFabric1310Library
> Building 40%1% > :app:prepareIoReactivexRxandroid120Library:app:prepareIoReactivexRxandroid120Library
> Building 41%3% > :app:prepareIoRealmRealmAndroidLibrary100Library:app:prepareIoRealmRealmAndroidLibrary100Library
> Building 43%5% > :app:prepareMeDm7BarcodescannerCore184Library:app:prepareMeDm7BarcodescannerCore184Library
> Building 45%6% > :app:prepareMeDm7BarcodescannerZxing184Library:app:prepareMeDm7BarcodescannerZxing184Library
> Building 46%8% > :app:prepareUkCoChrisjenxCalligraphy220Library:app:prepareUkCoChrisjenxCalligraphy220Library
> Building 48%50% > :app:prepareDebugDependencies:app:prepareDebugDependencies
> Building 50%1% > :app:compileDebugAidl:app:compileDebugAidl
> Building 51%3% > :app:compileDebugRenderscript:app:compileDebugRenderscript
> Building 53%4% > :app:generateDebugBuildConfig:app:generateDebugBuildConfig
> Building 54%6% > :app:mergeDebugShaders:app:mergeDebugShaders
> Building 56%8% > :app:compileDebugShaders:app:compileDebugShaders
> Building 58%9% > :app:generateDebugAssets:app:generateDebugAssets
> Building 59%61% > :app:mergeDebugAssets:app:mergeDebugAssets
> Building 61%2% > :app:processDebugManifest:app:processDebugManifest
> Building 62%4% > :app:fabricGenerateResourcesDebug:app:fabricGenerateResourcesDebug
> Building 64%6% > :app:generateDebugResValues:app:generateDebugResValues
> Building 66%7% > :app:generateDebugResources:app:generateDebugResources
> Building 67%9% > :app:mergeDebugResources:app:mergeDebugResources
> Building 69%70% > :app:processDebugResources:app:processDebugResources
> Building 70%2% > :app:generateDebugSources:app:generateDebugSources
> Building 72%4% > :app:incrementalDebugJavaCompilationSafeguard:app:incrementalDebugJavaCompilationSafeguard
> Building 74%5% > :app:compileDebugKotlin:app:compileDebugKotlin
> Building 75% > :app:compileDebugKotlin
> Building 75% > :app:compileDebugKotlinFAILURE: 
> Building 75% > :app:compileDebugKotlinBuild failed with an exception.
> Building 75% > :app:compileDebugKotlin
> Building 75% > :app:compileDebugKotlin
> Building 75% > :app:compileDebugKotlin* What went wrong:
> Building 75% > :app:compileDebugKotlinPermGen space
> Building 75% > :app:compileDebugKotlin
> Building 75% > :app:compileDebugKotlin* Try:
> Building 75% > :app:compileDebugKotlinRun with 
> Building 75% > :app:compileDebugKotlin--stacktrace
> Building 75% > :app:compileDebugKotlin option to get the stack trace. Run with 
> Building 75% > :app:compileDebugKotlin--info
> Building 75% > :app:compileDebugKotlin or 
> Building 75% > :app:compileDebugKotlin--debug
> Building 75% > :app:compileDebugKotlin option to get more log output.
> Building 75% > :app:compileDebugKotlin
(./gradlew assembleDebug) returned exit code 1

and my circle.yml file looks like this

    artefacts:
        - /home/ubuntu/dash-android/app/build/outputs/apk/

machine:
    environment:
        ANDROID_HOME: /usr/local/android-sdk-linux

dependencies:
    override:
        - echo y | android update sdk --no-ui --all --filter tools,platform-tools,build-tools-24.0.0,android-24,extra-google-m2repository,extra-google-google_play_services,extra-android-support
        - ANDROID_HOME=/usr/local/android-sdk-linux ./gradlew dependencies

test:
    override:
    - ./gradlew tasks | grep connected
    - (./gradlew assembleDebug):
        timeout: 640

#2