Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

Tags:

android

I tried everything, renaming the package, changing the permissions etc, still i see the error INSTALL_PARSE_FAILED_MANIFEST_MALFORMED on my console.

I tried logging from logcat and this is what it says is "Failed parse during installPackageLI" and "android.content.pm.PackageParser$PackageParserException: /data/app/vmdl170122893.tmp/base.apk (at Binary XML file line #33): does not have valid android:name" and atlast says "Debugger is no longer active"

I am trying this to run on em21 ie Lollipop SDK.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="Ca.Rushabh.Mobileproject"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="21" />

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />

<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="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<permission
    android:name="com.example.mymapsv2.permission.MAPS_RECEIVE"
    android:protectionLevel="signature" />

<uses-permission android:name="com.example.mymapsv2.permission.MAPS_RECEIVE" />

<application
    android:allowBackup="true"
    android:icon="@drawable/blue_droid"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="Ca.Rushabh.Mobileproject.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>
    <activity
        android:name="Ca.Rushabh.Mobileproject.About"
        android:label="@string/title_activity_about"
        android:theme="@android:style/Theme.Dialog" >
    </activity>
    <activity
        android:name="Ca.Rushabh.Mobileproject.ToDoList"
        android:label="abcd" />
    <activity
        android:name="Ca.Rushabh.Mobileproject.ToDoDetailActivity"
        android:windowSoftInputMode="stateVisible|adjustResize" />

    <provider
        android:name="Ca.Rushabh.Mobileproject.MyToDoContentProvider"
        android:exported="false"
        android:authorities="com.example.mobileproject.todos.contentprovider" />

    <activity
        android:name="Ca.Rushabh.Mobileproject.ViewAnimationActivity"
        android:label="@string/title_animation" >
    </activity>
    <activity
        android:name="Ca.Rushabh.Mobileproject.ViewAnimation2"
        android:label="@string/title_animation" >
    </activity>
    <activity
        android:name="Ca.Rushabh.Mobileproject.ContactUs"
        android:label="@string/title_activity_contact_us"
        android:theme="@android:style/Theme.Dialog" >
    </activity>
    <activity
        android:name="Ca.Rushabh.Mobileproject.GoogleMapV2"
        android:label="@string/title_activity_google_map_v2" >
    </activity>
    <meta-data
        android:name="com.google.android.gms.version" />
    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
</application>

</manifest>
like image 674
Rushabh Shah Avatar asked Nov 03 '14 19:11

Rushabh Shah


4 Answers

If anyone getting this error on Android 12 (Android S) preview version. Update all of your dependencies to latest one and Please add -

android:exported="true"

to to any <activity>, <activity-alias>,<service>, or <receiver> components that have <intent-filter>s declared in the app’s AndroidManifest.xml file.

Refer to this link and behavioral changes for Android 12 API 31.

like image 62
karanatwal.github.io Avatar answered Oct 30 '22 11:10

karanatwal.github.io


I was getting this issue

failed to install c:\users\nisha jain\documents\grayopus 
project\rxsmile\build\app\outputs\flutter-apk\app.apk: failure 
[install_parse_failed_manifest_malformed: failed parse during 
installpackageli: /data/app/vmdl914617141.tmp/base.apk (at binary xml file 
line #27): com.grayopus.rxsmile.mainactivity: targeting s+ (version 31 and 
above) requires that an explicit value for android:exported be defined when 
intent filters are present] error launching application on sm e625f.

But it solved by adding this line in AndroidManifest.xml

android:exported="true"
like image 21
Nisha Jain Avatar answered Oct 30 '22 12:10

Nisha Jain


There is more than one problem as RC. and I found out.

  • Change all your package names to lowercase
  • Update the <meta-data> attribute to have a valid value.

Correct code for the meta data:

<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />

Sources:

  • Google Play Services v13 error meta-data in AndroidManifest
  • Why should java package name be lowercase?
like image 29
Rolf ツ Avatar answered Oct 30 '22 11:10

Rolf ツ


none of the proposed solutions worked for me, so im posting this additional answer in the hope it will help others.

what worked for me was setting exported value for all my activities (as suggested by @karanatwal.github.io) AND updating all my dependencies, which apparently did not have this value set.

i originally dismissed the dependencies part from my attempts to fix this, as during my research ive seen (online) very specific error messages saying that this is indeed the problem (setting exported value) as well as indicating exactly which dependency was not complying with it. for some reason, i did not get this message.

note that this may not work if the latest version of a dependency still does not comply with this rule.

like image 42
or_dvir Avatar answered Oct 30 '22 11:10

or_dvir