APPX3104 after upgrading your Windows Store app to Windows 10

In my previous post I started talking about potential issues you might face when upgrading C++ Windows Store apps to Windows 10 Technical Preview along with Visual Studio 2015 Preview.

Another thing that might occur when trying to deploy your app on your local machine is the following error:

error APPX3104: You cannot create an app bundle when building for platform ‘x86’ which is not included in the list of platforms selected for producting app bundle. Set platform to a one of following values: arm.

Note that this error doesn’t occur when deploying directly for your ARM devices, such as your Microsoft Surface or your Windows Phone.

This happens due to an entry in your .vcxproj file which has most likely been created by Visual Studio 2013:

Removing that entry will allow you to deploy for all platforms again. In fact, this line won’t be present if you create a new Visual C++ DirectX Windows app from scratch in Visual Studio 2015 Preview.

MSB3774 after upgrading your Windows Store app to Windows 10

If you’ve recently installed the Windows 10 Technical Preview along with Visual Studio 2015 Preview, you might encounter the following compiler error after having upgraded your C++ Windows Store app:

error MSB3774: Could not find SDK “Microsoft.VCLibs, Version=14.0”

Chances are that Visual Studio automatically changed the Platform Toolset of your project:

Platform Toolset

This may be pointed out by your version control system as well as the only change in your project file after the upgrade:

Changing it back to Visual Studio 2013 (v120) (or <PlatformToolset>v120</PlatformToolset> in the project file) might resolve that issue for you.

Game Analytics for Windows Phone 8.1 & Windows Store

Game analytics can help a great deal in improving your games. By tracking downloads and in-app purchases, player demography, average session length, player progress and performance, as well as quality metrics such as crashes, companies are constantly trying to be one step ahead of their competitors.

At slash games, we’ve been using GameAnalytics for about a year now. It’s easy to implement, easy to use, and it provides great visualizations, custom reports and funnels. Oh, and it’s free.

While GameAnalytics already provides integration for Unity, iOS, Android, Corona and Flash, there’s been no native integration for Windows Phone and Windows Store apps so far.

Based on their REST API and on the work by Jason Ericson, I’ve succeeded in creating a native plugin for Windows Phone 8.1 and Windows Store apps. You just have to include a single source code file in your project, and sending an event to the GameAnalytics backend becomes as easy as

The plugin automatically generates unique session ids, uses the app package version as build id, and the Application Specific Hardware Identifier (ASHWID) as user id by default. However, you can change these at any time.

The library is open source, works out-of-the-box with the standard Visual Studio “Visual C++ Windows Phone DirectX App” and “Visual C++ Windows Store DirectX App” templates, and is tested to pass store validation:

https://github.com/npruehs/game-analytics-win8

EDIT: Works with Windows Phone 8 apps as well now! Enjoy!

C++ Windows Store app validation fails

If  you’ve recently run the Windows App Cert Kit for your C++ Windows Store app, you might have encountered these or similar failures of the Supported API test:

You’ve ensured you’re not building in Debug mode. The error persists. And you could swear, a few days ago, everything was fine.

Clearly, msvc dlls are not the type of code you would have written yourself. So what to do about this?

Luckily, the friendly folks over at the MSDN forums have isolated the issue, verifying that it can (temporarily) be resolved by uninstalling the recent Windows update KB2976978. This is the officially recommended workaround by Microsoft for the time being, as well.

Note that the above errors won’t cause your app to fail submission.

I’ll update this post as soon as there’s anything new!

Lua in C++ Windows Store Apps

Many games support script languages to be able to change their logic with having to re-compile: Blizzard allows customizing your World of Warcraft user interface with Lua, for instance, and CCP built EVE Online around Stackless Python.

I’ve been messing around with C++ Windows Store Apps recently, more specifically with DirectX games for Windows Store. It required quite a bit of an effort to get Lua to run (and validate) with Windows Store apps, and I’d like to share my learnings.

  1. Download and install Microsoft Visual Studio Express 2013 for Windows, and create a new Visual C++ Windows Store DirectX App.Create a new Visual C++ Windows Store DirectX App.
  2. Download and extract the Lua 5.2.3 source code.
  3. Copy and include the contents of the Lua src folder in your project.
  4. VC++ does not support C++/CX extensions in files compiled as C. Select all Lua C source code files, and open the properties dialog. In Configuration Properties > C/C++ > General, change Consume Windows Runtime Extension to NoChange Consume Windows Runtime Extension to No.
  5. The precompiled header file (pch.h) for the Windows Store App is C++ and can’t be used from C. With all Lua C source code files still selected, open the properties dialog. In Configuration Properties > C/C++ > Precompiled Headers, change Precompiled Header to Not Using Precompiled Headers.Change Precompiled Header to Not Using Precompiled Headers.
  6. Some of the functions in Lua call system and IO functions that are not supported by Windows Store Apps – but we’re not going use them anyway:
    1. First, we need to disable deprecation warnings for these functions treated as errors. In the properties of your C++ project, in Configuration Properties > C/C++ > Preprocessor, add _CRT_SECURE_NO_WARNINGS to your Proprocessor Definitions.Add _CRT_SECURE_NO_WARNINGS to your Proprocessor Definitions.
    2. Next, in luaconf.h, remove the LUA_DL_DLL define in the #if defined(LUA_WIN) section.
    3. In lualib.c, remove the io_popen and io_pclose functions, and remove the popen entry from the iolib array in the same code file.
    4. In lua.c, loadlib.c and loslib.c, replace all calls to the getenv function by NULL. These functions are designed to handle NULL as a failed call to getenv.
    5. Finally, in loslib.c, remove the os_execute function and its entry in the syslib array in the same file.
  7. In the source file luac.c, remove the main function.
  8. Build and deploy the solution, and observe that validating it using the Windows App Certification Kit succeeds, except for the Branding validation test that requires you to replace the app icon images.

Congratulations, you’re good to go! Go ahead, and take your first steps with the overview of the Lua C API!

References

1. Justin M. Chase. Embedding Lua into a Windows Store app. January 13, 2014.