question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[android] .focus() causes "illegal number of arguments for 'updateHotspot' command." error.

See original GitHub issue

On Android when i try to apply focus to a TouchableOpacity element i greeted with an error illegal number of arguments for 'updateHotspot' command.

export class Test extends Component {
  render() {
    return (
        <>
            <TouchableOpacity ref={(ref) => (this._ref = ref)} onFocus={() => console.log("I HAVE BEEN FOCUSSED")}>
                <Text>Should get focus</Text>
            </TouchableOpacity>


            <TouchableOpacity onPress={() => this._ref.focus()}>
                <Text>Should trigger focus</Text>
            </TouchableOpacity>
        </>
    )
  }
}

please note that in my actuall code i DO check if this._ref exists first before calling focus etc.

React Native version:

info 
 System:
    OS: macOS Mojave 10.14.5
    CPU: (8) x64 Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
    Memory: 23.23 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.10.0 - /usr/local/bin/node
    npm: 6.11.3 - /usr/local/bin/npm
  SDKs:
    iOS SDK:
      Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
    Android SDK:
      API Levels: 28, 29
      Build Tools: 28.0.3, 29.0.2
      System Images: android-25 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.5791312
    Xcode: 11.0/11A420a - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: 0.61.2 => 0.61.2 
  npmGlobalPackages:
    react-native-cli: 2.0.1

Repoduce

  1. create a ref from a TouchableOpacity on Android.
  2. try to focus to that ref.
  3. observe error.

Expected the TouchableOpacity to be focussed and onFocus to be called…

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

7reactions
ricardoMoggcommented, Feb 26, 2020

This issue is still ongoing.

1reaction
FrancisLeighcommented, Jan 14, 2020

Still relevant.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react native android causes illegal number of arguments ...
... with TouchableOpacity ref and call method .focus() , i getting error. illegal number of arguments for update hotspot command when trying ...
Read more >
Focus Input after update to 1.4.1 (28 Oct 2020) crashes app
I am starting my app using the android kitchen sink/preview app (1.9.20) - the ... illegal number of arguments for 'updateHotspot' command.
Read more >
[Solved]-React Native Android run causes "Illegal number ...
Coding example for the question React Native Android run causes "Illegal number of arguments for updateHotspot command"-React Native.
Read more >
com.amazon.avod.thirdpartyclient_v3.0.219.32341- ...
Minimum SDK: 16 (Jelly Bean); Target SDK: 25 (); Version Code: 219032341 ... Illegal number of arguments for \'updateHotspot\' command.
Read more >
Liberica JDK 16+36 Release Notes
The version number is 16. Liberica JDK 16+36. Liberica is a certified, Java SE 16-compliant distribution of OpenJDK 16 which works on server...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found