aloisdeniel / flutter_plugin_appcenter

Flutter plugins for accessing Visual Studio App Center services.
55 stars 51 forks source link

flutter build apk fails after flutter upgrade #19

Open rtessler opened 4 years ago

rtessler commented 4 years ago

after updating flutter to 1.12.13+hotfix.5 flutter build apk fails with:

FAILURE: Build failed with an exception.

Removing appcenter from pubspec.yaml fixes the problem My android:targetSdkVersion is 28 I can't use the appcenter plugin until this is resolved

rtessler commented 4 years ago

I think this is somehow related to the targetSdkVersion. I need 28 and I think appcenter target is 27

abrass commented 4 years ago

same issue here, any ideas how to fix that? We do not need 28, but 27 do not help either.

diegolaballos commented 4 years ago

any update on that? Same problem. We had to go back to a previous Flutter version since we need the plugin. I guess something needs to be done on the plugin to make it compatible with Flutter 1.12.13 (that's the version I was using when we found the problem)

cutzmf commented 4 years ago

Same!

Waiting for fix =)

Quick fixed by bumping compileSdkVersion up to 28 in build script

find ~/.pub-cache/hosted/pub.dartlang.org/appcenter* -iname 'build.gradle' | xargs sed -i -e 's/\(compileSdkVersion \)27/\128/g'

kiwiidb commented 4 years ago

Same!

Waiting for fix =)

Quick fixed by bumping compileSdkVersion up to 28 in build script

find ~/.pub-cache/hosted/pub.dartlang.org/appcenter* -iname 'build.gradle' | xargs sed -i -e 's/\(compileSdkVersion \)27/\128/g'

I can't find this .pub-cache folder ... Also our Appcenter build have started failing because of this issue a week ago. The debug build works fine, but the release build doesn't

cutzmf commented 4 years ago

Same! Waiting for fix =) Quick fixed by bumping compileSdkVersion up to 28 in build script find ~/.pub-cache/hosted/pub.dartlang.org/appcenter* -iname 'build.gradle' | xargs sed -i -e 's/\(compileSdkVersion \)27/\128/g'

I can't find this .pub-cache folder ... Also our Appcenter build have started failing because of this issue a week ago. The debug build works fine, but the release build doesn't

I think you missed that android build start in gradle root

# fail if any command fails
set -e
# debug log
set -x

# android build start in gradle root
cd ../..

git clone -b stable https://github.com/flutter/flutter.git
export PATH=`pwd`/flutter/bin:$PATH

flutter channel stable
flutter upgrade

flutter doctor

flutter pub get

# fix appcenter plugins buildSdkVersion, flutter 1.12.13 needs version 28
# another path is to fork plugins, fix version & change dependency to forked, but... I decided to use quick dirty fix
# wait till fixed https://github.com/aloisdeniel/flutter_plugin_appcenter/issues/19
find ~/.pub-cache/hosted/pub.dartlang.org/appcenter* -iname 'build.gradle' | xargs sed -i -e 's/\(compileSdkVersion \)27/\128/g'

# run code generation for API models built_value
flutter pub run build_runner build --delete-conflicting-outputs

flutter build apk --release

# if you need build bundle (AAB) in addition to your APK, uncomment line below and last line of this script.
#flutter build appbundle

# copy the APK where AppCenter will find it
mkdir -p android/app/build/outputs/apk/; mv build/app/outputs/apk/release/app-release.apk $_
deepakasharma commented 4 years ago

This is what I get when I try to build it "the built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility".