Open joao10martins opened 3 years ago
You need to specify what to build, apk or appbundle:
flutter build appbundle --flavor googlePlay
I am using some automated system which everytime I push something into a develop
branch, a build is created on AppCenter.
Then with those builds I just create a version for the stores with different configurations. I'm not sure how to go on about it.
I'm speaking about appcenter-post-build.sh
and appcenter-post-clone.sh
script files.
You can do multiple builds in post-clone
using flutter build ...
(each with different configurations)
With appcenter-post-build.sh
you can manually push your builds to AppCenter distribution groups:
https://docs.microsoft.com/en-us/appcenter/build/custom/scripts/
This is probably not the place to ask this question though as it can be very complicated and doesn't form part of this issue.
@joao10martins here's my appcenter-post-clone.sh
:
#!/usr/bin/env bash
#Place this script in project/android/app/
cd ..
# fail if any command fails
set -e
# debug log
set -x
cd ..
git clone -b stable https://github.com/flutter/flutter.git
export PATH=`pwd`/flutter/bin:$PATH
flutter channel stable
flutter doctor
echo "Installed flutter to `pwd`/flutter"
# build APK
flutter build apk --flavor appCenter
# if you need build bundle (AAB) in addition to your APK, uncomment line below and last line of this script.
flutter build appbundle --flavor googlePlay
# copy the APK where AppCenter will find it
mkdir -p android/app/build/outputs/apk/; mv build/app/outputs/flutter-apk/app-appcenter-release.apk $_
# copy the AAB where AppCenter will find it
mkdir -p android/app/build/outputs/bundle/; mv build/app/outputs/bundle/googleplayRelease/app-googleplay-release.aab $_
Just a quick question. Do these dependencies also need to be added? Asking because I've added the flavors and changed the build script and the app update got rejected anyway. Source: https://docs.microsoft.com/en-us/appcenter/sdk/distribute/android
@joao10martins If you look at this libraries source code, it is already included. You only need to add the flavors and build them accordingly:
flutter build apk --release --flavor googlePlay
please assist me in integrating this package.
Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'. Could not resolve project :flutter_appcenter_bundle. Required by: project :app The consumer was configured to find an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'. However we cannot choose between the following variants of project :flutter_appcenter_bundle:
- appCenterDebugApiElements
- googlePlayDebugApiElements
I know that on the description you mention this issue, however it doesn't fix the problem. In fact, you can't even run
flutter build --flavor googlePlay
as Android Studio then saysCould not find an option named "flavor".
My app was already removed once from the store, how can I solve this problem?