Steps to add Play Games Services to HTML5/Cordova App

If you have made an HTML5 game and have compiled the game to an APK using Cordova and now want to add Play Games Services to your app to use Leaderboard and Achievements from Play Games Services, you need to follow a set of steps to make it work. If you want to learn how to use cordova to compile HTML5 game to an APK and publish to the Google Play Store, follow the steps @ https://www.netexl.com/blog/use-cordova-to-compile-html5-games-to-android-app/ Assuming that we have installed all tools for cordova on our system and can compile the game to the APK, we will follow next steps for the Play Games Services integration. First we need to find a cordova plugin which integrates the Play Game Services API and add it to our project. Go to NPM and search for the latest plugin for the Play Game Services integration. If you have not already created[…]

Quick Tip

Migrate to cordova 11.0.0

Google Play Store has updated the target API level requirements. All app submissions are required to target Android 12 (API level 31) or higher. Cordova developers also need to upgrade to cordova-android 11.0.0. Check out following link for cordova update instructions. https://www.netexl.com/blog/use-cordova-to-compile-html5-games-to-android-app/ Once we update to cordova version 11 there are a few dependencies which also need to be updated. Android SDK Build Tool version should be updated to min 32.0.0. Go to SDK Manager -> Android SDK -> SDK Tools (select show package details checkbox) and make sure 32.0.0 is installed. If not, select and install it. We also need to update java version to java 11 otherwise you will see an error as following when compiling the APK. Android Gradle plugin requires Java 11 to run. If its an old project, delete previous platform and add new by specifically specifying the version For new projects simply add the[…]

How to add AdMob Reward Ads to Phaser 3 Game

We will be using corodva to compile a Phaser 3 Game to Android App. We are going to go over step by step description of how to implement Admob Reward Ads to our game. Let us start by creating a Phaser Game. For simplicity we will not have any game code in it but only a butoon to launch reward ads. Create the cordova project by using the following command in Node.js console. Refer to this blog to go over basic steps to compile an HTML5 game to Android app. We are going to use Admob Plus cordova plugin for implementing Admob ads in our game. Add plugin by using the command below. Make sure to replace App ID with your App ID in AdMob console. You need to create an App for your Android app and then create a Reward ad for that app which will be used here.[…]

Configure to use Adaptive Icons in Cordova

Adaptive icons require API 26 or above. We use a combination of legacy icons as well as adaptive icons to serve users who are using Android versions below 26 as well as those using 26 or above. Android will use Adaptive icons for API 26 or above and fallback to use legacy icons for devices with API below 26. For this tutorial we will create icon set using an online service https://easyappicon.com/. Create icon set using the service and download the set. You should see the icons in two folders; Android and iOS. For his tutorial we will use Android icon set. Go inside the folder and you would see folders as following Let us also create an Android app using Cordova as described in the previous article https://www.netexl.com/blog/use-cordova-to-compile-html5-games-to-android-app/ Create a new app by using the command as following A basic skeleton cordova project is created This is the bare[…]

Use Cordova to compile HTML5 games to Android App

Install npm and cordova https://docs.npmjs.com/downloading-and-installing-node-js-and-npm It is also useful to insall nvm which is node version manager to manage different versions of node.js. For windows the installable can be downloaded from here https://github.com/coreybutler/nvm-windows/releases check version of node, npm and, cordova using the commands as following Once nvm is installed it can be used to check for installed version of node by using the command On windows use following command to see available versions on node If a higher version of node is available it can be installed by specifying the version as following Configure the system to use the installed version of node now Cordova install and update Update npm to the latest version by specifying the version number All of the above commands are specified to make sure that we have latest version of node, npm, nvm, cordova installed before we start creating packages for our HTML5 game. Version[…]

GADInvalidInitializationException: The Google Mobile Ads SDK was initialized incorrectly.

While running a cordova app for iOS, if following error is thrown *** Terminating app due to uncaught exception ‘GADInvalidInitializationException’, reason: ‘The Google Mobile Ads SDK was initialized incorrectly. Google AdMob publishers should follow instructions here: https://googlemobileadssdk.page.link/admob-ios-update-plist to include the AppMeasurement framework, set the -ObjC linker flag, and set GADApplicationIdentifier with a valid App ID. Google Ad Manager publishers should follow instructions here: https://googlemobileadssdk.page.link/ad-manager-ios-update-plist’ Make sure to include following values in your info.plist <key>GADIsAdManagerApp</key> <true/> <key>GADApplicationIdentifier</key> <string>REPLACE_YOUR_ADMOB_APP_ID</string>