在android中使用expo语音不会';t工作并抛出异常
我试图在我的react native应用程序中使用expo speech,但在我的Android上出现以下错误:在android中使用expo语音不会';t工作并抛出异常,android,react-native,expo,text-to-speech,Android,React Native,Expo,Text To Speech,我试图在我的react native应用程序中使用expo speech,但在我的Android上出现以下错误: [Unhandled promise rejection: Error: Encountered an exception while calling native method: Exception occurred while executing exported method speak on module ExponentSpeech: null] - node_module
[Unhandled promise rejection: Error: Encountered an exception while calling native method: Exception occurred while executing exported method speak on module ExponentSpeech: null]
- node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:155:41 in createErrorFromErrorData
- node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:104:55 in <unknown>
- ... 5 more stack frames from framework internals
反应本机:0.59.8
依赖项如下所示:
speak = async text => {
Speech.speak(convertHTMLstring(text), {
language: 'he',
pitch: '1',
rate: '0.9',
})
}
"expo": "^35.0.0",
"expo-speech": "~7.0.0",
"react": "16.8.3",
...
同样的代码在ios中工作
我试图寻找答案,但什么也找不到,根据expo docs,它应该支持Android:
请帮忙。
谢谢。听起来这是一个纯本地项目,而不是一个管理的世博会项目,对吗?如果是这样,请确保首先在您的项目中设置react native unimodules:适用于所有可能与其相关的人。。。 我发现了问题。 首先,请注意,我试图使用希伯来语的讲话。 因此:
就这样 据我所知,我使用的是一个管理的世博会项目,但我不是100%确定(对不起,react native和expo非常新)。我使用expo API,实际上文本到语音包也是从expo:import*导入的,作为来自“expo speech”的语音,那么,我如何检查我使用的是本机项目还是托管的expo项目?如果我使用管理世博会项目,你知道我为什么会出现这个错误吗?谢谢有人知道我的问题吗?