Requested extension com.adobe.ane.gameCenter is not supported for …

Share Button

anefixSome good man contacted to me today that doing the future game hit (I hope in this) and he use Adobe AIR for it. He was required the Game Center for iOS. Decision was taken to use free and official ANE by Adobe from updated in the March 2015 Gaming SDK, where was added support of iOS x64.

A little background info

Any platform can use own extension that could be packed in the same *.ane file:

- Windows (C/C++)
- Android, Android x86 (Java)
- iOS Device (Objectiv-C)
- iOS Simulator (Objectiv-C)
- MacOS(Objectiv-C)

Issue was in that if extension don’t have a native library for the platform – you will receive error: Requested extension %_id_% is not supported for %_platform_%.

If we create ANE for iOS and don’t develop for the rest – we can avoid this issues by developing default implementation that must not request any native code and must be executed on undeclared platforms.

In other words – workflow of default platform the same as you can use default in the switch:

switch (platform){
   case "iPhone-ARM":
       // Do logic
   break;
   default:
       // Do the rest logic  
}

If we know that platform is not supported – we can proceed only that we have:

public static function get isSupported():Boolean
		{
			if (flash.system.Capabilities.os.indexOf("iPhone") != -1)
			{
				return true;
			}
			return false;
		}

So now we can avoid using of default platform in iOS but leave it for other (Windows for etc.).

if ( isSupported() ) {
     // Do logic
} else {
    trace ("Platform is not supported. Skip this step");
}

Hope my explanation was useful for someone :)

Backing to the Game Center from Adobe – they don’t have default implementation and if you execute it for testing not on iOS – you will receive error. In our case this was:

Requested extension com.adobe.ane.gameCenter is not supported for Windows-x86.

Solution

Our luck was in isSupported method in exact ANE that was developed correctly and it’s skips native library code execution on absent platforms. We should re-use original library.swf from the ANE for default platform:

anefolder

1) Rename gameCenter.ane into gameCenter.zip
2) Extract all files
3) In the folder META-INF\ANE\ create “default” folder
4) Copy library.swf from iPhone-ARM folder into new “default”
5) Open extension.xml from the root META-INF\ANE\ folder
6) Add default platform at the end:

<platform name="default">
            <applicationDeployment/>
        </platform>

7) Full content of updated extension.xml must be the same:

<extension xmlns="http://ns.adobe.com/air/extension/3.4">
	<id>com.adobe.ane.gameCenter</id>
	<versionNumber>1</versionNumber>
	<platforms>
		<platform name="iPhone-ARM">
			<applicationDeployment>
				<nativeLibrary>libgameCenter.a</nativeLibrary>
				<initializer>gameCenterExtInitializer</initializer>
				<finalizer>gameCenterExtFinalizer</finalizer>
			</applicationDeployment>
		</platform>

	<platform name="default">
            <applicationDeployment/>
        </platform>

	</platforms>
</extension>

8) Compress back all that files and folders into ZIP as it was in the original file (be careful with ZIP content architecture)
9) Rename ZIP into ANE and use it! Now issue is gone!

Note! This solution can be applied only for that ANE’s that don’t have default platform but AS3 library use platform checking and skipping for target device.

Share Button

This Post Has Been Viewed 905 Times

Leave a Reply

Your email address will not be published.

Blue Captcha Image Refresh

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>