hanabi1224 / flutter_appcenter_bundle

MIT License
21 stars 48 forks source link

Issue with publishing app to GooglePlay #43

Open joao10martins opened 3 years ago

joao10martins commented 3 years ago

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?

Dooks123 commented 3 years ago

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

flutter build appbundle --flavor googlePlay
joao10martins commented 3 years ago

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.

Dooks123 commented 3 years ago

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.

markst commented 3 years ago

@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 $_
joao10martins commented 3 years ago

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

Dooks123 commented 3 years ago

@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
MoAbdulmalik16 commented 3 years ago

please assist me in integrating this package.