Skip to content

bug: Ionic call Keyboard.getResizeMode() on Android throws uncaught error #27503

Closed

Description

@farshidpg

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

when app start in android the Keyboard.getResizeMode() call from one of the ionic global component that it catched and show runtime error . I read docs of capacitor keyboard and we know that getResizeMode() method is for iOS only . why in android called on app init automatically ?

This is my console error :

result Keyboard.getResizeMode (#71292250)

{
    "message": "not implemented",
    "code": "UNIMPLEMENTED"
}

Also this is screen shots of android version

it’s make my app unuseable with vue-cli in vite version the runtime error not show but console throw excetiopn still fire

Screenshot 2023-05-18 at 4 16 12 PM

And my android Emulator

Screenshot 2023-05-18 at 4 16 40 PM

Expected Behavior

I think if ionic use the Keyboard.getResizeMode() in any components it should check platform first for ignore calling on android and call in iOS only

Steps to Reproduce

  1. Check the global ionic components that using Keyboard.getResizeMode()
  2. make sure the platform checked first and call Keyboard.getResizeMode() only in iOS
  3. Maybe Catche exception in capacitor/keyboard plugin for ignore runtime error even Keyboard.getResizeMode() called in any platform by 3rd Party plugins or components thats not official .

Code Reproduction URL

GitHub starter tab app created with latest ionic cli and ionic vue and capacitor 5 ( But the bug is still with cap 4 too and I think its fire from ionic )

https://github.com/farshidpg/ionic-starter/tree/main

Starter app ionic info

Ionic:

   Ionic CLI       : 7.1.1
   Ionic Framework : @ionic/vue 7.0.7

Capacitor:

   Capacitor CLI      : 5.0.3
   @capacitor/android : 5.0.3
   @capacitor/core    : 5.0.3
   @capacitor/ios     : not installed

Utility:

   cordova-res : 0.15.4
   native-run  : 1.7.2

System:

   NodeJS : v19.6.1
   npm    : 9.5.0
   OS     : macOS Unknown

the problem still get error on app init

Ionic Info


   Ionic CLI       : 7.1.1
   Ionic Framework : @ionic/vue 7.0.7

Capacitor:

   Capacitor CLI      : 4.8.0
   @capacitor/android : 4.8.0
   @capacitor/core    : 4.8.0
   @capacitor/ios     : 4.8.0

Utility:

   cordova-res : 0.15.4
   native-run  : 1.7.2

System:

   NodeJS : v19.6.1
   npm    : 9.5.0
   OS     : macOS



Android SDK : 33

Additional Information

Capacitor keyboard plugin information getresizemode method

https://capacitorjs.com/docs/v4/apis/keyboard#getresizemode

I check my project and I know I don't use Keyboard.getResizeMode() method manually , I'm sure it's called globally

Activity

  1. self-assigned this
    on May 18, 2023
  2. added
    ionitron: needs reproduction
    on May 18, 2023
  3. ionitron-bot commented on May 18, 2023

    @ionitron-bot

    Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.

    Please reproduce this issue in an Ionic starter application and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.

    If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.

    For a guide on how to create a good reproduction, see our Contributing Guide.

  4. removed their assignment
    on May 18, 2023
  5. farshidpg commented on May 18, 2023

    @farshidpg
    Author

    Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.

    Please reproduce this issue in an Ionic starter application and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.

    If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.

    For a guide on how to create a good reproduction, see our Contributing Guide.

    The Code Reproduction URL added to issue ( edited )

  6. added and removed
    ionitron: needs reproduction
    on May 18, 2023
  7. sovaltd commented on May 18, 2023

    @sovaltd

    any body can help with this i have same issue

  8. self-assigned this
    on May 18, 2023
  9. sean-perkins commented on May 18, 2023

    @sean-perkins
    Contributor

    Hello everyone 👋

    Could someone test with this dev-build and let me know if they run into any issues?

    7.0.8-dev.11684441614.1e9b8b2d
    
  10. added
    needs: reply
    on May 18, 2023
  11. removed their assignment
    on May 18, 2023
  12. 10 remaining items

  13. farshidpg commented on May 19, 2023

    @farshidpg
    Author

    NPM package resolution can be difficult. The nightly- build is a different output than the provided dev build.

    You can try removing the leading ^ in your package.json:

    Yes, its work I remove the ^ and now my project using the 7.0.8-dev.11684444351.1b1ab142 I checked it .

    Also the error solved 👍 the Keyboard.getResizeMode() don't call anymore in android and no console error , no runtime error ( I was getting an runtime error with vue-cli , I only had a console error and throw/stop functionality with Vite )

    Thank you bro, you saved me 🥇

    Will this bug fix ( version ) be merged with the next update in 7.0.8 ?

  14. changed the title [-]bug: ionic call Keyboard.getResizeMode() on android[/-] [+]bug: Ionic call Keyboard.getResizeMode() on Android throws uncaught error[/+] on May 19, 2023
  15. added
    package: core
    type: bug
    on May 19, 2023
  16. sean-perkins commented on May 19, 2023

    @sean-perkins
    Contributor

    It is still subject to the team's review, you can track the pull request here: #27514

    Once merged, it will be available on the next week's patch release (we try to release weekly).

    Happy to help & thanks for the quick testing and verification 🎉

  17. farshidpg commented on May 24, 2023

    @farshidpg
    Author

    It is still subject to the team's review, you can track the pull request here: #27514

    Once merged, it will be available on the next week's patch release (we try to release weekly).

    Happy to help & thanks for the quick testing and verification 🎉

    Hello , the 7.0.8 version released , is there this bug fix in 7.0.8 ? ( is it merged )

    Thank you

  18. chriswep commented on May 24, 2023

    @chriswep

    i tried 7.0.8 and the error is still there.

    any reason why this wasn't included in the patch release? from what i see this throws an error on every android device.

  19. sean-perkins commented on May 24, 2023

    @sean-perkins
    Contributor

    Once merged, it will be available on the next week's patch release (we try to release weekly).

    The PR was not merged, so it was not included in this week's patch release. The PR was still receiving feedback and was not ready for today's release.

    It has since been tested and approved with an alternative approach that isn't coupled to platform checks.

    It will be moved into a merge queue shortly and will be ready for the next week's release.

    Edit:

    Spoke with the team, we will plan to release the patch with that fix tomorrow as well to help everyone out here!

  20. added a commit that references this issue on May 24, 2023
    0e7359c
  21. liamdebeasi commented on May 25, 2023

    @liamdebeasi
    Contributor

    Hi everyone,

    We released a fix for this as part of the v7.0.9 release today. Thanks to everyone who helped test the fix!

    v7.0.9 changelog: https://github.com/ionic-team/ionic-framework/releases/tag/v7.0.9

  22. chriswep commented on May 25, 2023

    @chriswep

    thank you, there is no uncaught error anymore.

    in dev mode i can still see the native call to the method failing in chrome devtools. it feels "unusual" to have an error-returning method call on the default startup path of half the install base. but i'm probably nit-picking here and you have good reasons for it.

  23. ionitron-bot commented on Jun 24, 2023

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  24. locked and limited conversation to collaborators on Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: coretype: bug

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions