Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flutter build apk fails after flutter upgrade #19

Open
rtessler opened this issue Dec 16, 2019 · 7 comments
Open

flutter build apk fails after flutter upgrade #19

rtessler opened this issue Dec 16, 2019 · 7 comments

Comments

@rtessler
Copy link

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
Copy link
Author

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

@abrass
Copy link

abrass commented Jan 9, 2020

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

@diegolaballos
Copy link

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
Copy link

cutzmf commented Feb 5, 2020

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
Copy link

kiwiidb commented Mar 26, 2020

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
Copy link

cutzmf commented Mar 26, 2020

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants