Jenkins CI Android Gradle Build Fail

时间:2018-03-01 01:25:36

标签: android docker jenkins android-gradle

我使用jenkins with docker 拉完后安装以下插件

  1. Git插件
  2. Gradle插件
  3. Android Lint插件
  4. Google Play Android Publisher插件
  5. 然后设置JDK,Repository(GitLab)

    AND 创建项目并运行,它会显示以下错误。

    RUN COMMAND

    docker run -p 8080:8080 -v / Users / abc / Library / Android / sdk:/ var / android_home -p 50000:50000 -v jenkins_home:/ var / jenkins_home jenkins / jenkins:lts

    JENKINS CONSOLE OUTPUT

    Building in workspace /var/jenkins_home/workspace/ABC Project
     > git rev-parse --is-inside-work-tree # timeout=10
    Fetching changes from the remote Git repository
     > git config remote.origin.url http://office.viinsoft.com/issoft/mappening-android.git # timeout=10
    Fetching upstream changes from http://office.viinsoft.com/issoft/mappening-android.git
     > git --version # timeout=10
    using GIT_ASKPASS to set credentials 
     > git fetch --tags --progress http://office.viinsoft.com/issoft/mappening-android.git +refs/heads/*:refs/remotes/origin/*
     > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
     > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
    Checking out Revision 7a760b63852e92c57e5b4dea5bdf6680b01d8894 (refs/remotes/origin/master)
     > git config core.sparsecheckout # timeout=10
     > git checkout -f 7a760b63852e92c57e5b4dea5bdf6680b01d8894
    Commit message: "Test Jenkins#2"
     > git rev-list --no-walk 7a760b63852e92c57e5b4dea5bdf6680b01d8894 # timeout=10
    [Gradle] - Launching build.
    [Mappening Project] $ "/var/jenkins_home/workspace/Mappening Project/gradlew" assembleDebug
    Starting a Gradle Daemon (subsequent builds will be faster)
    Configuration 'testCompile' in project ':app' is deprecated. Use 'testImplementation' instead.
    Configuration 'androidTestCompile' in project ':app' is deprecated. Use 'androidTestImplementation' instead.
    :app:preBuild UP-TO-DATE
    :app:preDevDebugBuild UP-TO-DATE
    :app:compileDevDebugAidl UP-TO-DATE
    :app:compileDevDebugRenderscript UP-TO-DATE
    :app:checkDevDebugManifest UP-TO-DATE
    :app:generateDevDebugBuildConfig UP-TO-DATE
    :app:generateDevDebugResValues UP-TO-DATE
    :app:generateDevDebugResources UP-TO-DATE
    :app:mergeDevDebugResourcesAAPT err(Facade for 849578689): /var/android_home/build-tools/26.0.2/aapt2: 6: /var/android_home/build-tools/26.0.2/aapt2: Syntax error: Unterminated quoted string
    AAPT err(Facade for 1702555035): /var/android_home/build-tools/26.0.2/aapt2: 6: /var/android_home/build-tools/26.0.2/aapt2: Syntax error: Unterminated quoted string
    Slave 1702555035 failed to start
    java.lang.RuntimeException: AAPT slave failed to start. Please make sure the current build tools (located at /var/android_home/build-tools/26.0.2/aapt2) are not corrupted.
        at com.android.builder.png.AaptProcess.waitForReadyOrFail(AaptProcess.java:211)
        at com.android.builder.internal.aapt.AaptQueueThreadContext.creation(AaptQueueThreadContext.java:56)
        at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:213)
        at java.lang.Thread.run(Thread.java:748)
    AAPT err(Facade for 1365735589): /var/android_home/build-tools/26.0.2/aapt2: 6: /var/android_home/build-tools/26.0.2/aapt2: Syntax error: Unterminated quoted string
    Slave 1365735589 failed to start
    java.lang.RuntimeException: AAPT slave failed to start. Please make sure the current build tools (located at /var/android_home/build-tools/26.0.2/aapt2) are not corrupted.
        at com.android.builder.png.AaptProcess.waitForReadyOrFail(AaptProcess.java:211)
        at com.android.builder.internal.aapt.AaptQueueThreadContext.creation(AaptQueueThreadContext.java:56)
        at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:213)
        at java.lang.Thread.run(Thread.java:748)
    AAPT err(Facade for 212997924): /var/android_home/build-tools/26.0.2/aapt2: 6: /var/android_home/build-tools/26.0.2/aapt2: Syntax error: Unterminated quoted string
    Slave 212997924 failed to start
    java.lang.RuntimeException: AAPT slave failed to start. Please make sure the current build tools (located at /var/android_home/build-tools/26.0.2/aapt2) are not corrupted.
        at com.android.builder.png.AaptProcess.waitForReadyOrFail(AaptProcess.java:211)
        at com.android.builder.internal.aapt.AaptQueueThreadContext.creation(AaptQueueThreadContext.java:56)
        at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:213)
        at java.lang.Thread.run(Thread.java:748)
    Slave 849578689 failed to start
    java.lang.RuntimeException: AAPT slave failed to start. Please make sure the current build tools (located at /var/android_home/build-tools/26.0.2/aapt2) are not corrupted.
        at com.android.builder.png.AaptProcess.waitForReadyOrFail(AaptProcess.java:211)
        at com.android.builder.internal.aapt.AaptQueueThreadContext.creation(AaptQueueThreadContext.java:56)
        at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:213)
        at java.lang.Thread.run(Thread.java:748)
    
    Error: java.util.concurrent.ExecutionException: java.lang.RuntimeException: No server to serve request. Check logs for details.
    :app:mergeDevDebugResources FAILED
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:mergeDevDebugResources'.
    > Error: java.util.concurrent.ExecutionException: java.lang.RuntimeException: No server to serve request. Check logs for details.
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 13s
    7 actionable tasks: 1 executed, 6 up-to-date
    Build step 'Invoke Gradle script' changed build result to FAILURE
    Build step 'Invoke Gradle script' marked build as failure
    Finished: FAILURE
    

    追踪和仍然错误

    我在google周围看来,解决方案需要使用我不想要的旧版构建工具Android studio 2.1.2 gradle aapt Syntax error: Unterminated quoted string

    有人说我缺少库来执行64位代码,所以我在我的mac OSX上运行以下命令并检查,但看起来没问题Android Studio 3.0 - No server to serve request

    otool -L build-tools/26.0.2/aapt2
    build-tools/26.0.2/aapt2:
        @rpath/libc++.dylib (compatibility version 0.0.0, current version 0.0.0)
        /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
    

    最后,我允许我的本地路径sudo chmod 755 -R /Users/sattha.p/Library/Android/sdk,但即使重启docker也没有任何改变。

0 个答案:

没有答案