I have an Android project which uses an aar file. It contains flutter code previously built. In my gradle file there is a relative path to the 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'\'')
}
...
Building project locally everything works fine. Now I'm using azure pipelines to build both projects. My yaml on azure is this:
# 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://[email protected]/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'
When the Gradle@2
task is executed build fails because it cannot locate project.
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.
I checked if the project is there and if it was generated doing a single ls -la
.
Files are ok but the gradle build insists to fail on locate them.
Is there another configuration or task do I need to do?
I've read the links: