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

0.10.4 Cannot read property 'IsAndroid' of undefined #352

Closed
zkeyword opened this issue Jan 25, 2018 · 19 comments
Closed

0.10.4 Cannot read property 'IsAndroid' of undefined #352

zkeyword opened this issue Jan 25, 2018 · 19 comments

Comments

@zkeyword
Copy link

"react": "^16.2.0",
"react-native": "^0.51.0"
it is my package version,i found Cannot read property 'IsAndroid' of undefined this error on android ,can you help me!

@radik
Copy link

radik commented Jan 25, 2018

On iOS emulator:
"react": "16.2.0",
"react-native": "^0.51.0",
"react-native-sound": "^0.10.4",

The same issue.

@msingh
Copy link

msingh commented Jan 25, 2018

The same issue appears on android with "react": "16.0.0", "react-native": "0.50.3",

@stavros-zavrakas
Copy link

I had this issue, you can try to do:

cd ios
pod install

and then try to compile and run again

@cesargdm
Copy link

cesargdm commented Jan 26, 2018

Also happened to me, deleting the app and reinstalling worked for me, may be a problem with the linking

@peakyDicers
Copy link

Having the same issue with
"react": "16.0.0-beta.5",
"react-native": "0.49.3",
"react-native-sound": "^0.10.5",

@Om3rr
Copy link

Om3rr commented Feb 8, 2018

react-native link react-native-sound fixed it..

@trepidity
Copy link
Collaborator

@zkeyword are you good to go now?

@subelsky
Copy link

I'm having the same error in iOS hardware:

    "react": "^16.3.0-alpha.1",
    "react-native": "0.54.2",
    "react-native-sound": "0.10.9"

I installed via react-native link

@Irrelon
Copy link

Irrelon commented Mar 24, 2018

I can confirm this issue as well. Neither pod install or running link solves it.

@Irrelon
Copy link

Irrelon commented Mar 24, 2018

Steps to fix:

  1. Install the module as documented in the readme of this repo
  2. If you deploy to iOS then cd to ios and run pod install
  3. Go to your test device and DELETE the app from it if you have ever deployed it there before
  4. Compile the app and run it on your device (e.g. go to xcode for ios or android studio for android) and compile and deploy to your device
  5. Once a new version of the app is on your device it will work

The reason for this is pretty simple if you think about it. Whenever you install a new module that uses native code extensions the app you have previously deployed to your device will NOT contain that code so needs to be recompiled and re-deployed to the device. Simply refreshing the existing app only refreshes the JavaScript code, not any native underlying app code on the device.

@oferRounds
Copy link

  +1
(@Irrelon tried your suggestion, but it did not work for me :/)

@astraeapark
Copy link

after install module

  1. react-native link
    and
  2. cd ios
    pod install

makes working perfect

@GodVampire
Copy link

on Android:
I have The same issue.

so : I Compile the app.
after, compile error: " can't find new RNSoundPackage(), "

I According to Manual Installation
auto link don't have this : import com.zmxv.RNSound.RNSoundPackage; // <-- New

add it to MainApplication.java
it works for me

@peterkwidjaja
Copy link

Try to check if the linking is performed correctly. I encountered the same issue on iOS and resolved it by performing the linking manually:

  1. Add RNSound.xcodeproj to Libraries
  2. Go to your app target > General > Linked Frameworks and Libraries. Add libRNSound.a there.
  3. Restart packager

@ThakurKarthik
Copy link

I have the issue on android. "Cannot read property 'IsAndroid' of undefined"

   "react": "^16.8.4",
   "react-art": "^16.8.4",
   "react-dom": "^16.8.4",
   "react-native": "0.58.6",
   "react-native-sound": "^0.10.12",

Linking is showing as linked

@ThakurKarthik
Copy link

Solved by adding permission in manifest file

@xiaobei56
Copy link

Solved by adding permission in manifest file

is the record_audio permission??

@xiaobei56
Copy link

I had resolved it by adding code in main application - like .addpackage(...sound)

@paulmelnikow
Copy link
Collaborator

Hi! If you're still having this problem, could you please post a link to a project that reproduces the problem, give information about your environment, and say what steps you have already tried?

This is the most common issue faced by react-native-sound users and it would be good to add documentation listing the possible resolutions. A pull request would be welcome; I've opened #592 to track that.

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

No branches or pull requests