How to fix INSTALL_PARSE_FAILED_MANIFEST_MALFORMED in my android application

后端 未结 11 1051
攒了一身酷
攒了一身酷 2020-11-30 09:04

Hi I am trying to experiment with gcm but unable to make it work. Don\'t know where I am messing with it, below is the error I am getting. I am trying to deploy my applicati

相关标签:
11条回答
  • 2020-11-30 09:27

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

    0 讨论(0)
  • 2020-11-30 09:27

    In my case I was mentioned the package name in small letters only. But for few of the activities I named it with partial name i.e android:name=".ContactUs" . After I solved it by prefixing full package name before all the activity name, service name and broadcast provider name in 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's 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 讨论(0)
  • 2020-11-30 09:29
    <activity android:name="MainActivity"
    

    should be formed like

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

    to do this without errors go to package (right click) > android tools > rename app package

    0 讨论(0)
  • 2020-11-30 09:30

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

    0 讨论(0)
  • 2020-11-30 09:32

    Change your

    android:name="MainActivity"

    TO

    android:name=".MainActivity"
    

    OR add the fully qualified package name in lowercase before your class name

    android:name="thepackage.MainActivity"
    

    Do change all the attributes named as android:name inside the activity tags as I suggested.

    0 讨论(0)
提交回复
热议问题