[iOS] build failed using HaxeFlixel [SOLVED]

Hello guys, I am working on a game for iOS with HaxeFlixel so I am trying to compile this to iOS but I got some errors.

I have updated my MacOS and XCode to the latest version.

Command: lime test ios -simulator
This is the error:
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -configuration Release PLATFORM_NAME=iphonesimulator SDKROOT=iphonesimulator14.5 -arch x86_64 -project FlappyGame.xcodeproj -allowProvisioningUpdates -allowProvisioningDeviceRegistration build

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
    ARCHS = x86_64
    PLATFORM_NAME = iphonesimulator
    SDKROOT = iphonesimulator14.5

note: Using new build system
note: Planning build
note: Analyzing workspace
note: Using build description from disk
note: Build preparation complete
ExternalBuildToolExecution Build\ Haxe (in target 'Build Haxe' from project 'FlappyGame')
...
    make
Haxe simulator build: Release-iphonesim-64
haxe Build.hxml -D simulator -D HXCPP_M64 -cpp build/Release-iphonesim-64
../../../../source/BirdSprite.hx:53: characters 26-30 : Class<flixel.FlxG> has no field keys
make: *** [build-haxe-x86_64] Error 1
Command ExternalBuildToolExecution failed with a nonzero exit code

/Users/edu/dev/games/flappy-game/export/ios/FlappyGame.xcodeproj: warning: OpenGLES is deprecated. Consider migrating to Metal instead. (in target 'FlappyGame' from project 'FlappyGame')
** BUILD FAILED **


The following build commands failed:
	ExternalBuildToolExecution Build\ Haxe
(1 failure)
1 Like

I solved this issue using this:

	#if FLX_KEYBOARD
	jumpPressed = FlxG.keys.justPressed.SPACE;
	#end
	#if FLX_TOUCH
	var list = FlxG.touches.justReleased();
	jumpPressed = if (list.length > 0) true else false;
	#end

The problems was that my iOS compilation did not find the reference “FlxG.keys”.

2 Likes