6

i am getting strange issue while installing app.

I have create Google Map V2 example and its working fine. After all success i have integrate JAVA -XML - Manifest file in my older project.

When i compileing my project there is no error but when i trying to launch its shows me

Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED Error.

I am following this link for Google Map V2 exmaple.

The Logcate is strang. i am unable to find issue.

i have tried so many thing related Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED error and also follow that rule but something goes wrong.

Rnd Wrok :

How to fix INSTALL_PARSE_FAILED_MANIFEST_MALFORMED in my android application

Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED code included

https://groups.google.com/forum/?fromgroups=#!topic/android-developers/RoghZWPRK_s

If i remove new example files and run older project then its running okay.

Please guys help me.

Manifest File

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

    <supports-screens
        android:largeScreens="false"
        android:normalScreens="true"
        android:smallScreens="true" />

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

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_LOGS" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_CORSE_LOCATION" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="my.pkg.permission.MAPS_RECEIVE" />

    <permission
        android:name="my.pkg.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

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

    <application
        android:allowBackup="true"
        android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:logo="@drawable/app_icon"
        android:theme="@style/mytheme" >
        <activity
            android:name="Splash"
            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="my.pkg.Google_Map" >
        </activity>


        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyAULMOV1ylxC7wvEIP1hP7EeuKr1dKLaVQ" />
    </application>

</manifest>

Update :

Logcate

04-15 17:33:37.685: E/power(1482): *** set_screen_state 1
04-15 17:33:37.692: E/SensorManager(1482): registerListener :: handle = 0  name= BMA222 delay= 60000 Listener= android.view.WindowOrientationListener$SensorEventListenerImpl@406996b8
04-15 17:33:37.692: E/SensorManager(1482): reg :: handle = 0
04-15 17:33:37.786: E/ClockWidget(17093): getOrientation portrait
04-15 17:33:37.786: E/ClockWidget(17093): drawDayText
04-15 17:33:37.786: E/ClockWidget(17093): width= 50
04-15 17:33:37.786: E/ClockWidget(17093): widthText= 58.0
04-15 17:33:37.786: E/ClockWidget(17093): RIGHT
04-15 17:33:37.810: E/Launcher(1587): setWindowOpaque()
04-15 17:33:38.692: E/StatusBarPolicy(1544): ecio: 38
04-15 17:33:38.692: E/StatusBarPolicy(1544): iconLevel: 4
04-15 17:33:40.653: E/power(1482): *** set_screen_state 0
04-15 17:33:40.653: E/SensorManager(1482): unregisterListener:: all sensors,  listener = android.view.WindowOrientationListener$SensorEventListenerImpl@406996b8
04-15 17:33:40.653: W/PowerManagerService(1482): CurLockF mPS:0 mUS=0
04-15 17:33:40.653: W/PowerManagerService(1482): type=FULL_WAKE_LOCK                 'keyguard' AW  (mS=7)  activeT=272
04-15 17:33:40.653: W/PowerManagerService(1482): mPokeLocks.size=0:
04-15 17:33:40.755: E/AndroidRuntime(27309): feature code ==> cannot open file
04-15 17:33:41.021: E/power(1482): *** set_screen_state 1
04-15 17:33:41.052: E/SensorManager(1482): registerListener :: handle = 0  name= BMA222 delay= 60000 Listener= android.view.WindowOrientationListener$SensorEventListenerImpl@406996b8
04-15 17:33:41.052: E/SensorManager(1482): reg :: handle = 0
04-15 17:33:41.146: E/Launcher(1587): setWindowOpaque()
04-15 17:33:41.169: E/ClockWidget(17093): getOrientation portrait
04-15 17:33:41.169: E/ClockWidget(17093): drawDayText
04-15 17:33:41.169: E/ClockWidget(17093): width= 50
04-15 17:33:41.169: E/ClockWidget(17093): widthText= 58.0
04-15 17:33:41.169: E/ClockWidget(17093): RIGHT
04-15 17:33:42.997: W/ActivityManager(1482): No content provider found for: 
04-15 17:33:43.817: E/StatusBarPolicy(1544): ecio: 38
04-15 17:33:43.817: E/StatusBarPolicy(1544): iconLevel: 4
04-15 17:33:46.286: E/power(1482): *** set_screen_state 0
04-15 17:33:46.286: W/PowerManagerService(1482): CurLockF mPS:0 mUS=0
04-15 17:33:46.286: W/PowerManagerService(1482): mPokeLocks.size=0:
04-15 17:33:46.294: E/SensorManager(1482): unregisterListener:: all sensors,  listener = android.view.WindowOrientationListener$SensorEventListenerImpl@406996b8
04-15 17:33:46.364: E/StatusBarPolicy(1544): ecio: 37
04-15 17:33:46.364: E/StatusBarPolicy(1544): iconLevel: 4
04-15 17:33:47.075: W/ActivityManager(1482): No content provider found for: 
04-15 17:33:51.497: E/StatusBarPolicy(1544): ecio: 36
04-15 17:33:51.497: E/StatusBarPolicy(1544): iconLevel: 4
04-15 17:33:54.060: E/StatusBarPolicy(1544): ecio: 35
04-15 17:33:54.060: E/StatusBarPolicy(1544): iconLevel: 4
04-15 17:33:56.630: E/StatusBarPolicy(1544): ecio: 33
04-15 17:33:56.630: E/StatusBarPolicy(1544): iconLevel: 4
04-15 17:34:00.005: E/ClockWidget(17093): getOrientation portrait
04-15 17:34:00.005: E/ClockWidget(17093): drawDayText
04-15 17:34:00.005: E/ClockWidget(17093): width= 50
04-15 17:34:00.005: E/ClockWidget(17093): widthText= 58.0
04-15 17:34:00.005: E/ClockWidget(17093): RIGHT
04-15 17:34:01.732: E/StatusBarPolicy(1544): ecio: 32
04-15 17:34:01.732: E/StatusBarPolicy(1544): iconLevel: 4
Community
  • 1
  • 1
Chintan Khetiya
  • 15,962
  • 9
  • 47
  • 85

5 Answers5

22

It was very difficult to find the solution because Logcat said something else. Finally I found the solution for my above query.

The issue was in my package name: I had set the first character of the package name to a capital letter like Chintan.Khetiya.Package.

Generally, that was working for me in my older project, but when I tried to implement Google Maps code in my existing project, then the Manifest File is not allowed to use a capital letter in the package name.

So, finally I replaced it with lowercase characters like chinta.khetiya.package, and updated my new Google Maps Key with the new package name.

Now it's working.

So be careful when you set your package name. See more here.

Community
  • 1
  • 1
Chintan Khetiya
  • 15,962
  • 9
  • 47
  • 85
  • I think also your activity name should start with a dot `.`. +1 for your solution tho. –  Jul 09 '14 at 08:21
  • This is so wierd. Even though my namespaces contain capital letters "NamespacePart1.NameSpacePart2.ActivityClassName" i had to lowercase it but leave the class name as is: "namespacepart1.namespacepart2.ActivityClassName". But it worked. Thanks! – To Ka Sep 19 '14 at 11:43
  • Thanks for this - this is the sort of issue you could pull your hair out over for days, so thank goodness for Stackoverflow and internet search.. – Matt Sep 01 '15 at 14:49
1

The error is due to your comment usage in your manifest file. You cannot use comments like this in your Manifest:

// new update 

You'll have to use the XML way, like so:

<!-- new update -->

//// EDIT:

Actually, you're using a custom permission before declaring the permission. Try turning this part around:

<uses-permission android:name="my.pkg.permission.MAPS_RECEIVE" />

    <permission
        android:name="my.pkg.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

to

<permission
        android:name="my.pkg.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

<uses-permission android:name="my.pkg.permission.MAPS_RECEIVE" />
Sander van't Veer
  • 5,930
  • 5
  • 35
  • 50
  • i haven't add comment in my manifest file , its just for highlight.thanks for replay – Chintan Khetiya Apr 15 '13 at 13:00
  • Ah, my bad. Took a closer look and found probably found the actual reason. You declare using a custom permission, before actually declaring this permission. Try turning this part around: – Sander van't Veer Apr 15 '13 at 13:04
  • Alright, last thing I can think of is the `meta-data` tag. You can only use those within `activity`, ``, `` and ``, yet you use it within your `` tag. This might cause problems. (Source: http://developer.android.com/guide/topics/manifest/meta-data-element.html) – Sander van't Veer Apr 15 '13 at 13:20
  • yes it may be true but in this case see here https://developers.google.com/maps/documentation/android/start?hl=fr#specifying_permissions they are saying add before – Chintan Khetiya Apr 15 '13 at 13:24
  • Hmm alright. Way to go Google, not following your own guidelines. Sorry man, out of ideas then. Good luck! – Sander van't Veer Apr 15 '13 at 13:26
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/28253/discussion-between-chintan-khetiya-and-sander-vant-veer) – Chintan Khetiya Apr 15 '13 at 13:27
  • @sSander van't Veer you good luck is worked for me. thanks +1 for help me. – Chintan Khetiya Apr 16 '13 at 06:42
1

Your package name should start with lower case letter. Suppose you have:

Com.Example.packagename

Changed it to something like

com.example.packagename

That will solve your problem.

Farid Nouri Neshat
  • 29,438
  • 6
  • 74
  • 115
Sritam Jagadev
  • 955
  • 4
  • 18
  • 46
  • It worked for me, thanks for the answer... it's so lame that we have to put all capital letter into smaller case. – Joe Dec 04 '16 at 23:21
0

You should add android:name=".Splash" instead of android:name="Splash"

Modified code below:::HAPPY CODING :)

<activity
            android:name=".Splash"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
Listo
  • 179
  • 1
  • 2
  • 8
0

If you set export to false or somehow delete the line set export line in the manifest file then it could give the error mentioned as above

<activity
        android:name="com.aditya.flappybird.AndroidLauncher"
        android:label="@string/app_name" 
        android:screenOrientation="landscape"
        android:configChanges="keyboard|keyboardHidden|navigation|orientation|screenSize|screenLayout"
        android:exported="true">

if the android:exported="true" is not present on the above code then just add this line in your manifest file and you are good to go

Aditya Kumar
  • 1
  • 1
  • 5