【问题标题】:native directory unfound in CodenameOne在 CodenameOne 中找不到本机目录
【发布时间】:2017-05-14 07:00:38
【问题描述】:

我正在使用 TTS,就像在 CodenameOne 中的 DrSbaitso 演示中使用 Netbeans 一样, 创建 TTS.java 接口后
`import com.codename1.system.NativeInterface;

公共接口 TTS 扩展 NativeInterface { 公共无效说(字符串文本); } when I click on "Generate native Access" , I got the dialog "native interfaces generated : see the 'native'directory in the project. Unless i can't find the native directory in my project , and the compiler keep the errorjava.lang.ClassNotFoundException: com.mycompany.myapp.TTSImpl`。有什么想法吗?

【问题讨论】:

    标签: netbeans codenameone text-to-speech


    【解决方案1】:

    该目录位于项目目录下,但 NetBeans 仅在 Files 视图中的常规视图中不显示它。

    您需要进行一次完整的“构建”,一旦您这样做,项目在运行时应该会找到 impl 类。

    【讨论】:

    • 完整版本并没有为我解决问题。找不到类 TTSImpl。
    • 在模拟器中?设备?如果这是在哪个 IDE 的模拟器中出现的问题,那么 IDE 中的类路径如何?请注意,模拟器并不是什么“大问题”,因为它只会运行 JavaSE 存根,您应该能够通过检查本机接口实例是否为空来正确处理这种情况(其中 impl 不存在)。跨度>
    • 实现 TTSimpl 时,如何解析 import android.speech.tts.TextToSpeech;为了构建到android?
    • Android 原生构建将在该包所在的原生 Android 环境下编译该代码。你看过这个视频了吗codenameone.com/…
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-11
    • 1970-01-01
    • 2021-01-09
    • 2019-07-02
    • 2020-06-29
    • 1970-01-01
    相关资源
    最近更新 更多