I have a multi module project and I needed to create a module for my aar.
Here's is the gradle file:
configurations.maybeCreate("default")
artifacts.add("default", file('my-aar-1.0.0.aar'))
And there's another module that implement this artifact.
When I run ./gradlew build directly from android studio works normally but in my CI script I'm facing this error:
Install Android SDK Platform-Tools (revision: 34.0.5) finished.
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':features:app:buildProdBetaPreBundle'.
> Could not resolve all task dependencies for configuration
':features:app:prodBetaRuntimeClasspath'.
> Could not resolve project :myaar.
Required by:
project :app > project :module:secondmodule
> No matching configuration of project :myaar was found. The consumer was configured to find a runtime of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'beta', attribute 'com.android.build.api.attributes.ProductFlavor:default' with value 'prod', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.4.2', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- Configuration 'ktlintRuleset':
- Other compatible attributes:
- Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '7.4.2')
- Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'beta')
- Doesn't say anything about com.android.build.api.attributes.ProductFlavor:default (required 'prod')
- Doesn't say anything about its target Java environment (preferred optimized for Android)
- Doesn't say anything about its usage (required a runtime)
- Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
Its something that I need to put in the gradle file from aar module or its is my script?
image: public.ecr.aws/openjdk:11jdk-new
variables:
ANDROID_COMPILE_SDK: "28"
ANDROID_BUILD_TOOLS: "28.0.2"
ANDROID_SDK_TOOLS: "4333796"
ENVIRONMENT: $CI_COMMIT_REF_NAME
REGION: $AWS_DEFAULT_REGION
stages:
- build
lintDebug:
image: public.ecr.aws/android:latest
stage: build
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
when: always
paths:
- ./builds/poc-pipeline-android/app/build/outputs/*
before_script:
- |
yes | sdkmanager --licenses && \
yes | sdkmanager --update --channel=0 && \
yes | sdkmanager \
"platforms;android-30" \
"platforms;android-29" \
"platforms;android-28" \
"platforms;android-27" \
"platforms;android-26" \
"platforms;android-25" \
"platforms;android-24" \
"platforms;android-23" \
"platforms;android-22" \
"build-tools;30.0.3" \
"build-tools;30.0.2" \
"build-tools;30.0.0" \
"build-tools;29.0.3" \
"build-tools;29.0.2" \
"build-tools;29.0.1" \
"build-tools;29.0.0" \
"build-tools;28.0.3" \
"build-tools;28.0.2" \
"build-tools;28.0.1" \
"build-tools;28.0.0" \
"build-tools;27.0.3" \
"build-tools;27.0.2" \
"build-tools;27.0.1" \
"build-tools;27.0.0" \
"build-tools;26.0.2" \
"build-tools;26.0.1" \
"build-tools;25.0.3" \
"build-tools;24.0.3" \
"build-tools;23.0.3" \
"build-tools;22.0.1" \
"build-tools;21.1.2" \
"build-tools;19.1.0" \
"build-tools;17.0.0" \
"system-images;android-30;google_apis;x86" \
"system-images;android-29;google_apis;x86" \
"system-images;android-28;google_apis;x86_64" \
"system-images;android-26;google_apis;x86" \
"system-images;android-25;google_apis;armeabi-v7a" \
"system-images;android-24;default;armeabi-v7a" \
"system-images;android-22;default;armeabi-v7a" \
"extras;android;m2repository" \
"extras;google;m2repository" \
"extras;google;google_play_services" \
"extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2" \
"extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1" \
"add-ons;addon-google_apis-google-23" \
"add-ons;addon-google_apis-google-22" \
"add-ons;addon-google_apis-google-21"
script:
- ./gradlew build