Closed RailtonMatthew closed 7 years ago
@RailtonMatthew It seems error is in your MainActivity.java
could you double check ?
Hi, thanks for the reply. Yes, the errors are in MainActivity.java but why? I have copied your code as per the instructions.
@RailtonMatthew what RN version do you use? @mihirsoni I think the docs only support old RN version, because newer RN version use different code to register module
@RailtonMatthew I can build it on RN latest version (> 0.38). But of course the code is a little different with the docs. Just tell me RN version you use and I'll tell you later
@pewh Thank you for reply, would you let me know which code is diff in document, or would you mind sending PR ?
I'm at outside right now, so will reply it later. Although I can build, but it's not working when calling function. Get same issue on https://github.com/mihirsoni/react-native-android-speech/issues/3 :/
For RN >= 0.29, read the migration guide on Android http://www.reactnative.com/react-native-v0-29-rc-released/
Then, on MainApplication.java, update getPackages
to:
...
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RCTTextToSpeechModule()
);
}
...
Please note that version before 0.29, we usually register package to MainActivity.java
, but on 0.29 and later, register package to MainApplication.java
. So this repo docs is valid for RN < 0.29
@pewh Doy still get problem after changing as per RN dos ?
Closing this.
Hi, I've ran through the install instructions but get the following errors when running:
The contents of MainActivity.java is as follows: