With the imminent release of SDK 1.5 (also known as “Cupcake”) for Android and T-Mobile G1 users a new rule is being enforced on the Market when you publish your application. The rule itself isn’t new – it’s existed since the 1.1 release of the Android SDK, but it’s enforcement in the market is new. You’ll see the following message if you haven’t been configuring your application correctly.

Market requires the minSdkVersion to be set in AndroidManifest.xml. The server could not process your apk

What this means when you read the Android 1.1 SDK documentation is simple enough. You just have to add the following code to your AndroidManifest.xml. Seems simple enough:

<manifest>
  ...
  <uses-sdk android:minSdkVersion="2" />
  ...
</manifest>

Or at least it would seem that way.

I added this code to my manifest and was met with the same error when I went to publish my app:

Market requires the minSdkVersion to be set in AndroidManifest.xml. The server could not process your apk

The Market dashboard is actually requiring (for whatever reason) that the android:minSdkVersion attribute in the <uses-sdk> be at the beginning of your manifest, immediately after the manifest tag.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.codethought.my.killerapp"
      android:versionName="1.0.1" android:versionCode="2">
    <uses-sdk android:minSdkVersion="2" />
....
</manifest>

With this minor adjustment my application uploaded without a hitch. Keep this in mind if you run into the same error.