How to fix INSTALL_PARSE_FAILED_MANIFEST_MALFORMED in an Android application

Hi, I am trying to experiment with gcm but cannot make it work. I donโ€™t know where I was messing with him, below is the mistake I get. I try to deploy my application directly on the device and debug from there, but when I try to deploy it, it gives this error

Waiting for device. Target device: HT24LW108632 Uploading file local path: D:\Data\Android\AndroidTest\out\production\AndroidTest\AndroidTest.apk remote path: /data/local/tmp/Android.Test Installing Android.Test DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/Android.Test" pkg: /data/local/tmp/Android.Test Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED] 

AndroidManifest.xml

 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="Android.Test" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="14"/> <permission android:name="Android.Test.permission.C2D_MESSAGE" android:protectionLevel="signature" /> <uses-permission android:name="Android.Test.permission.C2D_MESSAGE" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <application android:label="@string/app_name" android:icon="@drawable/ic_launcher"> <activity android:name="MainActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" > <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> <category android:name="Android.Test" /> </intent-filter> </receiver> <service android:name=".GCMIntentService" /> </application> </manifest> 

My device is HTC OneX

  • Android Version: 4.03
  • HTC Sense Version: 4.0
  • Software Number: 1.29.110.11
  • HTC SDK API Level: 4.12
  • HTC Extension Version: HTCExtension_403_1_GA_7

Please guide me as a new fish in Android Sea.

Edit-1: I noticed that if I comment on this line below, the application expands and executes, but obviously I cannot go forward without permission below ... please help ....

 <permission android:name="Android.Test.permission.C2D_MESSAGE" android:protectionLevel="signature" /> 
+23
java android android-emulator android-manifest google-cloud-messaging
Sep 12
source share
11 answers

Change the name pack with the letters Caps to small letters.

+56
Sep 12 2018-12-12T00:
source share

Change your

android:name="MainActivity"

FROM

 android:name=".MainActivity" 

OR add the full package name in lowercase before your class name

 android:name="thepackage.MainActivity" 

Change all the attributes named android:name inside the activity tags, as I said.

+9
Mar 24 '15 at 16:44
source share

Instead:

 <permission android:name="android.permission.C2D_MESSAGE" android:protectionLevel="signature"/> 

at

 <uses-permission android:name="android.permission.C2D_MESSAGE" android:protectionLevel="signature"/> 

Try it.

+4
Jun 06 '13 at 14:44
source share
 <activity android:name="MainActivity" 

should be shaped like

 <activity android:name="com.company.appname" 

to do this, without errors, go to the package (right-click)> Android tools> rename the application package

+3
Nov 22 '12 at 8:31
source share

try writing the name of the activity following. "Instead

 <activity android:name="MainActivity" android:label="@string/app_name"> 

using

 <activity android:name=".MainActivity" android:label="@string/app_name"> 
+1
Sep 12 '13 at 5:59 on
source share

I met the same problem in android studio.

what solves this is to allow the company domain to be in small letters,

+1
Jul 15 '14 at 15:43
source share

Conclusion about this: http://code.google.com/p/android/issues/detail?id=37658 Uppercase letters cannot be used in package names in permissions. You (like me) were in a difficult situation when you deployed an application with a package name like this, and you need to use GCM. I tried to use some short form of permission:

 <permission android:name=".permission.C2D_MESSAGE" android:protectionLevel="signature" /> <uses-permission android:name=".permission.C2D_MESSAGE" /> 

I also defined the service in the same way. This should be in the application package. It worked on Android 4.3. Perhaps on 4.2. I know that in 4.0.3 it is not.

0
Nov 12 '13 at 7:06 on
source share

make sure your package name is in small letters ... worked for me

0
Apr 21 '15 at 19:08
source share

write the name of the java package and the name of all the folders in lowercase, this will work fine ...

0
May 7 '18 at 8:13
source share

In my case, the name of the package was mentioned only in small letters. But for some activities, I called it a partial name, for example, android:name=".ContactUs" . After I solved this, adding a prefix for the full package name in front of the action name, service name and broadcast provider name in the manifest file.

Working code

 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="vcan.doit.com"> <!-- To auto-complete the email text field in the login form with the user emails --> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.READ_PROFILE" /> <uses-permission android:name="android.permission.READ_CONTACTS" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.DesignDemo"> <activity android:name="vcan.doit.com.LoginActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="vcan.doit.com.MainActivity" android:theme="@style/Theme.DesignDemo" /> <activity android:name="vcan.doit.com.CheeseDetailActivity" android:parentActivityName="vcan.doit.com.MainActivity"> <meta-data android:name="android.support.PARENT_ACTIVITY" android:value="vcan.doit.com.MainActivity" /> </activity> <service android:name="vcan.doit.com.PushNotification.MyAndroidFirebaseMsgService"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT" /> </intent-filter> </service> <service android:name="vcan.doit.com.PushNotification.MyAndroidFirebaseInstanceIdService"> <intent-filter> <action android:name="com.google.firebase.INSTANCE_ID_EVENT" /> </intent-filter> </service> <activity android:name="vcan.doit.com.AboutUs" android:label="@string/abt_us" android:parentActivityName="vcan.doit.com.MainActivity"> <meta-data android:name="android.support.PARENT_ACTIVITY" android:value="vcan.doit.com.MainActivity" /> </activity> <activity android:name="vcan.doit.com.ContactUs" android:label="@string/contact_us" android:parentActivityName="vcan.doit.com.MainActivity"> <meta-data android:name="android.support.PARENT_ACTIVITY" android:value="vcan.doit.com.MainActivity" /> </activity> <activity android:name="vcan.doit.com.WriteToUs" android:label="@string/write_us" android:parentActivityName="vcan.doit.com.MainActivity"> <meta-data android:name="android.support.PARENT_ACTIVITY" android:value="vcan.doit.com.MainActivity" /> </activity> </application> 

0
Aug 06 '18 at 5:39
source share

I had this problem. The memory of my device was full. I solved my problem with freeing up device memory.

0
Jun 24 '19 at 9:57
source share



All Articles