【发布时间】:2021-03-27 15:48:42
【问题描述】:
我有一个使用 aar 文件的 Android 项目。它包含之前构建的颤振代码。 在我的 gradle 文件中有一个 aar 的相对路径:
...
repositories {
maven { url '\''https://maven.fabric.io/public'\'' }
maven { url '\''https://jitpack.io'\'' }
maven { url '\''../../flutter_aar/build/host/outputs/repo'\''}
maven { url '\''https://storage.googleapis.com/download.flutter.io'\''}
flatDir(dirs: '\''libs'\'')
}
...
在本地构建项目一切正常。 现在我正在使用 azure 管道来构建这两个项目。 我在 azure 上的 yaml 是这样的:
# Android
# Build your Android project with Gradle.
# Add steps that test, sign, and distribute the APK, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/android
trigger:
batch: true
branches:
include:
- release-version-3.0
exclude:
- bug-*
- master
- develop
pool:
vmImage: 'macos-latest'
variables:
- group: TestApp.Mobile
- name: PAT
- name: FLUTTER_VERSION
steps:
- task: JavaToolInstaller@0
displayName: Install JDK
inputs:
versionSpec: '8'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- checkout: self
submodules: true
- bash: |
set -e
set -x
git clone -b 1.22.2 --single-branch https://github.com/flutter/flutter.git
export PATH=`pwd`/flutter/bin:$PATH
B64_PAT=$(printf ":generated_pat" | base64)
git config --global credential.helper store
git config --global user.name "test_user"
git config --global http.extraheader "Authorization: Basic ${B64_PAT}"
git clone -b development https://my_organization@dev.azure.com/base_arch/_git/flutter_aar
cd flutter_aar
flutter pub upgrade
flutter build aar
pwd
ls -la
cd ..
pwd
ls -la
echo "$(cat app/build.gradle)"
displayName: Build AAR
- task: Gradle@2
displayName: Build Android App
inputs:
workingDirectory: '$(Build.SourcesDirectory)'
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
publishJUnitResults: false
testResultsFiles: '**/TEST-*.xml'
tasks: 'assembleHomoProfile'
Gradle@2 任务执行时,构建失败,因为找不到项目。
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileHomoProfileJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:homoProfileCompileClasspath'.
> Could not find com.project.flutter_aar:flutter_profile:1.0.
Required by:
project :app
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
我检查了项目是否存在以及它是否是通过单个ls -la 生成的。
文件没问题,但 gradle 构建坚持无法找到它们。
我还需要做其他配置或任务吗?
我已阅读链接:
【问题讨论】:
标签: android azure flutter azure-pipelines