报错语句:
OupsCodec.class里的
this.enc = this.codec.createEncoder();
异常信息为:
java.lang.UnsatisfiedLinkError: No implementation found for long com.nlspeech.nlscodec.NlsCodec2.createEncoder() (tried Java_com_nlspeech_nlscodec_NlsCodec2_createEncoder and Java_com_nlspeech_nlscodec_NlsCodec2_createEncoder__)
at com.nlspeech.nlscodec.NlsCodec2.createEncoder(Native Method)
at com.alibaba.idst.nls.internal.codec.OupsCodec.open(OupsCodec.java:123)
at com.alibaba.idst.nls.internal.VoiceCodecs.open(VoiceCodecs.java:21)
at com.alibaba.idst.nls.internal.VoiceActDetector.open(VoiceActDetector.java:117)
at com.alibaba.idst.nls.NlsClient.<init>(NlsClient.java:153)
at com.alibaba.idst.nls.NlsClient.newInstance(NlsClient.java:135)
at com.way.test.MainActivity.new_init(MainActivity.java:94)
at com.way.test.MainActivity.onCreate(MainActivity.java:54)
at android.app.Activity.performCreate(Activity.java:6910)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2746)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2864)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1567)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6585)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
自己以解决,在build.gradle里添加如下代码就好了,之前没有调用.so文件
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
希望能将这个添加入sdk文档中,以免像我这样的新手再遇到这样的问题
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。