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 Demo Failed To Use Porcupine Method #695

Closed
erdemarpaci opened this issue Mar 29, 2022 · 14 comments
Closed

Flutter Demo Failed To Use Porcupine Method #695

erdemarpaci opened this issue Mar 29, 2022 · 14 comments
Assignees
Labels
bug Something isn't working

Comments

@erdemarpaci
Copy link

I am trying to run the Flutter demo on my device, but when I chose a keyword it returns an error: "Porcupine method 'from_builtin_keywords' is not a valid function".

I found that this line returns the error: _porcupineManager = await PorcupineManager.fromBuiltInKeywords( accessKey, [builtIn], wakeWordCallback, errorCallback: errorCallback); Moreover, I can view the mentioned function in the porcupine_manager.dart file.

I would be very grateful if you could help with this problem.

@laves
Copy link
Member

laves commented Mar 29, 2022

Thanks for the report, @erdemarpaci. Were you running the demo on an Android or iOS device?

@erdemarpaci
Copy link
Author

I am running on an Android 11.

@ksyeo1010
Copy link
Contributor

I just updated the demo with the latest packages. It includes the updated pubspec file. Can you try again and if it doesn't work, can you tell us the flutter version and dart version you are using?

@erdemarpaci
Copy link
Author

erdemarpaci commented Mar 30, 2022

First of all thanks for the help. I'm still getting the same error, the information you want is as follows:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.8.1, on Microsoft Windows [Version 10.0.19044.1586], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Android Studio (version 2020.3)
[√] IntelliJ IDEA Ultimate Edition (version 2021.2)
[√] VS Code (version 1.62.3)
[√] Connected device (3 available)

Dart SDK version: 2.15.1 (stable) (Tue Dec 14 13:32:21 2021 +0100) on "windows_x64"

Edit: It works on android emulator.

@ksyeo1010
Copy link
Contributor

I tried reproducing the issue with the same configurations but I cannot get the same error. Based on the error, I can only think of an outdated packaged causing the issue. For now I can give you some suggestions to try.

Build and run a clean install. Make sure to remove the demo app in your device and run:

  1. flutter clean
  2. flutter pub upgrade
  3. flutter run

Try running on release mode: flutter run --release .

Upgrade flutter to latest stable version: v2.10.4.

If all this fails, can you also give us your android sdk build tools version and android sdk platform tools version?

@erdemarpaci
Copy link
Author

It works with flutter version v2.10.4. Thanks a lot.

@ali-tunahan
Copy link

Same issue in flutter version 3.7.

@mdags
Copy link

mdags commented Dec 15, 2023

Same issue in flutter version 3.16.4

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.16.4, on Microsoft Windows [Version 10.0.22631.2861], locale tr-TR)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.3)
[√] Android Studio (version 2023.1)
[√] VS Code (version 1.85.1)
[√] Connected device (5 available)
[√] Network resources

and my code is: _porcupineManager = await PorcupineManager.fromBuiltInKeywords(
accessKey,
[BuiltInKeyword.JARVIS],
_wakeWordCallback,
errorCallback: _errorCallback,
);

@laves
Copy link
Member

laves commented Dec 18, 2023

Reopening as it seems to be an ongoing issue. We'll look into it.

@laves laves reopened this Dec 18, 2023
@laves
Copy link
Member

laves commented Dec 19, 2023

I cannot reproduce this issue in our demo project. @mdags or @ali-tunahan - could you let me know if you are seeing this issue in our demo or only in your own projects?

@laves
Copy link
Member

laves commented Dec 19, 2023

It could be a locale issue with a function call in our SDK - can one of you also confirm your locale (in Java -> Locale.getDefault())?

@mdags
Copy link

mdags commented Dec 19, 2023

Thank you for the locale information. Apparently the SDK only works when the device language is English or supported languages. I get this error when I change the emulator language to Turkish. After seeing your answer, I changed the emulator language to English and it worked. Could you make any improvements on this issue?

@laves
Copy link
Member

laves commented Dec 19, 2023

@mdags - we've identified the issue and are working on a fix. Thank you for the report.

@laves laves added the bug Something isn't working label Dec 19, 2023
@ksyeo1010
Copy link
Contributor

We have fixed the issue, released new version of flutter SDK and updated the demo: #1203.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants