tamlyn / react-native-elementary

Use Elementary Audio in your React Native app
MIT License
19 stars 4 forks source link

ERROR TypeError: Elementary.getSampleRate is not a function (it is undefined) #9

Closed erik-nilcoast closed 8 months ago

erik-nilcoast commented 9 months ago

I'm getting the following error on a completely new project. Is there a linking step that I'm missing?

LOG  Running "meltmobile2" with {"rootTag":11}
 ERROR  TypeError: Elementary.getSampleRate is not a function (it is undefined)

This error is located at:
    in App
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in meltmobile2(RootComponent), js engine: hermes
 ERROR  TypeError: Elementary.getSampleRate is not a function (it is undefined)

This error is located at:
    in App
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in meltmobile2(RootComponent), js engine: hermes
ebenoist commented 9 months ago

Looks like the project in NPM is missing some of the compiled java classes (they're out of date/not in sync with master)

image

txbrown commented 9 months ago

@ebenoist @ebenoist I will look into this at some point today / tomorrow. This repo is in it's early days so bear with us. If you have a solution already a PR is always appreciated.

ebenoist commented 9 months ago

You already have the solution! The code in main is correct, but the right .class files weren't uploaded to npm. I was able to republish to a fork without any changes.

I do have some plans to expand this library to cover some more of the API of elementary (specifically the ability to load samples into the engine) over the next couple weeks. I'll put up PRs with whatever I can share.

txbrown commented 9 months ago

@ebenoist I see. I guess when it comes to npm we need @tamlyn to do that.

In the meantime looking forward to your contributions. Loading samples with ease would be very cool.

tamlyn commented 9 months ago

I've published the latest main to npm. Could you please try it again and let us know if it works now?

Note to self: set up GitHub actions for publishing to npm.

ebenoist commented 9 months ago

@tamlyn looking good! Thanks.

txbrown commented 8 months ago

@tamlyn @ebenoist can we close this issue now?

ebenoist commented 8 months ago

Yes!