System.exit() 在 Javascript 构建时失败,是否有预处理器?

System.exit() failed on Javascript build, any preprocessor for this?

我的 codenameone 应用程序在 android/desktop 上运行,但是当我尝试发送 javascript 版本时,它显示


    ...
    [INFO] Building JavaScript file
    [INFO] JavaScript file built with errors
    [ERROR] Method java.lang.System.exit(I)V was not found
        at userclasses.StateMachine.actionPerformed(StateMachine.java:2637)
        at com.codename1.impl.html5.HTML5Implementation.run(HTML5Implementation.java:369)
        at com.codename1.ui.Display.callSerially(Display.java:768)
        at com.codename1.impl.html5.Stub.main(Stub.java:66)
    ...

System.exit() 行似乎失败了。我在 android 构建中需要这个,codenameone 是否有任何 "preprocessor" 供我在发送不同构建时 comment/uncomment 一些代码,以便于代码维护?

改用Display.getInstance().exitApplication()