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

Cannot read property switchAudioOutput of undefined #11

Open
SuhailBt opened this issue Mar 11, 2021 · 4 comments
Open

Cannot read property switchAudioOutput of undefined #11

SuhailBt opened this issue Mar 11, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@SuhailBt
Copy link

Followed the steps as provided(Android). Did not do this step as I am using android only
cd ios && pod install && cd ..

Getting the above mentioned error. Is there anything that I am missing?

@SuhailBt
Copy link
Author

Adding debugging screenshot for your reference
Screenshot from 2021-03-11 11-59-45

@Kusumoto
Copy link
Collaborator

Kusumoto commented Mar 11, 2021

Hi,

Can you tell me about your configuration follow?

  • package.json file
  • your code snippet for use this
  • stack trace and error message

I seen your debug screen, The object has been initialized. I need to see your error message output.

@IronTony
Copy link

IronTony commented Apr 12, 2021

Just add this to settings.gradle for ALL RN versions:

include ':react-native-switch-audio-output'
project(':react-native-switch-audio-output').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-switch-audio-output/android')

But after this, if I use this code:
RNSwitchAudioOutput.selectAudioOutput(RNSwitchAudioOutput.AUDIO_SPEAKER);
on Android I receive this error:

Screenshot_20210412_203558_com nhc haya

@IronTony
Copy link

To fix the above error, just use always: selectAudioOutput and not the other on Android

@Kusumoto Kusumoto self-assigned this Apr 13, 2021
@Kusumoto Kusumoto added bug Something isn't working documentation Improvements or additions to documentation and removed documentation Improvements or additions to documentation labels Apr 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants