diff --git a/sample-build-scripts/flutter/android-build/appcenter-post-clone.sh b/sample-build-scripts/flutter/android-build/appcenter-post-clone.sh index 2386f63e..d6be7fe5 100755 --- a/sample-build-scripts/flutter/android-build/appcenter-post-clone.sh +++ b/sample-build-scripts/flutter/android-build/appcenter-post-clone.sh @@ -1,22 +1,24 @@ #!/usr/bin/env bash #Place this script in project/android/app/ -cd .. +#!/usr/bin/env bash +set -ex + +PROJECT_DIR=$(dirname $(dirname $(pwd))) -# fail if any command fails -set -e -# debug log -set -x +mkdir ~/dev && cd $_ -cd .. -git clone -b beta https://github.com/flutter/flutter.git +git clone -b stable https://github.com/flutter/flutter.git export PATH=`pwd`/flutter/bin:$PATH -flutter channel stable +flutter channel stable && flutter upgrade flutter doctor echo "Installed flutter to `pwd`/flutter" +# Go to project directory +cd $PROJECT_DIR + # build APK # if you get "Execution failed for task ':app:lintVitalRelease'." error, uncomment next two lines # flutter build apk --debug @@ -30,4 +32,4 @@ flutter build apk --release mkdir -p android/app/build/outputs/apk/; mv build/app/outputs/apk/release/app-release.apk $_ # copy the AAB where AppCenter will find it -#mkdir -p android/app/build/outputs/bundle/; mv build/app/outputs/bundle/release/app-release.aab $_ \ No newline at end of file +#mkdir -p android/app/build/outputs/bundle/; mv build/app/outputs/bundle/release/app-release.aab $_