Error when publish wp8 game using cocos2d-x

Hi, I have one simple game that I want to publish on Windows marketplace, but when I try to upload the xap I receive the following errors:

1028: The native API api-ms-win-core-synch-l1-2-0.dll:CreateEventExA() isn’t allowed in assembly libGLESv2_phone.dll. 
Update it and then try again. 
1028: The native API api-ms-win-core-interlocked-l1-2-0.dll:InterlockedCompareExchange() isn’t allowed in assembly libGLESv2_phone.dll. 
Update it and then try again. 
1028: The native API api-ms-win-core-synch-l1-2-0.dll:CreateMutexExA() isn’t allowed in assembly libcocos2d.dll. 
Update it and then try again.

How I can correct them.

Did you test your app through open store test kit present in Project tab.

I’m having similar issue:
1028: The native API api-ms-win-core-synch-l1-2-0.dll:CreateEventExA() isn’t allowed in assembly libGLESv2_phone.dll. Update it and then try again. 1028: The native API api-ms-win-core-debug-l1-1-1.dll:OutputDebugStringA() isn’t allowed in assembly libcocos2d.dll. Update it and then try again. 1028: The native API api-ms-win-core-synch-l1-2-0.dll:CreateMutexExA() isn’t allowed in assembly libcocos2d.dll. Update it and then try again.

I have tested the app using open store kit, but it outputs exacly the same errors, without any information regarding their location in code. I managed to fix the ‘OutputDebugStringA’ error, but I couldn’t find files containing code referencing ‘CreateMutexExA’.

Compiled as ARM, Release.

I don’t know what is this open store kit.
johnny english wrote

I find both the ‘OutputDebugStringA’ and the ‘CreateMutexExA’, but I don’t know how to correct it.

The CreateMutexExA is located in the synchapi.h file.
The OutputDebugStringA is located in the debugapi.h file.
this is part of the code from debugapi.h file

#pragma region Application Family

#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)

WINBASEAPI
VOID
WINAPI
OutputDebugStringA(
    _In_opt_ LPCSTR lpOutputString
    );

WINBASEAPI
VOID
WINAPI
OutputDebugStringW(
    _In_opt_ LPCWSTR lpOutputString
    );

#ifdef UNICODE
#define OutputDebugString  OutputDebugStringW
#else
#define OutputDebugString  OutputDebugStringA
#endif // !UNICODE

#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion

Could you put an example of how you correct the code. I try to comment the code, but when I comment the app don’t compile anymore.

You don’t actually need to comment out these lines. In order to make the app compile, I found and commented the cocos2d-x code referencing these functions. I basically had to remove the code from the ‘addImageAsync’ function in CCTextureCache file and 2 lines in ‘CCLuaLog’ method of CCCommon file.

You can see that this is what they’ve done for cocos2dx preview released couple of months ago: https://github.com/cocos2d-x/cocos2dx-win8/blob/wp8_v2/Cocos2dWindowsPhone/textures/CCTextureCache.cpp

Removing the ‘CreateEventExA’ is more problematic as it is referenced by Sleep function in ThreadEmulation file of Angle project, related to rendering. Nevertheless, I’ve commented it out anyway. It works on simulator, but I don’t have any WP8 device to test it.

If there is a nicer way of doing it like changing preprocessor config or sth, please post it here.

Please try this

Hi, in my case I was able to get around this problem by changing:
CreateMutexExA() > CreateMutexExW
CreateEventExA
> CreateEventExW()

and commenting out:
OutputDebugStringA()

I still receive the following error:

1028: The native API api-ms-win-core-interlocked-l1-2-0.dll:InterlockedCompareExchange() isn’t allowed in assembly libGLESv2_phone.dll. Update it and then try again.

How I can get rid of this InterlockedCompareExchange() method?

I just change my config to ARM, by selecting device instead Emulator WVGA 512. All errors are gone.

David H wrote:

Hi, in my case I was able to get around this problem by changing:
CreateMutexExA() > CreateMutexExW
CreateEventExA
> CreateEventExW()
>
and commenting out:
OutputDebugStringA()

can you tell which files did you change or how to find them
thx in advance

Hi, you can use keyword search in Visual Studio (CTRL+F) and scope your search to Entire Solution.

It’s not needed to change any code, take a look in the screenshots below, you only need to change your project from win32 to arm, and deploy to device option.
This will create a xap file that will not show any error when you try to publish windows phone store.

Click in the confiuration manager like it’s showed in the second picture and change win32 to arm.

In my case, it was UNICODE that wasn’t defined for libcocos2d preprocessor, because of which dll:CreateMutexExA was getting picked. For WP8, the call to use is dll:CreateMutexExW. This is governed by UNICODE parameter

cocos2d-x-3.0 have same issue :((

Hey Guys. For me, it was the use of CreateEventEx in Audio.h. Defining UNICODE for CocosDenshion made this go away.

cocos2d-x-3.0 have same issue
please fix for me

Uploaded an app on windows phone store and i have the following error

Validation errors

1028: The native API api-ms-win-core-synch-l1-2-0.dll:CreateEventExA() isn’t allowed in assembly libcurl.dll. Update it and then try again.

1028: The native API api-ms-win-core-localization-l1-2-0.dll:FormatMessageA() isn’t allowed in assembly libcurl.dll. Update it and then try again.

HOW DO I SOLVE IT ? …this is for cocos2dx 3.4

this is not an issue of cocos2d-x, you must change the project config,
just like I said in my last post here

the image links are different(they help understand how to change the config needed to avoid this error)

Thanks for the suggestion
Its already configured as arm as you can see in the above image . Libcurl is the one coming out with the errors in latest version 3.4 . Any ideas ?

Sorry, unfortunately I never use cocos2d-x v3, only v2. I don’t know how to correct that