Ionic Jenkins -AAPT 2-守护程序启动失败

wpx232ag  于 12个月前  发布在  Ionic
关注(0)|答案(1)|浏览(193)

我目前正在自动化APK构建过程,为项目设置Jenkins管道。我的Jenkins在Docker容器上,安装了npm,Ionic,OpenJDK,Android SDK和Gradle。我们的团队在项目中使用Capacitor。这是我在管道中的“Build APK”阶段

stage('Build APK') {
         sh 'npm run build'
         sh 'npx capacitor sync android'
         sh 'npx capacitor build android --keystorepath /keyfiles/<filename>.jks --keystorealias <alias> --keystorepass <pass> --keystorealiaspass <pass> --androidreleasetype APK'

字符串
然而,我在Jenkins控制台中遇到了一个错误:

> Task :app:mergeReleaseResources FAILED
        > Task :capacitor-google-maps:extractReleaseAnnotations
        
        FAILURE: Build failed with an exception.
        
        * What went wrong:
        Execution failed for task ':app:mergeReleaseResources'.
        > Multiple task action failures occurred:
        > A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
        > AAPT2 aapt2-7.2.1-7984345-linux Daemon #0: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
        > A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
        > AAPT2 aapt2-7.2.1-7984345-linux Daemon #2: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
        > A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
        > AAPT2 aapt2-7.2.1-7984345-linux Daemon #1: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.


尝试在谷歌和stackoverflow搜索,但仍然存在问题。

yrwegjxp

yrwegjxp1#

我通过切换到Jenkins的不同基础镜像解决了这个问题。我最初使用Alpine镜像(FROM docker.io/jenkins/jenkins:alpine),然后将其更改为最新版本(FROM jenkins/jenkins:latest),成功解决了这个问题。

相关问题