0
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="sam.gymnotes" >

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/NoActionBar" >
    <meta-data
        android:name="com.google.android.gms.version"
        />

    <activity
        android:name=".activity_ExcersiseView"
        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=".dialog_new_excersise"
        android:label="dialog_new_excersise"
        android:theme="@style/Theme_Dialog" >
    </activity>
    <activity
        android:name=".activity_IconChooser"
        android:label="@string/title_activity_icon_chooser" >
    </activity>
    <activity
        android:name=".activity_WorkoutView"
        android:label="@string/title_activity_activity__workout_view" >
    </activity>
    <activity
        android:name=".dialog_are_you_sure"
        android:label="@string/title_activity_dialog_are_you_sure"
        android:theme="@style/Theme_Dialog" >
    </activity>
    <activity
        android:name=".activity_SetView"
        android:label="@string/title_activity_activity__set_view" >
    </activity>
    <activity
        android:name=".dialog_edit_workout"
        android:label="@string/title_activity_dialog_date_picker"
        android:theme="@style/Theme_Dialog" >
    </activity>
    <activity
        android:name=".dialog_new_set"
        android:label="@string/title_activity_dialog_new_set"
        android:theme="@style/Theme_Dialog" >
    </activity>
    <activity
        android:name=".dialog_edit_note"
        android:label="@string/title_activity_dialog_edit_note"
        android:theme="@style/Theme_Dialog" >
    </activity>
    <activity
        android:name=".dialog_3option"
        android:label="@string/title_activity_dialog_convert"
        android:theme="@style/Theme_Dialog" >
    </activity>
    <activity
        android:name=".activity_Info"
        android:label="@string/title_activity_info" >
    </activity>
</application>

</manifest>

The above is my manifest file, I have gone through numerous answers on here for a malformed manifest and I cannot figure out what the issue is. What is causing the 'Error while Installing APK'. All I get when trying to run is

pkg: /data/local/tmp/sam.gymnotes Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]

gradle;

apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion '24.0.0'

defaultConfig {
    applicationId "sam.gymnotes"
    minSdkVersion 14
    targetSdkVersion 24
    versionCode 4
    versionName "1.1"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:design:24.0.0'
compile 'com.google.android.gms:play-services:9.2.0'
}
Sam
  • 454
  • 4
  • 18
  • Have you used any 3rd party lib? it may be occurred by other lib. – comeback4you Jul 08 '16 at 14:43
  • Are your Activities really named like this? `dialog_edit_note`? They should be Upper- and Camelcase. – dipdipdip Jul 08 '16 at 14:47
  • @dipdipdip .. or CamelCase - thought I'd say as you were critiquing :) – Mark Jul 08 '16 at 14:51
  • @dipdipdip would this fix the malformation? – Sam Jul 08 '16 at 14:53
  • I just wondering if your Activity really named `dialog_edit_note`. If so this should work. But normally Activities are named like `DialogActivity`. I'm just curious. – dipdipdip Jul 08 '16 at 14:57
  • I am going through old code of mine and trying to get it to run to begin with, Naming schemes are something I will get to in my own time as I see fit for my code but are out of scope for the current question. – Sam Jul 08 '16 at 15:00

2 Answers2

0

EDIT

try this answer

-> File
 -> project structure
  -> app 
   -> dependencies 
    -> click on + 
     -> library dependency
      -> select play-services (October 2015: com.google.android.gms:play-services:7.8.0)

-> Rebuild 
Community
  • 1
  • 1
ddb
  • 2,423
  • 7
  • 28
  • 38
0

1) Put </manifest> in the end of the file.

2) Use following code for gms version

 <meta-data
 android:name="com.google.android.gms.version"
 android:value="@integer/google_play_services_version" />
Saini
  • 734
  • 3
  • 8
  • The manifest close tag was left out of the question by mistake, I have edited the question. The Integer value doesn't point to anything currently, I am getting a red underscore – Sam Jul 08 '16 at 14:57
  • Error:(23, 28) No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version'). – Sam Jul 08 '16 at 15:04
  • Doesn't work, the meta data name and values need to be in their own tag – Sam Jul 08 '16 at 15:12
  • @user2964689 Check your Gradle dependencies includes the `compile 'com.google.android.gms:play-services-gcm:X.X.X'` - http://stackoverflow.com/a/20068489/4252352 – Mark Jul 08 '16 at 15:14
  • which version do i add in – Sam Jul 08 '16 at 15:38
  • use the latest one 3.0.0 – Saini Jul 08 '16 at 15:39
  • also add your gradle file in the question. – Saini Jul 08 '16 at 15:39