tamlyn / react-native-elementary

Use Elementary Audio in your React Native app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

erik-nilcoast opened this issue · comments

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

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

@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.

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.

@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.

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.

@tamlyn looking good! Thanks.

@tamlyn @ebenoist can we close this issue now?