Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporting my sketch throws exception #867

Open
mbrotz opened this issue Dec 3, 2024 · 0 comments
Open

Exporting my sketch throws exception #867

mbrotz opened this issue Dec 3, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mbrotz
Copy link

mbrotz commented Dec 3, 2024

Most appropriate sub-area of Processing 4?

Export, Build process

Processing version

4.3.1

Operating system

Windows/macOS

Steps to reproduce this

Hi

If i try to export my sketch the export fails with the following error message and exception:

Syntaxfehler - Missing operator, semicolon, or ‘}’ near ‘d’?
processing.app.SketchException: Syntaxfehler - Missing operator, semicolon, or ‘}’ near ‘d’?
	at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:261)
	at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:146)
	at processing.mode.java.JavaBuild.build(JavaBuild.java:111)
	at processing.mode.java.JavaBuild.build(JavaBuild.java:93)
	at processing.mode.java.JavaBuild.exportApplication(JavaBuild.java:564)
	at processing.mode.java.JavaMode.handleExportApplication(JavaMode.java:183)
	at processing.mode.java.JavaEditor.lambda$handleExportApplication$18(JavaEditor.java:479)
	at processing.app.ui.ExportPrompt.trigger(ExportPrompt.java:345)
	at processing.mode.java.JavaEditor.handleExportApplication(JavaEditor.java:488)
	at processing.mode.java.JavaEditor.lambda$buildFileMenu$0(JavaEditor.java:227)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
	at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:374)
	at java.desktop/com.apple.laf.ScreenMenuItem.actionPerformed(ScreenMenuItem.java:129)
	at java.desktop/java.awt.MenuItem.processActionEvent(MenuItem.java:692)
	at java.desktop/java.awt.MenuItem.processEvent(MenuItem.java:651)
	at java.desktop/java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:379)
	at java.desktop/java.awt.MenuComponent.dispatchEvent(MenuComponent.java:367)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:747)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:744)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

It happens with Processing 4.3 and 4.3.1 on mac and windows. I haven't tested older versions of processing. I get the same error message if i click the menu item for optimizing the sketch.

If i create a new project with just an empty setup method, optimizing and exporting works fine. My project consists of 20 files with several thousand lines of code. Maybe that's a problem? I tried to reproduce the error in a new project but failed to do so. I was able to find a possibly related problem though. If i create a new project with the following code and hit the optimize button, it fails with the runtime error "IllegalStateException: size() cannot be used here, see https://processing.org/reference/size_.html".

/*
void setup() {

}
*/

void setup() {
  size(600, 600, P2D);
}

The error disappears if you either remove the comment or rename the function inside the comment to, for example, test(). Exporting the sketch works fine tough. I removed all the multiline comments from my larger project but it made no difference.

snippet

No response

Additional context

No response

@mbrotz mbrotz added the bug Something isn't working label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant