Flutter APK build android resource linking failed vibrate package - flutter

I'm trying to build an apk for my app but I get a resource linking fail on the vibrate package.
I can run my app in release mode and I can also build an app bundle without failure.
I already did a successful apk build two days ago, what I changed since this build:
-upgrading to Android studio 4.0
-run a pub cache repair (due to an other error resolved now)
Error I get:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':vibrate:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
C:\Users\plest\.gradle\caches\transforms-2\files-2.1\1aeb117cf01e0e03a347b2b45aacb6fb\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontStyle not found.
C:\Users\plest\.gradle\caches\transforms-2\files-2.1\1aeb117cf01e0e03a347b2b45aacb6fb\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/font not found.
C:\Users\plest\.gradle\caches\transforms-2\files-2.1\1aeb117cf01e0e03a347b2b45aacb6fb\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontWeight not found.
C:\Users\plest\.gradle\caches\transforms-2\files-2.1\1aeb117cf01e0e03a347b2b45aacb6fb\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.
C:\Users\plest\.gradle\caches\transforms-2\files-2.1\1aeb117cf01e0e03a347b2b45aacb6fb\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.
* 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 22s
Running Gradle task 'assembleRelease'... 24,3s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin cloud_firestore...
Running Gradle task 'assembleAarRelease'...
The plugin cloud_firestore could not be built due to the issue above.
Process finished with exit code 1
My flutter doctor is good and a flutter clean doesn't change anything.
I can't access the flutter panel when right click on the android panel.
EDIT:
if I run with verbose I get this in my log
[ +17 ms] > Task :vibrate:extractDebugAnnotations UP-TO-DATE
[ +1 ms] > Task :vibrate:mergeDebugGeneratedProguardFiles UP-TO-DATE
[ +1 ms] > Task :vibrate:mergeDebugConsumerProguardFiles UP-TO-DATE
[ +1 ms] > Task :vibrate:prepareLintJarForPublish UP-TO-DATE
[ +1 ms] > Task :vibrate:mergeDebugJavaResource UP-TO-DATE
[ +1 ms] > Task :vibrate:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
[ +2 ms] > Task :vibrate:transformNativeLibsWithSyncJniLibsForDebug UP-TO-DATE
[ +1 ms] > Task :vibrate:bundleDebugAar UP-TO-DATE
[ +1 ms] > Task :vibrate:compileDebugSources UP-TO-DATE
[ +1 ms] > Task :vibrate:assembleDebug UP-TO-DATE
[ +253 ms] > Task :app:mergeDebugNativeLibs
[ +1 ms] Unable to strip library
'C:\Users\plest\StudioProjects\the_spot\build\app\intermediates\merged_native_libs\debug\out\lib\x86\libflutter.so' due to
missing strip tool for ABI 'X86'. Packaging it as is.
[ +97 ms] > Task :app:stripDebugDebugSymbols
[ +1 ms] Compatible side by side NDK version was not found.
[ +1 ms] Unable to strip library
'C:\Users\plest\StudioProjects\the_spot\build\app\intermediates\merged_native_libs\debug\out\lib\x86_64\libflutter.so' due
to missing strip tool for ABI 'X86_64'. Packaging it as is.

I resolved my issue upgrading vibrate 0.0.4 to flutter_vibrate 1.0.0

Related

Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac’ flutter

Launching lib\main.dart on Android SDK built for x86 in debug mode...
FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
Could not resolve io.grpc:grpc-core:[1.21.0].
Required by:
project :app > io.grpc:grpc-okhttp:1.21.0
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
Get more help at https://help.gradle.org
BUILD FAILED in 15s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

Error in making release apk or run the app in release mode

FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':thumbnails:verifyReleaseResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
1 exception was raised by workers:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
C:\Users\asus.gradle\caches\transforms-2\files-2.1\fdd1d924d9d4aeba2785fceb0b790aec\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.
C:\Users\asus\.gradle\caches\transforms-2\files-2.1\fdd1d924d9d4aeba2785fceb0b790aec\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.
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 44s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 46.0s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is
about to try using Jetfier to solve the incompatibility.
Building plugin cloud_firestore...
The plugin cloud_firestore could not be built due to the issue above.
Running Gradle task 'assembleAarRelease'...
It is possible that the "thumbnails" package which you are using was not upgraded to AndroidX, while others are.
I recommend following this answer. This is taken from the issues page of this package.
https://github.com/asapJ/Flutter_Thumbnails/issues/8

Flutter build error - Android resource linking failed. even set compileSdkVersion 28

Please help, I'm facing problem when building realease apk file as below. I have tried searching but found only to set compileSdkVersion 28 in build.gradle file, but unlucky for my case. Any body has suggestion?
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':flutter_appavailability:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> 1 exception was raised by workers:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
/Users/adsavin/.gradle/caches/transforms-2/files-2.1/855694052351881cfd5b05bbd4ccb2f3/core-1.0.1/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.
/Users/adsavin/.gradle/caches/transforms-2/files-2.1/855694052351881cfd5b05bbd4ccb2f3/core-1.0.1/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/ttcIndex not found.
* 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 1m 58s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 122.4s (!)
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the
incompatibility.
Building plugin connectivity...
Running Gradle task 'assembleAarRelease'...
Running Gradle task 'assembleAarRelease'... Done 4.6s
✓ Built build/app/outputs/repo.
Building plugin connectivity_macos...
Running Gradle task 'assembleAarRelease'...
Running Gradle task 'assembleAarRelease'... Done 5.3s
✓ Built build/app/outputs/repo.
Building plugin firebase_auth...
Running Gradle task 'assembleAarRelease'...
Running Gradle task 'assembleAarRelease'... Done 4.8s
✓ Built build/app/outputs/repo.
Building plugin firebase_auth_web...
Running Gradle task 'assembleAarRelease'...
Running Gradle task 'assembleAarRelease'... Done 4.5s
✓ Built build/app/outputs/repo.
Building plugin firebase_core...
The plugin firebase_core could not be built due to the issue above.
Running Gradle task 'assembleAarRelease'... ```
Please migrate your app in android x and if it's already done then please
check your plugin version compatible with android x
https://flutter.dev/docs/development/androidx-migration

app failed to run after plugged in shared_preferences: ^0.5.7+3 library,and the same problem with sqflite plugin

My app failed to run after i plugged in shared_preferences: ^0.5.7+3 library,and the same problem with sqflite plugin.
Please see the error log
[+895892 ms] FAILURE: Build failed with an exception.
[ +4 ms] * What went wrong:
[ ] Execution failed for task
':shared_preferences:extractDebugAnnotations'.
[ ] > Could not resolve all files for configuration
':shared_preferences:lintClassPath'.
[ ] > Could not download intellij-core.jar
(com.android.tools.external.com-intellij:intellij-core:26.5.0)
[ ] > Could not get resource
'https://dl.google.com/dl/android/maven2/com/android/tools/external/com-
intellij/intellij-core/26.5.0/intellij-core-26.5.0.jar'.
[ ] > Tag mismatch!
[ ] > Could not download groovy-all.jar
(org.codehaus.groovy:groovy-all:2.4.15)
[ ] > Could not get resource
'https://jcenter.bintray.com/org/codehaus/groovy/groovy-
all/2.4.15/groovy-all-2.4.15.jar'.
[ +5 ms] > Read timed out
[ +1 ms] * Try:
[ +1 ms] 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
[ +3 ms] BUILD FAILED in 14m 54s
[{"event":"app.progress","params":{"appId":"f780a728-3b3b-464c-a369-
5f2bb360c086","id":"0","progressId":null,"finished":true}}]
[+2903 ms] Exception: Gradle task assembleDebug failed with exit code 1
According to this: https://github.com/flutter/flutter/issues/48264
You should try:
flutter pub cache repair
cd <YOUR APP FOLDER>
flutter clean
If this doesn't work try deleting the ~/.gradle content
Also try Invalidate Caches/Restart.... This can be found in the 'File' section on the top left of android studio.

I am trying to build apk of my Flutter project but an error occurs and it fails to build

Microsoft Windows [Version 10.0.18363.778]
(c) 2019 Microsoft Corporation. All rights reserved.
F:\flutter_projects\i_am_rich>flutter build apk
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK
size.
To generate an app bundle, run:
flutter build appbundle --target-platform android-arm,android-arm64,android-x64
Learn more on: https://developer.android.com/guide/app-bundle
To split the APKs per ABI, run:
flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
Learn more on: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Running Gradle task 'assembleRelease'...
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeReleaseResources'.
Multiple task action failures occurred:
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource compilation failed
F:\flutter_projects\i_am_rich\android\app\src\main\res\mipmap-xhdpi\ic_launcher.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
F:\flutter_projects\i_am_rich\android\app\src\main\res\mipmap-xhdpi\ic_launcher.png: AAPT: error: file failed to compile.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource compilation failed
F:\flutter_projects\i_am_rich\android\app\src\main\res\mipmap-mdpi\ic_launcher.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
F:\flutter_projects\i_am_rich\android\app\src\main\res\mipmap-mdpi\ic_launcher.png: AAPT: error: file failed to compile.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource compilation failed
F:\flutter_projects\i_am_rich\android\app\src\main\res\mipmap-xxxhdpi\ic_launcher.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
F:\flutter_projects\i_am_rich\android\app\src\main\res\mipmap-xxxhdpi\ic_launcher.png: AAPT: error: file failed to compile.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource compilation failed
F:\flutter_projects\i_am_rich\android\app\src\main\res\mipmap-xxhdpi\ic_launcher.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
F:\flutter_projects\i_am_rich\android\app\src\main\res\mipmap-xxhdpi\ic_launcher.png: AAPT: error: file failed to compile.
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 2m 29s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 152.6s (!)
Gradle task assembleRelease failed with exit code 1
F:\flutter_projects\i_am_rich>
I think you messed up with the icon files of your app. Try to replace the icon files.
If you use the https://appicon.co/ website to create the application icon, you must choose an image of png