flutter_plugin_appcenter icon indicating copy to clipboard operation
flutter_plugin_appcenter copied to clipboard

flutter build apk fails after flutter upgrade

Open rtessler opened this issue 5 years ago • 7 comments

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

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':appcenter:verifyReleaseResources'.

1 exception was raised by workers: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed C:\Data\Projects\Jobs\MRNSW\risk2\mobileApp\build\appcenter\intermediates\res\merged\release\values\values.xml:236: error: resource android:attr/fontVariationSettings not found. C:\Data\Projects\Jobs\MRNSW\risk2\mobileApp\build\appcenter\intermediates\res\merged\release\values\values.xml:237: error: resource android:attr/ttcIndex not found. error: failed linking references.

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 avatar Dec 16 '19 10:12 rtessler

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

rtessler avatar Dec 18 '19 09:12 rtessler

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

abrass avatar Jan 09 '20 13:01 abrass

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)

diegolaballos avatar Jan 09 '20 14:01 diegolaballos

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'

cutzmf avatar Feb 05 '20 05:02 cutzmf

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

kiwiidb avatar Mar 26 '20 11:03 kiwiidb

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

cutzmf avatar Mar 26 '20 18:03 cutzmf

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".

deepakasharma avatar Jul 13 '20 10:07 deepakasharma