Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Execution failed for task ':speech_recognition:verifyReleaseResources' #82

Open
namnh06 opened this issue Jan 5, 2020 · 16 comments
Open

Comments

@namnh06
Copy link

namnh06 commented Jan 5, 2020

Hi guys,

I tried to build an apk with flutter and speech_recognition package but met this bug:

FAILURE: Build failed with an exception. What went wrong: Execution failed for task ':speech_recognition:verifyReleaseResources'. 1 exception was raised by workers: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed /Users/namnh/Projects/revoicer/build/speech_recognition/intermediates/res/merged/release/values/values.xml:233: error: resource android:attr/fontStyle not found. /Users/namnh/Projects/revoicer/build/speech_recognition/intermediates/res/merged/release/values/values.xml:234: error: resource android:attr/font not found. /Users/namnh/Projects/revoicer/build/speech_recognition/intermediates/res/merged/release/values/values.xml:235: error: resource android:attr/fontWeight not found. /Users/namnh/Projects/revoicer/build/speech_recognition/intermediates/res/merged/release/values/values.xml:236: error: resource android:attr/fontVariationSettings not found. /Users/namnh/Projects/revoicer/build/speech_recognition/intermediates/res/merged/release/values/values.xml:237: error: resource android:attr/ttcIndex not found. error: failed linking references.

The app is working fine in debug but got this bug when trying to build the apk.

Could anyone help me out?

@RichiWIP
Copy link

RichiWIP commented Jan 9, 2020

I had the same problem and fixed it by updating the minSdkVersion and complieSdkVersion in the plugin to 28. If you want to try it out, you can use my fork as source for the plugin:

speech_recognition:
    git:
        url: https://github.com/webeverde/speech_recognition.git
        ref: master

@M0hammedHaris
Copy link

Hi.
Thanks, @RichiWIP .
I had the same issue as mentioned above, tried your answer.
Now it working fine.
can you tell what happened ?

@Jigneshiosdeveloper
Copy link

Hi @RichiWIP @M0hammedHaris

I have same problem try to build an apk with flutter and speech_recognition package.

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

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
/Users/jigneshpatel/.gradle/caches/transforms-2/files-2.1/0a271e99b6771ad4a84318244d532fb7/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/fontStyle not found.

 /Users/jigneshpatel/.gradle/caches/transforms-2/files-2.1/0a271e99b6771ad4a84318244d532fb7/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/font not found.
                                                                    
 /Users/jigneshpatel/.gradle/caches/transforms-2/files-2.1/0a271e99b6771ad4a84318244d532fb7/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/fontWeight not found.
                                                                    
 /Users/jigneshpatel/.gradle/caches/transforms-2/files-2.1/0a271e99b6771ad4a84318244d532fb7/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.
                                                                    
 /Users/jigneshpatel/.gradle/caches/transforms-2/files-2.1/0a271e99b6771ad4a84318244d532fb7/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/ttcIndex not found.

My build.gradle

android {
compileSdkVersion 28

defaultConfig {
minSdkVersion 16
targetSdkVersion 28

help me the solution 😌

@RichiWIP
Copy link

I have updated the plugin in our fork to now use android x. This makes it compatible with minSDK 16. I have also created a pull request for the changes. In the mean time, you can use my fork as explained above. Be sure to use the newest version. (Check the commit label in your pubspec.lock)

@Jigneshiosdeveloper
Copy link

@RichiWIP Thanks a lot for your response😀

@OmarYehiaDev
Copy link

   speech_recognition:
     git:
         url: https://github.com/webeverde/speech_recognition.git
         ref: master

I imported it but it shows me error in the function onRecognitionComplete
Here is my code for it :-
void onRecognitionComplete() => setState(() => _isListening = false);
@RichiWIP So how can I solve it?

@RichiWIP
Copy link

   speech_recognition:
     git:
         url: https://github.com/webeverde/speech_recognition.git
         ref: master

I imported it but it shows me error in the function onRecognitionComplete
Here is my code for it :-
void onRecognitionComplete() => setState(() => _isListening = false);
@RichiWIP So how can I solve it?

I have no errors in our applications using the plugin or in the example bundled with the plugin. Check that you are using the current version of flutter. I can't help you if you don't post the actual error.

@OmarYehiaDev
Copy link

@RichiWIP This is the error :-
The argument type 'void Function()' can't be assigned to the parameter type 'void Function(String)'.dart(argument_type_not_assignable)

@RichiWIP
Copy link

@RichiWIP This is the error :-
The argument type 'void Function()' can't be assigned to the parameter type 'void Function(String)'.dart(argument_type_not_assignable)

Your version of the plugin is out of date. Sometimes flutter has issues pulling the current version from github. Try commenting out the import, run flutter pub get and the comment it back in and get again.

@OmarYehiaDev
Copy link

It worked, thank you so much ❤️️❤️️❤️️

@DouglasNel
Copy link

DouglasNel commented May 20, 2020

Hi @RichiWIP and @Jigneshiosdeveloper I don't understand how to fix my error

When i run in debug it works fine however when i build the application I get the below output

What went wrong:

Execution failed for task ':speech_recognition:verifyReleaseResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
C:\Users\Devit-BM.gradle\caches\transforms-2\files-2.1\a528b13ac93e64cafa3d0480e2c93207\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontStyle not found.

 C:\Users\Devit-BM\.gradle\caches\transforms-2\files-2.1\a528b13ac93e64cafa3d0480e2c93207\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/font not found.

 C:\Users\Devit-BM\.gradle\caches\transforms-2\files-2.1\a528b13ac93e64cafa3d0480e2c93207\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontWeight not found.

 C:\Users\Devit-BM\.gradle\caches\transforms-2\files-2.1\a528b13ac93e64cafa3d0480e2c93207\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.

 C:\Users\Devit-BM\.gradle\caches\transforms-2\files-2.1\a528b13ac93e64cafa3d0480e2c93207\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.

Similar to @Jigneshiosdeveloper

android {
compileSdkVersion 28

defaultConfig {
minSdkVersion 16
targetSdkVersion 28

android.useAndroidX=true

Must work for android 4.1 (SKD 16) as specified in your README

I read through the comments here a few times but am unable to find a solution
Help would be much appreciated

@avani17101
Copy link

avani17101 commented Jul 28, 2020

I had the same problem and fixed it by updating the minSdkVersion and complieSdkVersion in the plugin to 28. If you want to try it out, you can use my fork as source for the plugin:

speech_recognition:
    git:
        url: https://github.com/webeverde/speech_recognition.git
        ref: master

Yes it's not working for me :(

@ayush1612
Copy link

Not working plz help!

Error :
The argument type 'void Function()' can't be assigned to the parameter type 'void Function(String)'

 _speechRecognition.setRecognitionCompleteHandler(
        () => setState(() => _isListening = false));

@lohnsonok
Copy link

I had the same problem and fixed it by updating the minSdkVersion and complieSdkVersion in the plugin to 28. If you want to try it out, you can use my fork as source for the plugin:

speech_recognition:
    git:
        url: https://github.com/webeverde/speech_recognition.git
        ref: master

it working thank a lot

@florianhenonin
Copy link

I had the same problem and fixed it by updating the minSdkVersion and complieSdkVersion in the plugin to 28. If you want to try it out, you can use my fork as source for the plugin:

speech_recognition:
    git:
        url: https://github.com/webeverde/speech_recognition.git
        ref: master

it working thank a lot

I'm able to generated an APK with this fork but I still have a bug.
When I speak, onRecognitionComplete() is called twice : first time with the sentence without the last word, and a second time with the complete sentence.
I think onRecognitionComplete should be called once.

@waleed-sofstica
Copy link

I had the same problem and fixed it by updating the minSdkVersion and complieSdkVersion in the plugin to 28. If you want to try it out, you can use my fork as source for the plugin:

speech_recognition:
    git:
        url: https://github.com/webeverde/speech_recognition.git
        ref: master

this is working 100% fine... thanks alot

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

No branches or pull requests