Android resource linking failed flutter

flutter run —release error, Android resource linking failed, resource android:attr/fontVariationSettings and android:attr/ttcIndex not found #44760

Comments

pmagnuson commented Nov 12, 2019

flutter run —debug works fine. flutter run —release fails to build.

Most of the online guidance suggests this is related to the AndoidX migration. I have performed those steps in the Android Studio. I have also performed a flutter upgrade , Android Studio upgrade , flutter pub upgrade .

also now getting the warning listed in #28155

Any pointers appreciated.

The text was updated successfully, but these errors were encountered:

pmagnuson commented Nov 13, 2019

in pursuit of fixing this, I discovered that my system was on the flutter channel master . I have changed to flutter channel stable .

At this point, flutter run -v —debug against a physical device (Pixel 3) fails. The last part of the output is

I have been through all the AndroidX migration steps multiple times. Android Studio indicates there is no dependency on AndroidX. No Usages Found in the Project.

I have tried modifying the package_info dependency to use package_info: ^0.4.0+10 , +3 and +5 without any improvement.

I was able to do the following without error,

so I assume there is something wrong with my dependencies and or gradle definitions. This all worked before my last flutter upgrade .

Читайте также:  Custom menu android studio

I was also able to add the package_info dependency to the new_project and run successfully.

I think this is something internal to my project definition. Closing this issue until I have better info.

Источник

firebase_crashlytics build failing com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed #29803

Comments

kw2019ltd commented Mar 22, 2019

Running with gitlab-runner 11.9.0-rc2 (227934c0)
on docker-auto-scale 0277ea0f
Using Docker executor with image cirrusci/flutter:latest .
Pulling docker image cirrusci/flutter:latest .
Using docker image sha256:a12fc3c81cefcf6d1e9d200f9409fe705077ff031e0bc681cb7c822ed4425595 for cirrusci/flutter:latest .
Running on runner-0277ea0f-project-10398232-concurrent-0 via runner-0277ea0f-srm-1553269686-d6cf190b.
Initialized empty Git repository in /builds/kw2019ltd/plants_price_flutter_app/.git/
Fetching changes.
Created fresh repository.
From https://gitlab.com/kw2019ltd/plants_price_flutter_app

  • [new branch] master -> origin/master
    Checking out f9c2ee1e as master.

Skipping Git submodules setup
$ flutter doctor -v
[✓] Flutter (Channel unknown, v1.2.1, on Linux, locale en_US.UTF-8)
• Flutter version 1.2.1 at /home/cirrus/sdks/flutter
• Framework revision 8661d8a (5 weeks ago), 2019-02-14 19:19:53 -0800
• Engine revision 3757390
• Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

[✓] Android toolchain — develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /opt/android-sdk-linux
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /opt/android-sdk-linux
• ANDROID_SDK_ROOT = /opt/android-sdk-linux
• Java binary at: /docker-java-home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-2

deb9u1-b13)
• All Android licenses accepted.

[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.io/setup/#android-setup for detailed instructions).

[!] Connected device
! No devices available

! Doctor found issues in 2 categories.
$ flutter channel
Flutter channels:
Hixie-patch-1
beta
dev
fix-more-tool-tests-from-terminal
gallery
master
revert-28919-composite_elevations
revert-29010-re_enable_dart2js
revert-29323-roll_branch
stable
$ flutter channel stable
Switching to flutter channel ‘stable’.
git: From https://github.com/flutter/flutter
git: 479be44..475d93a master -> origin/master
git: * [new branch] revert-29632-gallery_embedded_views -> origin/revert-29632-gallery_embedded_views
git: Switched to a new branch ‘stable’
git: Branch stable set up to track remote branch stable from origin.
$ flutter build apk
Running «flutter packages get» in plants_price_flutter_app. 10.0s
Initializing gradle. 12.0s
Resolving dependencies. 105.1s
Running Gradle task ‘assembleRelease’.
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

Note: /home/cirrus/.pub-cache/hosted/pub.dartlang.org/connectivity-0.4.2/android/src/main/java/io/flutter/plugins/connectivity/ConnectivityPlugin.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: /home/cirrus/.pub-cache/hosted/pub.dartlang.org/firebase_analytics-2.0.3/android/src/main/java/io/flutter/plugins/firebaseanalytics/FirebaseAnalyticsPlugin.java uses unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

Note: /home/cirrus/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.3.1+1/android/src/main/java/io/flutter/plugins/firebase/core/FirebaseCorePlugin.java uses unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

Note: /home/cirrus/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-4.0.0+1/android/src/main/java/io/flutter/plugins/firebasemessaging/FlutterFirebaseInstanceIDService.java uses or overrides a deprecated API.

Читайте также:  Checking if checkbox is checked android

Note: Recompile with -Xlint:deprecation for details.

Note: /home/cirrus/.pub-cache/hosted/pub.dartlang.org/fluttertoast-3.0.3/android/src/main/java/io/github/ponnamkarthik/toast/fluttertoast/FluttertoastPlugin.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: /home/cirrus/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.0+2/android/src/main/java/io/flutter/plugins/packageinfo/PackageInfoPlugin.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Calling mockable JAR artifact transform to create file: /home/cirrus/.gradle/caches/transforms-1/files-1.1/android.jar/5a8ccb9080388db5e1825d860fa87203/android.jar with input /opt/android-sdk-linux/platforms/android-28/android.jar

Calling mockable JAR artifact transform to create file: /home/cirrus/.gradle/caches/transforms-1/files-1.1/android.jar/0f6f3b7bb4abb6fed6fac20f77c93544/android.jar with input /opt/android-sdk-linux/platforms/android-27/android.jar

FAILURE: Build failed with an exception.

Execution failed for task ‘:firebase_crashlytics:verifyReleaseResources’.

java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed

/builds/kw2019ltd/plants_price_flutter_app/build/firebase_crashlytics/intermediates/res/merged/release/values/values.xml:276: error: resource android:attr/fontVariationSettings not found.

/builds/kw2019ltd/plants_price_flutter_app/build/firebase_crashlytics/intermediates/res/merged/release/values/values.xml:277: error: resource android:attr/ttcIndex not found.

error: failed linking references.

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.

BUILD FAILED in 3m 45s
Running Gradle task ‘assembleRelease’. 226.4s (!)
Gradle task assembleRelease failed with exit code 1
ERROR: Job failed: exit code 1

The text was updated successfully, but these errors were encountered:

Источник

Error: failed linking references during Android Build #81

Comments

fritz-playmaker commented Feb 18, 2019 •

🐛 Bug Report

Just added the extension permission_handler: ^2.2.0 in to pubspec.yaml and the app cannot build anymore. When i remove the extension. it runs. Error in terminal is shown below

Reproduction steps

Add extension permission_handler: ^2.2.0 in to pubspec.yaml and build apk using flutter run

Version:^2.2.0

Platform:

The text was updated successfully, but these errors were encountered:

mvanbeusekom commented Feb 19, 2019

@fritz-playmaker have you tried updating you project to fully support AndroidX (API 28)? Here are the steps necessary to accomplish this:

  1. Add the following to your «gradle.properties» file:
  1. Make sure you set the compileSdkVersion in your «android/app/build.gradle» file to 28:
  1. Make sure you replace all the android. dependencies to their AndroidX counterparts (a full list can be found here: https://developer.android.com/jetpack/androidx/migrate).

fritz-playmaker commented Feb 19, 2019

@mvanbeusekom I have implemented Steps 1 and 2. How do I go about step 3?

mvanbeusekom commented Feb 19, 2019

@fritz-playmaker if you have any of the artifacts listed in the article in your «build.gradle» file you need to replace it with the AndroidX counterpart.

For example you could have the following dependencies in your «build.gradle» file

You should replace this with:

fritz-playmaker commented Feb 19, 2019 •

i have replace all the android. dependencies to their AndroidX counterparts. but to no avail. I have inserted the error log , and my entire build.gradle file for your perusal.

Читайте также:  Htc apk для android

###After AndroidX Update

###Full build.gradle file

fritz-playmaker commented Feb 20, 2019 •

Any leaps here? Seen a new version 3.0.0 . Does it solve build issue most people seem to be reporting?

mvanbeusekom commented Feb 20, 2019

No this new version is a conversion from Swift to Objective-C and Kotlin to Java. This will greatly reduce the final app size (since Flutter and Swift don’t work well together).

What is the Kotlin version you are using? It should be at least 1.3.0.

fritz-playmaker commented Feb 20, 2019 •

My Kotlin version was 1.2.7.1 , but i just upgraded it to 1.3.0 at your word but build still fails with this message

mvanbeusekom commented Feb 20, 2019

Could you send me the contents of your gradle.properties file?

fritz-playmaker commented Feb 20, 2019 •

fritz-playmaker commented Feb 20, 2019

seems to be a multidexing issue

fritz-playmaker commented Feb 20, 2019 •

I just removed this code from my dependencies in app\build.gradle
implementation ‘com.android.support:multidex:1.0.3’

and the error is now looking like this

fritz-playmaker commented Feb 20, 2019

Applied all the advice to solve mutlidex problems from this issue flutter/flutter#21009 but to no avail

mvanbeusekom commented Feb 20, 2019

What version of the gradle build tools are you using?

This is usually listed in your /android/build.gradle file under dependencies. It should be something like this:

fritz-playmaker commented Feb 20, 2019

mvanbeusekom commented Feb 20, 2019

Upgrade that to 3.2.0 please

fritz-playmaker commented Feb 20, 2019 •

Updating to 3.2.0 affects my barcode library. https://pub.dartlang.org/packages/barcode_scan. Which seems to be having a hiccup with gradle

mvanbeusekom commented Feb 21, 2019

In that case I think you should stay on the old version of the permission handler (before the upgrade to AndroidX) until the barcode plugin is updated.

You can do this by referencing version 2.1.2 like so:

fritz-playmaker commented Feb 21, 2019

ok. But I think you should kindly add some more info in your flutter and GitHub documentation about the Gradle version, compileSDK version, and the AndroidX update, so as to help others not to go through the same problem. None the less I await the barcode library update. Hope its released very soon.

Источник

Оцените статью