Android investigate

Beware stricter Manifest checking in Android ICS

Find out why your application is working fine in Gingerbread and on the Ice Cream Sandwich virtual machine, but why you cannot run it on an ICS physical device.

A device running Ice Cream Sandwich found its way into the office last week, and I took the opportunity to test an app that I'd made on the new device, for no other reason than that I could. This turned into an extended debugging session after the app refused to start. This was completely unexpected behaviour, as the ICS emulator had run the app with no issue.

The error I was seeing was:


[2012-01-20 16:45:03 - EverlastingBrowserTest] Starting activity com.techrepublic.everlastingbrowser.Splash on device C1OKAS034590

[2012-01-20 16:45:04 - EverlastingBrowserTest] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.techrepublic.everlastingbrowser/.Splash }

[2012-01-20 16:45:04 - EverlastingBrowserTest] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000

After much angst, it turned out that I had a stray permission entry on my application in the Manifest file:


<?xml version="1.0" encoding="utf-8"?>

<manifest .... >

<uses-sdk android:minSdkVersion="10" />

<uses-permission android:name="android.permission.INTERNET" />

<application

android:icon="@drawable/ic_launcher"

android:label="@string/app_name" android:permission="android.permission.INTERNET">

...

</application>

</manifest>

The fix was to remove the offending android:permission="android.permission.INTERNET" property.

I did not encounter this issue when deploying the application to Gingerbread devices, so presumably ICS is wee bit stricter on its permission duplication -- and that's not a bad thing at all.

About

Some would say that it is a long way from software engineering to journalism, others would correctly argue that it is a mere 10 metres according to the floor plan.During his first five years with CBS Interactive, Chris started his journalistic advent...

0 comments