flutter_appcenter_bundle icon indicating copy to clipboard operation
flutter_appcenter_bundle copied to clipboard

Issue with publishing app to GooglePlay

Open joao10martins opened this issue 4 years ago • 7 comments

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 says Could not find an option named "flavor".

My app was already removed once from the store, how can I solve this problem?

joao10martins avatar Jun 30 '21 07:06 joao10martins

You need to specify what to build, apk or appbundle:

flutter build appbundle --flavor googlePlay

Dooks123 avatar Jul 22 '21 10:07 Dooks123

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.

joao10martins avatar Sep 01 '21 09:09 joao10martins

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.

Dooks123 avatar Sep 01 '21 14:09 Dooks123

@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 $_

markst avatar Sep 08 '21 06:09 markst

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 image

joao10martins avatar Sep 10 '21 06:09 joao10martins

@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

Dooks123 avatar Sep 10 '21 13:09 Dooks123

please assist me in integrating this package.

  • What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

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

MoAbdulmalik16 avatar Oct 24 '21 19:10 MoAbdulmalik16