当我在jenkins 上构建我的flutter项目时,我得到了以下异常
C:ProgramDataJenkins.jenkinsworkspaceautomated test app>flutter build apk
Building with sound null safety
Running Gradle task 'assembleRelease'...
Parameter format not correct -
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
> Android resource compilation failed
ERROR:C:WindowsSystem32configsystemprofile.gradlecachestransforms-3846e5094a0f0114af067375a609d094etransformedcore-1.6.0resdrawable-mdpi-v4notification_bg_normal.9.png: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:WindowsSystem32configsystemprofile.gradlecachestransforms-3846e5094a0f0114af067375a609d094etransformedcore-1.6.0resdrawable-mdpi-v4notification_bg_low_normal.9.png: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:WindowsSystem32configsystemprofile.gradlecachestransforms-3846e5094a0f0114af067375a609d094etransformedcore-1.6.0resdrawable-mdpi-v4notification_bg_low_pressed.9.png: AAPT: error: file not found.
- 尝试:
使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出。使用--scan运行以获得完整的见解。
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 25s
Running Gradle task 'assembleRelease'... 86.2s
Gradle task assembleRelease failed with exit code 1
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE
我在Windows 10上的Gitlab ci/Runner遇到了这个问题,我整天都在应付。问题是,我以前没有用我的用户帐户安装Gitlab Runner,权限为windows:
cd C:GitLab-Runner
.gitlab-runner.exe install
.gitlab-runner.exe start
但之后,我使用我的用户帐户安装了Gitlab Runner。问题不再出现。
cd C:GitLab-Runner
.gitlab-runner.exe install --user ".USERR" --password "MYPASSWORD"
.gitlab-runner.exe start
所以,我认为你的问题可能是你没有以特权运行脚本。我之所以看到这个,是因为当我试图访问图像文件时。例如:C:WindowsSystem32configsystemprofile.gradlecachestransforms-3846e5094a0f0114af067375a609d094etransformedcore-1.6.0resdrawable-mdpi-v4notification_bg_normal.9.png
如果不接受权限管理员窗口,我将无法访问"C:WindowsSystem32"
。但如果我接受作为管理员,我可以找到图像文件。