“App not Installed” Error on Android When Updating to Newer Version

I recently updated an old Cordova Android app and tried to install it on my Android phone which had previous version installed already and the install failed with the message “App Not Installed”. Other than updating Android version and couple of plugins, everything else was same old and I had correctly changed “android-versionCode” as well as “version” to higher number so nothing looked wrong but I suspected it had something to do with either the version code or the certificates I was using to sign the app so I decided to look into the previous APK file and try to find something out. We can use AAPT tool to look into APK files which can be found in build-tools\<buildToolVersion> folder (for ex, C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.1). Go to the folder and run following command in the command prompt aapt dump badging myapp.apk It turned out that though I had android-versionCode code[…]

Phaser Cordova Mobile App Crashing on iOS

I recently decided to compile Phaser games to iOS and publish to The App Store. The games were already published on Google Play Store for Android and worked without any issues. I faced few issues after compiling Phaser games for iOS. The first issue which I faced was the game crashing randomly on iOS. After doing further research I found this article on Intel XDK forum which turned out to be the reason for crash. The games were written a while back with older versions of Phaser and I did not get time to upgrade and test this with newer versions of Phaser (CE and higher) so I decided to try the fix specified in this thread and voila, it worked just fine. Here is the code which I borrowed from the thread var mygame; window.onload = function () { mygame = new Phaser.Game(window.innerWidth, window.innerHeight, Phaser.AUTO, “mygame”); mygame.state.add(“Boot”, Boot); mygame.state.add(“Loading”, Loading); mygame.state.add(“MainMenu”, MainMenu); mygame.state.add(“TheGame”, TheGame); mygame.state.start(“Boot”); function onPause() { if(!mygame.paused)[…]

Path must be a string. Received undefined

It has been a couple months since I last used Intel XDK and a lot has changed since. I just tried to compile a demo HTML5 + Cordova Android app which was exported using Intel XDK version 3987 and got the following error while trying to add android platform to the app using cordova command line. To see how compiling is done, check this blog post. Discovered plugin “cordova-plugin-whitelist” in config.xml. Adding it to the project Installing “cordova-plugin-whitelist” for android This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in. Saved plugin info for “cordova-plugin-whitelist” to config.xml Error: Path must be a string. Received undefined After this error you wont be able to compile the APK. Some research on google got me to this thread which eventually worked. https://stackoverflow.com/questions/46730465/can-not-add-cordova-platform-on-cordova-7-1-0-path-must-be-a-string To fix[…]

Failed to remove a plugin from Intel XDK

In the latest Intel XDK version 3987 I was not able to remove the third-party plugins from HTML5 + Cordova app. Whenever I try to remove a plugin, it failed with the error message Uh oh! Path much be a string. Received undefined I found a workaround @ https://software.intel.com/en-us/forums/intel-xdk/topic/733620 Since Intel XDK is no more into development phase, I think this is the only way as long as this works. Steps are simple. Go to development tab and expand plugins folder there. Delete the third-party plugin and all dependent plugins. Also, delete fetch.json. Then go to Projects tab and delete the plugin from there under Plugin Management. Finally restart XDK.  

Cordova Plugins: Review Unnecessary Permissions

If you went through the article on adding social sharing feature in HTML5 game using Intel XDK, it seemed like a simple plugin which should not require any permission but after adding the plugin and few more other plugins I found that WRITE_EXTERNAL_STORAGE permission was added in my android app so I checked all plugins one by one to see which plugin is adding what permissions and found out that WRITE_EXTERNAL_STORAGE permission was being added by social sharing plugin. When I checked developer notes (quoted below) I found that the permission was not required in my case, since I was not fetching any remote images for sharing. For sharing remote images (or other files) on Android, the file needs to be stored locally first, so add this permission to AndroidManifest.xml: <uses-permission android:name=“android.permission.WRITE_EXTERNAL_STORAGE“ /> In fact it was just a simple play store URL which I was sharing in my app so[…]

Add AdMob Ads to HTML5 Game using Intel XDK

The steps are as following Open your app in Intel XDK and go to CORDOVA HYBRID MOBILE APP SETTINGS section Click on “Add Plugins to this project” and search for the plugin “cordova-plugin-admob-free” in npm. Click “Add Plugin” which adds plugin to the project. Open your index.html and add following code <script> document.addEventListener(“deviceready”, onDeviceReady, false); function onDeviceReady() { initAd(); showBannerFunc(); } //initialize the goodies function initAd(){ admob.banner.config({ id: ‘ca-app-pub-3940256099942544/6300978111’, adSize: window.plugins.AdMob.AD_SIZE.BANNER }); admob.interstitial.config({ id: ‘ca-app-pub-3940256099942544/1033173712’, autoShow: false }); // Create banner admob.banner.prepare() } //display the banner function showBannerFunc(){ admob.banner.show(); } //prepare the interstitial function prepareInterstitialFunc(){ admob.interstitial.prepare(); } //display the interstitial function showInterstitialFunc(){ admob.interstitial.show(); } </script> Replace banner and interstitial ad code id with yours. The code in the example is given by Google to test the ads which displays placeholder ads for testing. This can be used during development and testing. Replace it with your ad codes for release. Another thing to note here[…]

Add Social Sharing Feature to HTML5 Game using Intel XDK

If you have gone through previous post in which we discussed about using Intel XDK to compile HTML5 games to Android apps, next steps are to add features which are quite necessary for every Android app such Social Sharing option. There are many open source plugins available to add Social Sharing feature to your app and it takes no more than a few minutes of effort to integrate this feature and get it working. The steps are as following Open your app in Intel XDK and go to CORDOVA HYBRID MOBILE APP SETTINGS section Click on “Add Plugins to this project” and search for the plugin “cordova-plugin-x-socialsharing” in npm. Click “Add Plugin” which adds plugin to the project. Open your index.html and add following code <script> function share(){ window.plugins.socialsharing.share(‘Sample’, null, null, ‘https://play.google.com/store/apps/details?id=com.html5games.sample’); } </script> Replace title and URL of the Android app in the code. And that is it. Now the share[…]

Compile Phaser Games (or any other HTML5 Game) as Android Store App using Intel XDK

Intel XDK has long supported development and compilation of HTML5 games for Android, iOS and Windows store. It even provided a cloud based build system which took care of preparation of final packages which could be directly published to respective Android, iOS and Windows stores but starting from July 2017, Intel XDK build system has been shut down and new versions of Intel XDK do not have Game templates anymore. Still the tool is very useful for compiling your HTML5 games for Android, iOS and Windows stores. We are going to look at steps to compile HTML5 game for Android in this tutorial. Step 1 – Download and install Intel XDK. Step 2 – Create a new project using Blank HTML5 + Cordova template. Select “HTML5 + Cordova” and Click “Continue” which open a dialog box for specifying Project Name and Directory. We are going to use Dice Roller example code[…]