Skip to content

Conversation

@tobil4sk
Copy link
Member

There is a regression in 8.3.0 (specifically 8f0b8f3) which has broken builds for android apps that use macros, e.g.:

class Main extends lime.app.Application {
	macro static function test() {
		return macro "hello";
	}
	
	public function new () {
		super ();
		test();
	}
}
$ lime build android
/.../lime/src/lime/_internal/backend/native/NativeApplication.hx:1052: character 9 : You cannot use @:build inside a macro : make sure that your type is not used in macro
/.../lime/src/lime/_internal/backend/native/NativeApplication.hx:95: characters 31-87 : lime._internal.backend.native._NativeApplication.OrientationChangeListener does not have a constructor
/.../lime/src/lime/app/Application.hx:61: characters 30-55 : Unknown<0> cannot be constructed

This is because src/lime/_internal/backend/native/NativeApplication.hx now has OrientationChangeListener, which extends JNISafety which is marked with @:autoBuild.

We can avoid the error by skipping the @:autoBuild meta in the macro context.

@player-03 player-03 merged commit 736b5a6 into openfl:develop Jan 10, 2026
31 checks passed
@tobil4sk tobil4sk deleted the fix/macro-native-application branch January 10, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants