How to set package name of Xamarin.Android APK for Google Play submission

10,924

Solution 1

The properties window in Visual Studio (assuming your writing in this) has a couple of settings you can change. These override the manifest when you compile. Perhaps this is where your stray name is coming in from? Same goes for the attributes you place in the class files in your code, Xamarin rewrites all of your manifest on compile. If you display hidden files in the solution tab and go to obj\Release\android this directory has the manifest that is generated for your app. Maybe it will shed some light.

Solution 2

I'm using DevStudio and did all of the following things, the last of which FINALLY worked and the Play store accepted my build. I'm pretty sure #2 and #5 are required, maybe all of them, but in any case I think this should go a long way to helping people in a similar situation:

  1. Changed the filename to com.foo.bar.apk (pretty sure this doesn't matter)
  2. Right-clicked on ProjectName.Droid, Properties-->Android Manifest. Changed the Package Name to com.foo.bar
  3. In that same dialog, set Version Number to 1 and Version Name to "Alpha 1"
  4. Under Properties-->Application, changed Assembly to com.foo.bar
  5. In the Archive Manager, right click on my app and Delete it. Re-create via right-clicking on project again and choosing Archive...
Share:
10,924
Dan Cook
Author by

Dan Cook

Updated on July 26, 2022

Comments

  • Dan Cook
    Dan Cook almost 2 years

    I have finished my app after 8 months work and I am attempting to submit to Google Play.

    I sign the and align the APK properly and upload the APK to Google Play. Then I get the following message:

    Upload failed Your APK's package name must be in the following format "com.example.myapp". It may contain letters (a-z), numbers, and underscores (_). It must start with a lowercase character.

    Here is the AndroidManifest.xml file:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"     android:installLocation="auto" package="com.vrocket.launcher" android:versionName="1.30.637" android:versionCode="1">
        <uses-sdk android:targetSdkVersion="14" />
        <application android:hardwareAccelerated="true" android:label="launchpad">
            <provider android:name="com.vrocket.launcher.LocalFileContentProvider" android:authorities="com.vrocket.launcher" />
        </application>
        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
        <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    </manifest>
    

    As far as I can tell, the package name I specify here meets the requirements for Google Play submission. I did change my package name in the Android.Manifest since I started the project but I figure this would be pretty normal practice.

    Has anyone had similar issues submitting a Xamarin.Android app to Google Play?

    EDIT:

    I have since figured out that the APK is being compiled with an old package name VRocket.VRocket. I found this out using the aapt tool in the Android SDK. Why is it not building with the package name specified in AndroidManifest.xml?