我一直在使用 CMU Shpinx 开发应用程序。我以前没有问题,但突然之间,我无法将资产与我的外部目录同步。问题就出自这句话。
root = syncAssets(getApplicationContext(), "models");
堆栈跟踪在这里。
11-12 19:55:53.440: W/System.err(30395): java.io.FileNotFoundException: /models/dictation/6111.dic: open failed: ENOENT (No such file or directory)
11-12 19:55:53.440: W/System.err(30395): at libcore.io.IoBridge.open(IoBridge.java:416)
11-12 19:55:53.440: W/System.err(30395): at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
11-12 19:55:53.440: W/System.err(30395): at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
11-12 19:55:53.440: W/System.err(30395): at edu.cmu.pocketsphinx.SphinxUtil.copyAsset(Unknown Source)
11-12 19:55:53.440: W/System.err(30395): at edu.cmu.pocketsphinx.SphinxUtil.copyAsset(Unknown Source)
11-12 19:55:53.440: W/System.err(30395): at edu.cmu.pocketsphinx.SphinxUtil.copyAsset(Unknown Source)
11-12 19:55:53.440: W/System.err(30395): at edu.cmu.pocketsphinx.SphinxUtil.syncAssets(Unknown Source)
11-12 19:55:53.440: W/System.err(30395): at edu.cmu.pocketsphinx.demo.Recognizer.onCreate(Recognizer.java:175)
11-12 19:55:53.440: W/System.err(30395): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2382)
11-12 19:55:53.440: W/System.err(30395): at android.app.ActivityThread.access$1600(ActivityThread.java:137)
11-12 19:55:53.440: W/System.err(30395): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1293)
11-12 19:55:53.440: W/System.err(30395): at android.os.Handler.dispatchMessage(Handler.java:99)
11-12 19:55:53.440: W/System.err(30395): at android.os.Looper.loop(Looper.java:137)
11-12 19:55:53.440: W/System.err(30395): at android.app.ActivityThread.main(ActivityThread.java:4827)
11-12 19:55:53.440: W/System.err(30395): at java.lang.reflect.Method.invokeNative(Native Method)
11-12 19:55:53.440: W/System.err(30395): at java.lang.reflect.Method.invoke(Method.java:511)
11-12 19:55:53.440: W/System.err(30395): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
11-12 19:55:53.440: W/System.err(30395): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
11-12 19:55:53.440: W/System.err(30395): at dalvik.system.NativeStart.main(Native Method)
11-12 19:55:53.440: W/System.err(30395): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
11-12 19:55:53.440: W/System.err(30395): at libcore.io.Posix.open(Native Method)
11-12 19:55:53.440: W/System.err(30395): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
11-12 19:55:53.440: W/System.err(30395): at libcore.io.IoBridge.open(IoBridge.java:400)
11-12 19:55:53.440: W/System.err(30395): ... 18 more
我确定资产在那里,但不确定路径/models/dictation/6111.dic 是否正确?如果是,它应该工作得很好。是什么导致这变得疯狂?
任何帮助将不胜感激!
- 更新 -
我后来发现 sdcard 的状态是这里定义的共享
字符串 | 媒体共享 | 媒体存在时的存储状态,未安装,并通过 USB 大容量存储共享。
那么我该怎么做才能挂载sdcard呢?