Closed alexda12 closed 4 years ago
Hi @alexda12
could you please run
flutter clean
flutter pub cache repair
let me know if the issue persists
thank you
possibly related to https://github.com/flutter/flutter/issues/46863
@iapicca Sorry, I didnt want to mention the obvious, but yes have :
I also ensured latest implementation dependencies were referenced as in :
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'com.google.firebase:firebase-core:17.2.1'
implementation 'com.google.firebase:firebase-firestore:21.3.1'
implementation 'com.google.firebase:firebase-auth:19.2.0'
implementation 'com.google.firebase:firebase-functions:19.0.1'
implementation 'com.google.firebase:firebase-storage:19.1.0'
}
but that didnt make any difference so went back to :
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'com.google.firebase:firebase-core:16.0.8'
}
apply plugin: 'com.google.gms.google-services'
Hello, As far as we are concerned, looks like related to keyboard_visibility package: https://github.com/adee42/flutter_keyboard_visibility/issues/42 Thanks
/cc @blasten
Could you paste the content of the file android/build.gradle
and android/app/gradle/wrapper/gradle-wrapper.properties
?
I'm able to reproduce @alexda12 issue if I bring the flutter_twitter_login
plugin. I fixed the problem if I change https://github.com/roughike/flutter_twitter_login/blob/master/android/build.gradle#L25 (compileSdkVersion: 27
-> compileSdkVersion: 28
)
There might be a difference in behavior depending on the version of the Android Gradle plugin that your app is using.
@jlhour Based on my comment above, flutter_keyboard_visibility
also has this problem: https://github.com/adee42/flutter_keyboard_visibility/blob/master/android/build.gradle#L25 compileSdkVersion: 27
.
@blasten - I'm actually using this in my pubspec which is a fork from flutter_twitter_login :
flutter_twitter_login: git: git://github.com/eudangeld/flutter_twitter_login.git
And your right, looking in pub-cache, src -> build.gradle, the minSDK is 27. Changing to 28 resolves the issue. Well spotted and thank you ! So until the plugin owner changes on their side, one has to remember if they clean the pub-cache to manually make the change to this and other plugins that are <=27.
My question is - how come this worked prior to 1.12.13 hotfix 5 - what has changed in Androids build/gradle process with respect to handling pre compileSdkVersion of 28 (i.e 27)?
@alexda12 1.12.13-hotfix.5
involved multiple changes to the Android build system. If you look at the Android documentation for fontVariationSettings
, it was added in API level 28. cc @eudangeld who authored this plugin. Would you guys be able to upgrade the plugin and publish a new version?
getting the same error while building a release APK. I tried
flutter build apk --release
and then i tried
flutter clean flutter pub cache repair
but it didn't work
[√] Flutter (Channel unknown, v1.12.13+hotfix.5, on Microsoft Windows [Version 10.0.18363.535], locale en-US) • Flutter version 1.12.13+hotfix.5 at C:\Users\sarin\Documents\flutter • Framework revision 27321ebbad (2 days ago), 2019-12-10 18:15:01 -0800 • Engine revision 2994f7e1e6 • Dart version 2.7.0
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at C:\Program Files\Android\sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.2 • ANDROID_HOME = C:\Program Files\Android\sdk\tools • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03) • All Android licenses accepted.
[√] Android Studio (version 3.5) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin version 42.0.1 • Dart plugin version 191.8593 • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] VS Code (version 1.40.2) • VS Code at C:\Users\sarin\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.7.1
[√] Connected device (1 available) • AOSP on IA Emulator • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
@blasten that fixed the issue for me. Thanks!
I would like to add that the very same problem (as reported related to flutter_twitter_login) also affects:
which are required e.g. by google_sign_in (v 4.1.0 - which is the latest at the time of writing).
The (temporary) workaround suggested by @alexda12 fixes the problem also in these cases.
@alexda12
1.12.13-hotfix.5
involved multiple changes to the Android build system. If you look at the Android documentation forfontVariationSettings
, it was added in API level 28. cc @eudangeld who authored this plugin. Would you guys be able to upgrade the plugin and publish a new version?
Updated!
/cc @amirh regarding the plugins within flutter/plugins that are affected by this.
@PiercarloSlavazza The compileSdkVersion
version was updated to 28 on January 22nd by @mklim in https://github.com/flutter/plugins/commit/59e84d85d948252cfc068917caca2c1ed5b70007. I would suggest you update to the latest version of these plugins.
@mklim do you recall the steps you followed that ended up bumping the SDK version?
@blasten
The compileSdkVersion version was updated to 28 on January 22nd by @mklim in flutter/plugins@59e84d8. I would suggest you update to the latest version of these plugins.
hm, I proceeded in the following way:
Exactly, @blasten, what do you think I should update? Imho, the broken dependencies are "buried" somewhere in google_sign_in 4.1.0. Or maybe you are suggesting that there is a more recent version of google_sign_in (and threfore its docs are outdated)?
@PiercarloSlavazza could you share the content of pubspec.yaml
?
@PiercarloSlavazza could you share the content of pubspec.yaml ?
@blasten sure. Just one more thing: I missed to poit out that I am correlating path_provider-0.4.1 and shared_preferences-0.4.3 to google_sign_in because I noticed the relationship by running gradle app:dependencies
. That said, here the pubspec.yaml:
name: magicart_fo_app
description: Magicart Flutter App
dependencies:
background_fetch: "^0.3.2"
collection: "^1.14.11"
firebase_messaging: "^6.0.9"
flutter_facebook_login: "^3.0.0"
flutter_redux: "^0.5.0"
flutter_webview_plugin: "^0.3.10"
google_sign_in: "^4.1.0"
http: '>=0.11.1 <0.12.0'
meta: "^1.1.5"
modal_progress_hud: "^0.1.0"
numberpicker: "^0.1.7"
package_info: "^0.4.0+13"
redux: "^3.0.0"
redux_persist_flutter:
git:
url: git@github.com:nullp01nt3r/redux_persist.git
path: packages/redux_persist_flutter/
ref: v0.6.0-save-sync-1
tuple: "^1.0.2"
url_launcher: "^5.4.1"
uuid: "^1.0.0"
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
cupertino_icons: ^0.1.0
dev_dependencies:
test: "^1.3.0"
flutter_test:
sdk: flutter
flutter_icons:
image_path: "images/logo-magicart-launcher.png"
android: true
flutter:
uses-material-design: true
assets:
- assets/images/ # ignore: asset_does_not_exist
- assets/licences/ # ignore: asset_does_not_exist
fonts:
- family: OpenSans
fonts:
- asset: assets/fonts/OpenSans-Regular.ttf
- family: OpenSansLight
fonts:
- asset: assets/fonts/OpenSans-Light.ttf
- family: Varela
fonts:
- asset: assets/fonts/VarelaRound-Regular.ttf
After two days of fighting this and in case this helps someone else, what finally resolved this issue for me was a change in my pubspec.yaml file.
I had the following line for the share plugin: share: git: url: https://github.com/d-silveira/flutter-share.git
Once I changed it to: share: ^0.6.3+5
All was well with the world.I was able to build successfully.
Same problem here.
$ flutter build apk --split-per-abi registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':flutter_tab_bar_no_ripple:verifyReleaseResources'.
java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed /Users/honkevin/Github/efx/build/flutter_tab_bar_no_ripple/intermediates/res/merged/release/values/values.xml:236: error: resource android:attr/fontVariationSettings not found. /Users/honkevin/Github/efx/build/flutter_tab_bar_no_ripple/intermediates/res/merged/release/values/values.xml:237: error: resource android:attr/ttcIndex not found. error: failed linking references.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 3s
same issue FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':connectivity:verifyReleaseResources'.
java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed /Users/lucky.mehndiratta/Downloads/flutter-carseer/build/connectivity/intermediates/res/merged/release/values/values.xml:236: error: resource android:attr/fontVariationSettings not found. /Users/lucky.mehndiratta/Downloads/flutter-carseer/build/connectivity/intermediates/res/merged/release/values/values.xml:237: error: resource android:attr/ttcIndex not found. error: failed linking references.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Same issue here flutter version v1.12.13+hotfix.6
Same issue here flutter version 1.13.5 dev channel .
command:
flutter build apk --release
response:
'* What went wrong:
Execution failed for task ':shared_preferences:verifyReleaseResources'.
1 exception was raised by workers: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed \build\shared_preferences\intermediates\res\merged\release\values\values.xml:236: error: resource android:attr/fontVariationSettings not found. \build\shared_preferences\intermediates\res\merged\release\values\values.xml:237: error: resource android:attr/ttcIndex not found. error: failed linking references.'
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away! Thanks for your contribution.
Re-opening since this issue still looks active.
Panic! Has anyone solved this?
error: resource android:attr/fontVariationSettings not found. error: resource android:attr/ttcIndex not found.
✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.14.6 18G103, locale en-NO) • Flutter version 1.12.13+hotfix.5 at /Users/stephan/development/flutter • Framework revision 27321ebbad (9 weeks ago), 2019-12-10 18:15:01 -0800 • Engine revision 2994f7e1e6 • Dart version 2.7.0
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3) • Android SDK at /Users/stephan/Library/Android/sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 28.0.3 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405) • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.3, Build version 11C29 • CocoaPods version 1.7.5
[✓] Android Studio (version 3.5) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 43.0.1 • Dart plugin version 191.8593 • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[!] IntelliJ IDEA Community Edition (version 2017.1.1) • IntelliJ at /Applications/IntelliJ IDEA CE.app ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. • For information about installing plugins, see https://flutter.dev/intellij-setup/#installing-the-plugins
[!] VS Code (version 1.35.1) • VS Code at /Applications/Visual Studio Code.app/Contents ✗ Flutter extension not installed; install from https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (1 available) • LYA L29 • LHS7N18A13001240 • android-arm64 • Android 10 (API 29)
Yiiihaaaa !!! devicelocale: ^0.2.0 to devicelocale: ^0.2.1 did the trick
I'm running into this problem as well. I followed all the suggestions and am still unable to generate APK files.
For those whose flutter option is greyed out in the Android Studio may try this solution out: https://github.com/flutter/flutter-intellij/issues/3873#issuecomment-498467233
Hi @alexda12 are you still experiencing the issue with the latest stable? Thank you
I'm running into this problem as well. I followed all the suggestions and am still unable to generate APK files.
FAILURE: Build failed with an exception.
java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
error: resource android:attr/fontVariationSettings not found. error: resource android:attr/ttcIndex not found. error: failed linking references.
build.gradle:-
android { compileSdkVersion 28
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
minSdkVersion 19
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Pubspec.yaml file:-
version: 9.2.5+9.2.5
environment: sdk: ">=2.2.0 <3.0.0"
dependencies: flutter: sdk: flutter
cupertino_icons: ^0.1.2 flutter_typeahead: ^1.3.0 http: ^0.12.0+1 json_annotation: ^2.0.0 image_picker: ^0.6.2+3 image_cropper: ^1.1.1 intl: ^0.15.8 device_info: ^0.4.0+1 sqflite: ^1.1.5 path_provider: ^0.5.0+1 connectivity: ^0.3.0 image: ^2.0.7 flutter_pagewise: ^1.2.3 cached_network_image: 2.0.0-rc
collection: ^1.14.11
firebase_messaging: ^6.0.9
rflutter_alert: ^1.0.2
firebase_dynamic_links: ^0.4.0+2
encrypt: ^2.0.0
flutter_circular_chart: ^0.1.0
vibration: 1.1.0
transparent_image: ^0.1.0
flutter_swiper: ^1.1.6
flutter_custom_clippers: ^1.1.0
url_launcher: ^5.4.1
fluttertoast: ^3.1.3
barcode_scan: ^1.0.0
flutter_local_notifications: ^0.9.0+1
charts_flutter: ^0.5.0
flutter_youtube: "^2.0.0"
flutter_speed_dial: ^1.2.5
flutter_automation: ^1.1.2
dev_dependencies: flutter_test: sdk: flutter
flutter:
uses-material-design: true
assets:
assets/img/
#
fonts:
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away! Thanks for your contribution.
any update on it?
Yes , this solution is working after spending few hours https://stackoverflow.com/a/58576562/9545222
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v
and a minimal reproduction of the issue.
Issue
Since upgrading to 1.12.13 - I can no longer build on Android & get a linking issue android:attr/fontVariationSettings not found. android:attr/ttcIndex not found.
History Have been working on a Flutter app for 15 months and have upgraded regularly and haven't had any major issues. For Android, I have ensured that I am using AndroidX
build.gradle
Gradle.properties
Yesterday decided to upgrade to Flutter 1.12.13 hotfix 5 on Stable. Unfortunately I have the following issues on Android
Issues on build APK
When running in Terminal Flutter build apk
I get these issues :
FAILURE: Build failed with an exception.
Even removing flutter_twitter_login from the app, we get the same error with another plugin 'Shared_preferences' etc.
Plugins
I have a bunch of plugins and have ensured that I obtain the latest versions for at least these plugins :
What I can do
iOS
Android
Flutter Doctor