INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

Whilst developing an Android App using Xamarin 5.1 I had issues deploying to the device. The exception was:
Deployment failed because of an internal error: Unexpected install output: pkg: /data/local/tmp/com.mycompany.myapp.apk Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]
It turns out that this is down to the fully qualified naming of an activity. One of the changes with 5.1 is that you now need to fully qualify the Android Callable Wrapper Naming. So for example if you previously had:

namespace MyNameSpace {
    [Activity]
    public partial class ActivityType : Activity {
        /* ... */
    }
}

Then to maintain compatibility with your scripts/external code, set the ActivityAttribute.Name property:
namespace MyNameSpace {
    [Activity(Name="mynamespace.ActivityType")]
    public partial class ActivityType : Activity {
        /* ... */
    }
}

The important thing to note is is the case sensitivity of the Name declaration. It must be lowercase for the namespace otherwise the compiler will throw the INSTALL_PARSE_FAILED_MANIFEST_MALFORMED error.

Comments

Popular posts from this blog

Switching Xamarin Accounts on Mac and Windows

Xamarin Forms - InitializeComponent does not exist in the current context

How to setup Azure Service Bus Relay to use with ACS