我导入官方的demog工程到as 里面 然后报下面错误
ndk库已经添加到我的build.gradle
apply plugin: 'com.android.application'android {
compileSdkVersion 19
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.baidu.tts.sample"
minSdkVersion 9
targetSdkVersion 23
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
}
dependencies {
compile files('libs/com.baidu.tts_2.3.0.jar')
compile fileTree(dir: 'libs', include: '*.jar')
}
代码标红的地方 不知道是什么原因?
代码或日志截图(上传截图能帮助您更快解决问题):
05-03 23:23:52.415 7072-7072/? I/art: Not late-enabling -Xcheck:jni (already on)
05-03 23:23:52.415 7072-7072/? W/art: Unexpected CPU variant for X86 using defaults: x86
05-03 23:23:52.475 7072-7072/com.baidu.tts.sample W/System: ClassLoader referenced unknown path: /data/app/com.baidu.tts.sample-2/lib/x86
[ 05-03 23:23:52.486 1625: 1646 D/ ]
HostConnection::get() New Host Connection established 0x8cdffb40, tid 1646
05-03 23:23:52.568 7072-7072/com.baidu.tts.sample W/System.err: java.io.FileNotFoundException: /storage/emulated/0/baiduTTS/bd_etts_speech_female.dat (No such file or directory)
05-03 23:23:52.568 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.open(Native Method)
05-03 23:23:52.568 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:221)
05-03 23:23:52.568 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:108)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.copyFromAssetsToSdcard(MainActivity.java:119)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.initialEnv(MainActivity.java:85)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.onCreate(MainActivity.java:74)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Activity.performCreate(Activity.java:6679)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.-wrap12(ActivityThread.java)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Looper.loop(Looper.java:154)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6119)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at java.lang.reflect.Method.invoke(Native Method)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
05-03 23:23:52.570 7072-7072/com.baidu.tts.sample W/System.err: java.io.FileNotFoundException: /storage/emulated/0/baiduTTS/bd_etts_speech_male.dat (No such file or directory)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.open(Native Method)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:221)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:108)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.copyFromAssetsToSdcard(MainActivity.java:119)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.initialEnv(MainActivity.java:86)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.onCreate(MainActivity.java:74)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Activity.performCreate(Activity.java:6679)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.-wrap12(ActivityThread.java)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Looper.loop(Looper.java:154)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6119)
05-03 23:23:52.572 7072-7072/com.baidu.tts.sample W/System.err: at java.lang.reflect.Method.invoke(Native Method)
05-03 23:23:52.572 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
05-03 23:23:52.572 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
05-03 23:23:52.574 7072-7072/com.baidu.tts.sample W/System.err: java.io.FileNotFoundException: /storage/emulated/0/baiduTTS/bd_etts_text.dat (No such file or directory)
05-03 23:23:52.574 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.open(Native Method)
05-03 23:23:52.574 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:221)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:108)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.copyFromAssetsToSdcard(MainActivity.java:119)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.initialEnv(MainActivity.java:87)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.onCreate(MainActivity.java:74)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Activity.performCreate(Activity.java:6679)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.-wrap12(ActivityThread.java)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
05-03 23:23:52.576 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Looper.loop(Looper.java:154)
05-03 23:23:52.576 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6119)
05-03 23:23:52.576 7072-7072/com.baidu.tts.sample W/System.err: at java.lang.reflect.Method.invoke(Native Method)
05-03 23:23:52.576 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
05-03 23:23:52.576 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
05-03 23:23:52.579 7072-7072/com.baidu.tts.sample W/System.err: java.io.FileNotFoundException: /storage/emulated/0/baiduTTS/temp_license (No such file or directory)
05-03 23:23:52.580 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.open(Native Method)
05-03 23:23:52.580 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:221)
05-03 23:23:52.580 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:108)
05-03 23:23:52.580 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.copyFromAssetsToSdcard(MainActivity.java:119)
05-03 23:23:52.580 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.initialEnv(MainActivity.java:88)
05-03 23:23:52.580 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.onCreate(MainActivity.java:74)
05-03 23:23:52.580 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Activity.performCreate(Activity.java:6679)
05-03 23:23:52.580 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
05-03 23:23:52.581 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
05-03 23:23:52.581 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
05-03 23:23:52.581 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.-wrap12(ActivityThread.java)
05-03 23:23:52.581 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
05-03 23:23:52.581 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
05-03 23:23:52.581 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Looper.loop(Looper.java:154)
05-03 23:23:52.581 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6119)
05-03 23:23:52.581 7072-7072/com.baidu.tts.sample W/System.err: at java.lang.reflect.Method.invoke(Native Method)
05-03 23:23:52.581 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
05-03 23:23:52.582 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
05-03 23:23:52.583 7072-7072/com.baidu.tts.sample W/System.err: java.io.FileNotFoundException: /storage/emulated/0/baiduTTS/bd_etts_speech_female_en.dat (No such file or directory)
05-03 23:23:52.583 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.open(Native Method)
05-03 23:23:52.583 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:221)
05-03 23:23:52.583 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:108)
05-03 23:23:52.583 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.copyFromAssetsToSdcard(MainActivity.java:119)
05-03 23:23:52.583 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.initialEnv(MainActivity.java:89)
05-03 23:23:52.583 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.onCreate(MainActivity.java:74)
05-03 23:23:52.584 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Activity.performCreate(Activity.java:6679)
05-03 23:23:52.584 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
05-03 23:23:52.584 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
05-03 23:23:52.584 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
05-03 23:23:52.584 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.-wrap12(ActivityThread.java)
05-03 23:23:52.584 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
05-03 23:23:52.584 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
05-03 23:23:52.585 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Looper.loop(Looper.java:154)
05-03 23:23:52.585 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6119)
05-03 23:23:52.585 7072-7072/com.baidu.tts.sample W/System.err: at java.lang.reflect.Method.invoke(Native Method)
05-03 23:23:52.585 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
05-03 23:23:52.585 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
05-03 23:23:52.585 7072-7072/com.baidu.tts.sample W/System.err: java.io.FileNotFoundException: /storage/emulated/0/baiduTTS/bd_etts_speech_male_en.dat (No such file or directory)
05-03 23:23:52.586 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.open(Native Method)
05-03 23:23:52.586 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:221)
05-03 23:23:52.586 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:108)
05-03 23:23:52.586 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.copyFromAssetsToSdcard(MainActivity.java:119)
05-03 23:23:52.586 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.initialEnv(MainActivity.java:91)
05-03 23:23:52.586 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.onCreate(MainActivity.java:74)
05-03 23:23:52.586 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Activity.performCreate(Activity.java:6679)
05-03 23:23:52.586 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
05-03 23:23:52.586 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
05-03 23:23:52.587 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
05-03 23:23:52.587 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.-wrap12(ActivityThread.java)
05-03 23:23:52.587 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
05-03 23:23:52.587 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
05-03 23:23:52.587 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Looper.loop(Looper.java:154)
05-03 23:23:52.587 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6119)
05-03 23:23:52.587 7072-7072/com.baidu.tts.sample W/System.err: at java.lang.reflect.Method.invoke(Native Method)
05-03 23:23:52.587 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
05-03 23:23:52.587 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
05-03 23:23:52.588 7072-7072/com.baidu.tts.sample W/System.err: java.io.FileNotFoundException: /storage/emulated/0/baiduTTS/bd_etts_text_en.dat (No such file or directory)
05-03 23:23:52.588 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.open(Native Method)
05-03 23:23:52.588 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:221)
05-03 23:23:52.588 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:108)
05-03 23:23:52.588 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.copyFromAssetsToSdcard(MainActivity.java:119)
05-03 23:23:52.588 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.initialEnv(MainActivity.java:93)
05-03 23:23:52.588 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.onCreate(MainActivity.java:74)
05-03 23:23:52.588 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Activity.performCreate(Activity.java:6679)
05-03 23:23:52.588 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
05-03 23:23:52.588 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
05-03 23:23:52.589 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
05-03 23:23:52.589 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.-wrap12(ActivityThread.java)
05-03 23:23:52.589 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
05-03 23:23:52.589 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
05-03 23:23:52.589 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Looper.loop(Looper.java:154)
05-03 23:23:52.589 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6119)
05-03 23:23:52.589 7072-7072/com.baidu.tts.sample W/System.err: at java.lang.reflect.Method.invoke(Native Method)
05-03 23:23:52.589 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
05-03 23:23:52.589 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
05-03 23:23:52.661 7072-7101/com.baidu.tts.sample E/art: No implementation found for int com.baidu.tts.jni.EmbeddedSynthesizerEngine.bdTTSGetLicense(android.content.Context, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) (tried Java_com_baidu_tts_jni_EmbeddedSynthesizerEngine_bdTTSGetLicense and Java_com_baidu_tts_jni_EmbeddedSynthesizerEngine_bdTTSGetLicense__Landroid_content_Context_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2)
05-03 23:23:52.692 7072-7104/com.baidu.tts.sample W/AsyncHttpRH: Current thread has not called Looper.prepare(). Forcing synchronous mode.
05-03 23:23:52.854 7072-7104/com.baidu.tts.sample W/ResponseProcessCookies: Invalid cookie header: "Set-Cookie: BAIDUID=6F98CF9160012FDAB8B1D663FDB713AC:FG=1; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2145916555; path=/; domain=.baidu.com; version=1". Unable to parse expires attribute: Thu
05-03 23:23:52.859 7072-7104/com.baidu.tts.sample V/AsyncHttpRH: Progress 598 from 425 (141%)
05-03 23:23:52.891 7072-7109/com.baidu.tts.sample E/art: No implementation found for int com.baidu.tts.jni.EmbeddedSynthesizerEngine.bdTTSGetLicense(android.content.Context, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) (tried Java_com_baidu_tts_jni_EmbeddedSynthesizerEngine_bdTTSGetLicense and Java_com_baidu_tts_jni_EmbeddedSynthesizerEngine_bdTTSGetLicense__Landroid_content_Context_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2)
05-03 23:23:52.901 7072-7072/com.baidu.tts.sample D/AudioTrack: Client defaulted notificationFrames to 500 for frameCount 1500
05-03 23:23:52.908 7072-7072/com.baidu.tts.sample E/art: No implementation found for int com.baidu.tts.jni.EmbeddedSynthesizerEngine.loadEnglishEngine(byte[], byte[], long) (tried Java_com_baidu_tts_jni_EmbeddedSynthesizerEngine_loadEnglishEngine and Java_com_baidu_tts_jni_EmbeddedSynthesizerEngine_loadEnglishEngine___3B_3BJ)
05-03 23:23:52.910 7072-7072/com.baidu.tts.sample D/AndroidRuntime: Shutting down VM
--------- beginning of crash
05-03 23:23:52.911 7072-7072/com.baidu.tts.sample E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.baidu.tts.sample, PID: 7072
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.baidu.tts.sample/com.baidu.tts.sample.MainActivity}: java.lang.reflect.UndeclaredThrowableException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.reflect.UndeclaredThrowableException
at $Proxy0.loadEnglishModel(Unknown Source)
at com.baidu.tts.a.b.a.c(SpeechSynthesizerAdapter.java:199)
at com.baidu.tts.client.SpeechSynthesizer.loadEnglishModel(SpeechSynthesizer.java:330)
at com.baidu.tts.sample.MainActivity.initialTts(MainActivity.java:207)
at com.baidu.tts.sample.MainActivity.onCreate(MainActivity.java:76)
at android.app.Activity.performCreate(Activity.java:6679)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.baidu.tts.aop.AInterceptorHandler.invoke(AInterceptorHandler.java:75)
at java.lang.reflect.Proxy.invoke(Proxy.java:813)
at $Proxy0.loadEnglishModel(Unknown Source)
at com.baidu.tts.a.b.a.c(SpeechSynthesizerAdapter.java:199)
at com.baidu.tts.client.SpeechSynthesizer.loadEnglishModel(SpeechSynthesizer.java:330)
at com.baidu.tts.sample.MainActivity.initialTts(MainActivity.java:207)
at com.baidu.tts.sample.MainActivity.onCreate(MainActivity.java:76)
at android.app.Activity.performCreate(Activity.java:6679)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.UnsatisfiedLinkError: No implementation found for int com.baidu.tts.jni.EmbeddedSynthesizerEngine.loadEnglishEngine(byte[], byte[], long) (tried Java_com_baidu_tts_jni_EmbeddedSynthesizerEngine_loadEnglishEngine and Java_com_baidu_tts_jni_EmbeddedSynthesizerEngine_loadEnglishEngine___3B_3BJ)
at com.baidu.tts.jni.EmbeddedSynthesizerEngine.loadEnglishEngine(Native Method)
at com.baidu.tts.b.a.b.e.a(OfflineSynthesizer.java:180)
at com.baidu.tts.b.a.b.d.a(MixSynthesizer.java:268)
at com.baidu.tts.b.a.a.c.b(EngineExecutor.java:175)
at com.baidu.tts.b.a.a.b.a(AEngineState.java:167)
at com.baidu.tts.b.a.a.a.a(AEngineExecutor.java:169)
at com.baidu.tts.a.c.b.a(TtsAdapter.java:327)
at com.baidu.tts.a.c.c.a(Ttser.java:76)
at com.baidu.tts.o.a.c.a(Tts.java:320)
at com.baidu.tts.o.a.b.loadEnglishModel(InitializedState.java:123)
at com.baidu.tts.o.a.c.loadEnglishModel(Tts.java:152)
at java.lang.reflect.Method.invoke(Native Method)
at com.baidu.tts.aop.AInterceptorHandler.invoke(AInterceptorHandler.java:75)
at java.lang.reflect.Proxy.invoke(Proxy.java:813)
at $Proxy0.loadEnglishModel(Unknown Source)
at com.baidu.tts.a.b.a.c(SpeechSynthesizerAdapter.java:199)
at com.baidu.tts.client.SpeechSynthesizer.loadEnglishModel(SpeechSynthesizer.java:330)
at com.baidu.tts.sample.MainActivity.initialTts(MainActivity.java:207)
at com.baidu.tts.sample.MainActivity.onCreate(MainActivity.java:76)
at android.app.Activity.performCreate(Activity.java:6679)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
复现步骤、现象及其他描述:
萌萌的白天:
请尽快提供 我真的很需要 赶时间
回复萌萌的白天:
您好,我们官方的demo就是在android studio中使用的。请您测试下我们官方的demo,谢谢
请尽快提供 我真的很需要 赶时间
您好, 感谢您的使用, 您的建议我们已经了解到, 会考虑的, 谢谢。
你好 官方的demo 没有问题 可否 尽快的提供一个Android studio 版本的 demo 工程
萌萌的白天:
我导入官方的demog工程到as 里面 然后报下面错误
ndk库已经添加到我的build.gradle
apply plugin: 'com.android.application'android {
compileSdkVersion 19
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.baidu.tts.sample"
minSdkVersion 9
targetSdkVersion 23
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
}
dependencies {
compile files('libs/com.baidu.tts_2.3.0.jar')
compile fileTree(dir: 'libs', include: '*.jar')
}
代码标红的地方 不知道是什么原因?
代码或日志截图(上传截图能帮助您更快解决问题):
05-03 23:23:52.415 7072-7072/? I/art: Not late-enabling -Xcheck:jni (already on)
05-03 23:23:52.415 7072-7072/? W/art: Unexpected CPU variant for X86 using defaults: x86
05-03 23:23:52.475 7072-7072/com.baidu.tts.sample W/System: ClassLoader referenced unknown path: /data/app/com.baidu.tts.sample-2/lib/x86
[ 05-03 23:23:52.486 1625: 1646 D/ ]
HostConnection::get() New Host Connection established 0x8cdffb40, tid 1646
05-03 23:23:52.568 7072-7072/com.baidu.tts.sample W/System.err: java.io.FileNotFoundException: /storage/emulated/0/baiduTTS/bd_etts_speech_female.dat (No such file or directory)
05-03 23:23:52.568 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.open(Native Method)
05-03 23:23:52.568 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:221)
05-03 23:23:52.568 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:108)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.copyFromAssetsToSdcard(MainActivity.java:119)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.initialEnv(MainActivity.java:85)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.onCreate(MainActivity.java:74)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Activity.performCreate(Activity.java:6679)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.-wrap12(ActivityThread.java)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Looper.loop(Looper.java:154)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6119)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at java.lang.reflect.Method.invoke(Native Method)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
05-03 23:23:52.569 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
05-03 23:23:52.570 7072-7072/com.baidu.tts.sample W/System.err: java.io.FileNotFoundException: /storage/emulated/0/baiduTTS/bd_etts_speech_male.dat (No such file or directory)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.open(Native Method)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:221)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:108)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.copyFromAssetsToSdcard(MainActivity.java:119)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.initialEnv(MainActivity.java:86)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.onCreate(MainActivity.java:74)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Activity.performCreate(Activity.java:6679)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.-wrap12(ActivityThread.java)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Looper.loop(Looper.java:154)
05-03 23:23:52.571 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6119)
05-03 23:23:52.572 7072-7072/com.baidu.tts.sample W/System.err: at java.lang.reflect.Method.invoke(Native Method)
05-03 23:23:52.572 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
05-03 23:23:52.572 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
05-03 23:23:52.574 7072-7072/com.baidu.tts.sample W/System.err: java.io.FileNotFoundException: /storage/emulated/0/baiduTTS/bd_etts_text.dat (No such file or directory)
05-03 23:23:52.574 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.open(Native Method)
05-03 23:23:52.574 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:221)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:108)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.copyFromAssetsToSdcard(MainActivity.java:119)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.initialEnv(MainActivity.java:87)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.onCreate(MainActivity.java:74)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Activity.performCreate(Activity.java:6679)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.-wrap12(ActivityThread.java)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
05-03 23:23:52.575 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
05-03 23:23:52.576 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Looper.loop(Looper.java:154)
05-03 23:23:52.576 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6119)
05-03 23:23:52.576 7072-7072/com.baidu.tts.sample W/System.err: at java.lang.reflect.Method.invoke(Native Method)
05-03 23:23:52.576 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
05-03 23:23:52.576 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
05-03 23:23:52.579 7072-7072/com.baidu.tts.sample W/System.err: java.io.FileNotFoundException: /storage/emulated/0/baiduTTS/temp_license (No such file or directory)
05-03 23:23:52.580 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.open(Native Method)
05-03 23:23:52.580 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:221)
05-03 23:23:52.580 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:108)
05-03 23:23:52.580 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.copyFromAssetsToSdcard(MainActivity.java:119)
05-03 23:23:52.580 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.initialEnv(MainActivity.java:88)
05-03 23:23:52.580 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.onCreate(MainActivity.java:74)
05-03 23:23:52.580 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Activity.performCreate(Activity.java:6679)
05-03 23:23:52.580 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
05-03 23:23:52.581 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
05-03 23:23:52.581 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
05-03 23:23:52.581 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.-wrap12(ActivityThread.java)
05-03 23:23:52.581 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
05-03 23:23:52.581 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
05-03 23:23:52.581 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Looper.loop(Looper.java:154)
05-03 23:23:52.581 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6119)
05-03 23:23:52.581 7072-7072/com.baidu.tts.sample W/System.err: at java.lang.reflect.Method.invoke(Native Method)
05-03 23:23:52.581 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
05-03 23:23:52.582 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
05-03 23:23:52.583 7072-7072/com.baidu.tts.sample W/System.err: java.io.FileNotFoundException: /storage/emulated/0/baiduTTS/bd_etts_speech_female_en.dat (No such file or directory)
05-03 23:23:52.583 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.open(Native Method)
05-03 23:23:52.583 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:221)
05-03 23:23:52.583 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:108)
05-03 23:23:52.583 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.copyFromAssetsToSdcard(MainActivity.java:119)
05-03 23:23:52.583 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.initialEnv(MainActivity.java:89)
05-03 23:23:52.583 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.onCreate(MainActivity.java:74)
05-03 23:23:52.584 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Activity.performCreate(Activity.java:6679)
05-03 23:23:52.584 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
05-03 23:23:52.584 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
05-03 23:23:52.584 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
05-03 23:23:52.584 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.-wrap12(ActivityThread.java)
05-03 23:23:52.584 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
05-03 23:23:52.584 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
05-03 23:23:52.585 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Looper.loop(Looper.java:154)
05-03 23:23:52.585 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6119)
05-03 23:23:52.585 7072-7072/com.baidu.tts.sample W/System.err: at java.lang.reflect.Method.invoke(Native Method)
05-03 23:23:52.585 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
05-03 23:23:52.585 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
05-03 23:23:52.585 7072-7072/com.baidu.tts.sample W/System.err: java.io.FileNotFoundException: /storage/emulated/0/baiduTTS/bd_etts_speech_male_en.dat (No such file or directory)
05-03 23:23:52.586 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.open(Native Method)
05-03 23:23:52.586 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:221)
05-03 23:23:52.586 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:108)
05-03 23:23:52.586 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.copyFromAssetsToSdcard(MainActivity.java:119)
05-03 23:23:52.586 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.initialEnv(MainActivity.java:91)
05-03 23:23:52.586 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.onCreate(MainActivity.java:74)
05-03 23:23:52.586 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Activity.performCreate(Activity.java:6679)
05-03 23:23:52.586 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
05-03 23:23:52.586 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
05-03 23:23:52.587 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
05-03 23:23:52.587 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.-wrap12(ActivityThread.java)
05-03 23:23:52.587 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
05-03 23:23:52.587 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
05-03 23:23:52.587 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Looper.loop(Looper.java:154)
05-03 23:23:52.587 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6119)
05-03 23:23:52.587 7072-7072/com.baidu.tts.sample W/System.err: at java.lang.reflect.Method.invoke(Native Method)
05-03 23:23:52.587 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
05-03 23:23:52.587 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
05-03 23:23:52.588 7072-7072/com.baidu.tts.sample W/System.err: java.io.FileNotFoundException: /storage/emulated/0/baiduTTS/bd_etts_text_en.dat (No such file or directory)
05-03 23:23:52.588 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.open(Native Method)
05-03 23:23:52.588 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:221)
05-03 23:23:52.588 7072-7072/com.baidu.tts.sample W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:108)
05-03 23:23:52.588 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.copyFromAssetsToSdcard(MainActivity.java:119)
05-03 23:23:52.588 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.initialEnv(MainActivity.java:93)
05-03 23:23:52.588 7072-7072/com.baidu.tts.sample W/System.err: at com.baidu.tts.sample.MainActivity.onCreate(MainActivity.java:74)
05-03 23:23:52.588 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Activity.performCreate(Activity.java:6679)
05-03 23:23:52.588 7072-7072/com.baidu.tts.sample W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
05-03 23:23:52.588 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
05-03 23:23:52.589 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
05-03 23:23:52.589 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.-wrap12(ActivityThread.java)
05-03 23:23:52.589 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
05-03 23:23:52.589 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
05-03 23:23:52.589 7072-7072/com.baidu.tts.sample W/System.err: at android.os.Looper.loop(Looper.java:154)
05-03 23:23:52.589 7072-7072/com.baidu.tts.sample W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6119)
05-03 23:23:52.589 7072-7072/com.baidu.tts.sample W/System.err: at java.lang.reflect.Method.invoke(Native Method)
05-03 23:23:52.589 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
05-03 23:23:52.589 7072-7072/com.baidu.tts.sample W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
05-03 23:23:52.661 7072-7101/com.baidu.tts.sample E/art: No implementation found for int com.baidu.tts.jni.EmbeddedSynthesizerEngine.bdTTSGetLicense(android.content.Context, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) (tried Java_com_baidu_tts_jni_EmbeddedSynthesizerEngine_bdTTSGetLicense and Java_com_baidu_tts_jni_EmbeddedSynthesizerEngine_bdTTSGetLicense__Landroid_content_Context_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2)
05-03 23:23:52.692 7072-7104/com.baidu.tts.sample W/AsyncHttpRH: Current thread has not called Looper.prepare(). Forcing synchronous mode.
05-03 23:23:52.854 7072-7104/com.baidu.tts.sample W/ResponseProcessCookies: Invalid cookie header: "Set-Cookie: BAIDUID=6F98CF9160012FDAB8B1D663FDB713AC:FG=1; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2145916555; path=/; domain=.baidu.com; version=1". Unable to parse expires attribute: Thu
05-03 23:23:52.859 7072-7104/com.baidu.tts.sample V/AsyncHttpRH: Progress 598 from 425 (141%)
05-03 23:23:52.891 7072-7109/com.baidu.tts.sample E/art: No implementation found for int com.baidu.tts.jni.EmbeddedSynthesizerEngine.bdTTSGetLicense(android.content.Context, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) (tried Java_com_baidu_tts_jni_EmbeddedSynthesizerEngine_bdTTSGetLicense and Java_com_baidu_tts_jni_EmbeddedSynthesizerEngine_bdTTSGetLicense__Landroid_content_Context_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2)
05-03 23:23:52.901 7072-7072/com.baidu.tts.sample D/AudioTrack: Client defaulted notificationFrames to 500 for frameCount 1500
05-03 23:23:52.908 7072-7072/com.baidu.tts.sample E/art: No implementation found for int com.baidu.tts.jni.EmbeddedSynthesizerEngine.loadEnglishEngine(byte[], byte[], long) (tried Java_com_baidu_tts_jni_EmbeddedSynthesizerEngine_loadEnglishEngine and Java_com_baidu_tts_jni_EmbeddedSynthesizerEngine_loadEnglishEngine___3B_3BJ)
05-03 23:23:52.910 7072-7072/com.baidu.tts.sample D/AndroidRuntime: Shutting down VM
--------- beginning of crash
05-03 23:23:52.911 7072-7072/com.baidu.tts.sample E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.baidu.tts.sample, PID: 7072
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.baidu.tts.sample/com.baidu.tts.sample.MainActivity}: java.lang.reflect.UndeclaredThrowableException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.reflect.UndeclaredThrowableException
at $Proxy0.loadEnglishModel(Unknown Source)
at com.baidu.tts.a.b.a.c(SpeechSynthesizerAdapter.java:199)
at com.baidu.tts.client.SpeechSynthesizer.loadEnglishModel(SpeechSynthesizer.java:330)
at com.baidu.tts.sample.MainActivity.initialTts(MainActivity.java:207)
at com.baidu.tts.sample.MainActivity.onCreate(MainActivity.java:76)
at android.app.Activity.performCreate(Activity.java:6679)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.baidu.tts.aop.AInterceptorHandler.invoke(AInterceptorHandler.java:75)
at java.lang.reflect.Proxy.invoke(Proxy.java:813)
at $Proxy0.loadEnglishModel(Unknown Source)
at com.baidu.tts.a.b.a.c(SpeechSynthesizerAdapter.java:199)
at com.baidu.tts.client.SpeechSynthesizer.loadEnglishModel(SpeechSynthesizer.java:330)
at com.baidu.tts.sample.MainActivity.initialTts(MainActivity.java:207)
at com.baidu.tts.sample.MainActivity.onCreate(MainActivity.java:76)
at android.app.Activity.performCreate(Activity.java:6679)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.UnsatisfiedLinkError: No implementation found for int com.baidu.tts.jni.EmbeddedSynthesizerEngine.loadEnglishEngine(byte[], byte[], long) (tried Java_com_baidu_tts_jni_EmbeddedSynthesizerEngine_loadEnglishEngine and Java_com_baidu_tts_jni_EmbeddedSynthesizerEngine_loadEnglishEngine___3B_3BJ)
at com.baidu.tts.jni.EmbeddedSynthesizerEngine.loadEnglishEngine(Native Method)
at com.baidu.tts.b.a.b.e.a(OfflineSynthesizer.java:180)
at com.baidu.tts.b.a.b.d.a(MixSynthesizer.java:268)
at com.baidu.tts.b.a.a.c.b(EngineExecutor.java:175)
at com.baidu.tts.b.a.a.b.a(AEngineState.java:167)
at com.baidu.tts.b.a.a.a.a(AEngineExecutor.java:169)
at com.baidu.tts.a.c.b.a(TtsAdapter.java:327)
at com.baidu.tts.a.c.c.a(Ttser.java:76)
at com.baidu.tts.o.a.c.a(Tts.java:320)
at com.baidu.tts.o.a.b.loadEnglishModel(InitializedState.java:123)
at com.baidu.tts.o.a.c.loadEnglishModel(Tts.java:152)
at java.lang.reflect.Method.invoke(Native Method)
at com.baidu.tts.aop.AInterceptorHandler.invoke(AInterceptorHandler.java:75)
at java.lang.reflect.Proxy.invoke(Proxy.java:813)
at $Proxy0.loadEnglishModel(Unknown Source)
at com.baidu.tts.a.b.a.c(SpeechSynthesizerAdapter.java:199)
at com.baidu.tts.client.SpeechSynthesizer.loadEnglishModel(SpeechSynthesizer.java:330)
at com.baidu.tts.sample.MainActivity.initialTts(MainActivity.java:207)
at com.baidu.tts.sample.MainActivity.onCreate(MainActivity.java:76)
at android.app.Activity.performCreate(Activity.java:6679)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
复现步骤、现象及其他描述:
回复萌萌的白天:
请您先测试下我们官方的demo有无问题,如果没问题,请对比下您的配置和官方的配置