Jenkins:Gradle构建:AAPT2问题:AAPT2 aapt2-3.4.0-5326820-windows守护程序#0:守护程序启动失败

时间:2019-05-15 19:27:46

标签: android jenkins build.gradle

我正在尝试与Jenkins进行持续集成。我在构建部分中提到了命令“清理”和“组装”。但是由于AAPT2问题,构建失败。 Gradle版本:'com.android.tools.build:gradle:3.4.1' 注意:用于同一项目的相同“汇编”命令在Android Studio中以及从命令行运行都很好。

I have tried: 
1. Downgraded gradle version.
2. Downgrading compiledSDKversion to 26
3. Making AAPT2 indicator in gralde.properties file = False
4. Tried searching on google and stackoverflow, but still issue exists.

詹金斯记录:

14:52:16 > Task :app:mergeCobraDebugResources FAILED
14:52:16 
14:52:16 FAILURE: Build failed with an exception.
14:52:16 
14:52:16 * What went wrong:
14:52:16 Execution failed for task ':app:mergeCobraDebugResources'.
14:52:16 > 8 exceptions were raised by workers:
14:52:16   com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #0: Daemon startup failed
14:52:16   This should not happen under normal circumstances, please file an issue if it does.
14:52:16   com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #1: Daemon startup failed
14:52:16   This should not happen under normal circumstances, please file an issue if it does.
14:52:16   com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #2: Daemon startup failed
14:52:16   This should not happen under normal circumstances, please file an issue if it does.
14:52:16   com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #3: Daemon startup failed
14:52:16   This should not happen under normal circumstances, please file an issue if it does.
14:52:16   com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #4: Daemon startup failed
14:52:16   This should not happen under normal circumstances, please file an issue if it does.
14:52:16   com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #5: Daemon startup failed
14:52:16   This should not happen under normal circumstances, please file an issue if it does.
14:52:16   com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #6: Daemon startup failed
14:52:16   This should not happen under normal circumstances, please file an issue if it does.
14:52:16   com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #7: Daemon startup failed
14:52:16   This should not happen under normal circumstances, please file an issue if it does.
14:52:16 
14:52:16 
14:52:16 * Try:
14:52:16 Run with --info or --debug option to get more log output. Run with --scan to get full insights.
14:52:16 

GRADLE FILE(PROJECT LEVEL)

import org.apache.tools.ant.taskdefs.condition.Os

apply plugin: 'com.android.application'

android {
    signingConfigs {
        lookitRelease {
            keyAlias LOOKIT_RELEASE_KEY_ALIAS
            keyPassword LOOKIT_RELEASE_KEY_PASSWORD
            if (Os.isFamily(Os.FAMILY_WINDOWS)) {
                storeFile file(LOOKIT_RELEASE_STORE_FILE)
            } else if (Os.isFamily(Os.FAMILY_MAC)) {
                storeFile file(LOOKIT_RELEASE_STORE_FILE_MAC)
            }
            storePassword LOOKIT_RELEASE_KEY_PASSWORD
        }
    }
    Properties versionProps = new Properties()
    def versionPropsFile = file('version.properties')
    if (versionPropsFile.exists())
        versionProps.load(new FileInputStream(versionPropsFile))
    def code = (versionProps['VERSION_CODE'] ?: "0").toInteger() + 1
    versionProps['VERSION_CODE'] = code.toString()
    versionProps.store(versionPropsFile.newWriter(), null)
    compileSdkVersion 28
    defaultConfig {
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        applicationId "com.lightwave.lwRvCam"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode code
        versionName "2.25.7." + code
    }
    flavorDimensions "default"
    productFlavors {

    }
    sourceSets {

    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            debuggable true
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

}

dependencies {
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation project(':LwRvcLib-release')
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:support-media-compat:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'



    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:percent:28.0.0'
    implementation 'com.github.johnpersano:supertoasts:1.3.4@aar'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.google.android.gms:play-services-analytics:15.0.0'
    implementation 'com.google.android.gms:play-services-measurement-base:15.0.0'
    implementation 'com.github.castorflex.verticalviewpager:library:19.0.1'
    implementation 'com.google.firebase:firebase-core:15.0.0'
    implementation 'com.google.android.gms:play-services-maps:15.0.0'
    implementation 'com.cleveroad:slidingtutorial:1.0.9'
    implementation 'com.daimajia.swipelayout:library:1.2.0@aar'
    //androidTestImplementation 'com.android.support:support-annotations:27.1.1'
    //    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    //    androidTestImplementation 'com.android.support.test:rules:1.0.1'
    androidTestImplementation 'org.hamcrest:hamcrest-library:2.1'
    // androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3'
    //    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2') {
    //        exclude group: 'javax.inject'
    //    }
    ///////////////////////////////////////Androidx Dependencies/////////////////////////
    // Core library
    androidTestImplementation 'androidx.test:core:1.0.0'
    // AndroidJUnitRunner and JUnit Rules
    androidTestImplementation 'androidx.test:runner:1.1.0'
    androidTestImplementation 'androidx.test:rules:1.1.0'
    // Assertions
    androidTestImplementation 'androidx.test.ext:junit:1.0.0'
    androidTestImplementation 'androidx.test.ext:truth:1.0.0'
    androidTestImplementation 'com.google.truth:truth:0.44'
    // Espresso dependencies
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-accessibility:3.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-web:3.1.0'
    androidTestImplementation 'androidx.test.espresso.idling:idling-concurrent:3.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-web:3.1.0'
    androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
    // The following Espresso dependency can be either "implementation"
    // or "androidTestImplementation", depending on whether you want the
    // dependency to appear on your APK's compile classpath or the test APK
    // classpath.
    androidTestImplementation 'androidx.test.espresso:espresso-idling-resource:3.1.0'
    /////////////////////////////////////////////////////////////////////////////////////////////////////
    androidTestImplementation 'junit:junit:4.13-beta-2'
    testImplementation 'junit:junit:4.13-beta-2'
    allprojects {
        repositories {
            jcenter()
            google()
        }
    }
}

if (hasProperty('buildScan')) {
    buildScan {
        termsOfServiceUrl = 'https://gradle.com/terms-of-service'
        termsOfServiceAgree = 'yes'
    }
}

apply plugin: 'com.google.gms.google-services'

GRADLE FILE(APP LEVEL):

ext {
    var = '28.0.3'
    var1 = '28.0.3'
    var2 = '26.1.1-alpha1'
}
buildscript{
    repositories {
        maven { url 'https://maven.google.com' }
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
        classpath 'com.google.gms:google-services:3.2.0'

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



allprojects {
    repositories {
        maven { url 'https://maven.google.com' }
        jcenter()
    }

}


if (hasProperty('buildScan')) {
    buildScan {
        termsOfServiceUrl = 'https://gradle.com/terms-of-service'
        termsOfServiceAgree = 'yes'
    }
}

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

研究生问题记录:

Have raised issue in gradle with text: AAPT2 issues: Daemon startup failed

GOOGLE问题跟踪器:

https://issuetracker.google.com/132686257 AAPT2 issues. Gradle version : 3.4.0 Android studio version : 3.4. Android SDK tools: 26.1.1

1 个答案:

答案 0 :(得分:0)