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

IOS crash when Recognizer.init('xxxxxxx') #31

Open
AAAAAAFei opened this issue Jul 24, 2018 · 13 comments
Open

IOS crash when Recognizer.init('xxxxxxx') #31

AAAAAAFei opened this issue Jul 24, 2018 · 13 comments

Comments

@AAAAAAFei
Copy link

AAAAAAFei commented Jul 24, 2018

react-native: 0.55.2
react-native-speech-iflytek: 1.0.3
xcode: 9.3

xcode 报错:
Assertion failed: (severity >= 0 && severity < NUM_SEVERITIES), function SetLogDestination, file MyProject/node_modules/react-native/third-party/glog-0.3.4/src/logging.cc, line 595.

logging.cc:
`

  1. inline void LogDestination::SetLogDestination(LogSeverity severity,
  2. const char* base_filename) {
  3. assert(severity >= 0 && severity < NUM_SEVERITIES);
  4. // Prevent any subtle race conditions by wrapping a mutex lock around
  5. // all this stuff.
  6. MutexLock l(&log_mutex);
  7. log_destination(severity)->fileobject_.SetBasename(base_filename);
  8. }

`
@zphhhhh 能帮忙看一下这个问题么

@weizheng1992
Copy link

Have you solved the problem, please? I have a problem like you.

@helloshuang
Copy link

我也一样的问题,请问解决了吗?

@xll503721
Copy link

安装、链接后还须进行下面两步(以 Example 工程为例):

在 讯飞开放平台 下载组合服务 SDK (选择语音听写与在线语音合成),分别下载 Android 与 iOS 平台 SDK。

替换 SDK 文件:

使用下载 Android SDK 的 Android_voice_xxxx_xxxxxxxx/libs 文件夹替换 Example/node_modules/react-native-speech-iflytek/android/libs 文件夹;
使用下载 iOS SDK 的 iOS_voice_xxxx_xxxxxxxx/libs 文件夹替换 Example/node_modules/react-native-speech-iflytek/ios/libs 文件夹。
iOS 平台还需手动添加部分依赖库:

在 XCode 中打开 Example/ios/YourProject.xcodeproj;
将讯飞框架文件 Example/node_modules/react-native-speech-iflytek/ios/libs/iflyMSC.framework 拖入 Project navigator 的 Frameworks 下,注意选择 Copy items if needed;
添加讯飞依赖的系统库(见:科大讯飞MSC开发指南-iOS-集成流程):
CoreLocation.framework
CoreTelephony.framework
AVFoundation.framework
AddressBook.framework
Contacts.framework
AudioToolbox.framework
SystemConfiguration.framework
QuartzCore.framework
UIKit.framework
Foundation.framework
CoreGraphics.framework

这里的第二步不要做,估计是官方最新的framework有问题

@weizheng1992
Copy link

你测试 成功了? @xll503721

@helloshuang
Copy link

不替换ios SDK 运行成功后识别的时候不报错吗?登录失效?

@greedbell
Copy link

Assertion failed: (severity >= 0 && severity < NUM_SEVERITIES) 的问题有人解决吗?科大讯飞最新 SDK 在 RN 工程中还是报错。

@AAAAAAFei
Copy link
Author

我把logging.cc的这段方法给注释掉了,然后项目就可以跑了。。。

@greedbell
Copy link

greedbell commented Aug 8, 2018

@AAAAAAFei 这样不太好吧!我试下把不符合要求的都转成 0

  if (severity < 0 || severity >= NUM_SEVERITIES) {
    severity = 0;
  }

@xll503721
Copy link

@weizheng1992 我是测试过成功才这么说的

@greedbell
Copy link

greedbell commented Aug 8, 2018

那样之后会有新的错误
那样改了之后会有新的错误,
default

basename 的地址是 0x0000000000000001 ,和 base_filename_ 比较的时候报 EXC_BAD_ACCESS (code=1, address=0x0)

@helloshuang
Copy link

@xll503721 不替换framework,识别时会报登录失效,只要是新下载的sdk,就汇报那个错。assert(severity >= 0 && severity < NUM_SEVERITIES);

@xll503721
Copy link

@helloshuang 我的不会,我是有试过登录报错,但是是因为reload的问题,只要每次都程序重装就可以了,实际用户也不会reload的。

@greedbell
Copy link

向讯飞提了工单,回答如下:

你好,请问仅调试sdk中的demo在您的环境中是否也有问题,如果没问题的话,建议先按照这个步骤检查下:http://bbs.xfyun.cn/forum.php?mod=viewthread&tid=15344。http://bbs.xfyun.cn/forum.php?mod=viewthread&tid=39423

按照 http://bbs.xfyun.cn/forum.php?mod=viewthread&tid=39423 的回答,需要开启 bitcode。我的工程不能开启 bitcode,所以放弃了

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

No branches or pull requests

5 participants