Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED in Android - android

I am trying to build an application and keep getting this error, I can't seem to do anything about:
Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
The Android manifest is as follows:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ehealth"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="23" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".Home"
android:label="#string/app_name" >
<!-- First screen to load start -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- First screen to load end -->
</activity>
<activity
android:name=".Profile"
android:label="#string/title_activity_profile" >
</activity>
<activity
android:name=".LoginActivity"
android:label="#string/title_activity_login"
android:windowSoftInputMode="adjustResize|stateHidden" >
</activity>
<meta-data />
<activity
android:name=".Login"
android:label="#string/title_activity_login" >
</activity>
<activity
android:name=".Paramedic"
android:label="#string/title_activity_paramedic" >
</activity>
</application>
<!-- To access Google+ APIs: -->
<uses-permission android:name="android.permission.INTERNET" />
<!--
To retrieve OAuth 2.0 tokens or invalidate tokens to disconnect a user. This disconnect
option is required to comply with the Google+ Sign-In developer policies
-->
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<!-- To retrieve the account name (email) as part of sign-in: -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
</manifest>

Remove the
<meta-data />
meta-data elements must have an android:name and either android:value or android:resource.

For reference (in addition to laalto's answer), if you're using Android Studio, it's worth checking Messages/Gradle Console tabs, as it may contains clues as to what's the problem. In your case, you could have seen something similar to:
Missing 'name' key attribute on element meta-data at AndroidManifest.xml:37:9-22

Related

Zero (0) compatible devices on Google Play

Every time I upload my app to Google Play, I get "0 compatible devices". My app works when I test it on my device, and I`m not using anything that would require a specific device.
There is not reason for this to happen, my app is very simple.
My Android Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gameblox.gocil"
android:versionCode="6"
android:versionName="1.5">
<uses-sdk android:targetSdkVersion="21" android:minSdkVersion="14" />
<!-- Required to access Google Play Licensing -->
<uses-permission android:name="com.android.vending.CHECK_LICENSE" />
<!-- Required to download files from Google Play -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- Required to keep CPU alive while downloading files (NOT to keep screen awake) -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!--
Required to poll the state of the network connection
and respond to changes
-->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Required to check whether Wi-Fi is enabled -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<!-- Required to read and write the com.gameblox.gocil.expansion files on shared storage -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<receiver android:name=".SampleAlarmReceiver"/>
<activity
android:name=".SplashActivity"
android:configChanges="orientation|screenSize"
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=".WebviewActivity"
android:configChanges="orientation|screenSize"
android:label="#string/title_activity_webview" >
</activity>
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
</activity>
</application>
When I click with Ctrl on
<uses-permission android:name="com.android.vending.CHECK_LICENSE" />
Android Studio can't find that library... and the others show as well...
What am I doing wrong? =/

Error: No resource found that matches the given name (at 'icon' with value '#drawable/ ic_launcher')

I am completely new to Android and have been trying to launch a maps example from the SDK, however, my google play service library when added to workspace gives error in the manifest.xml file. MainActivity>AndroidManifest.xml
I tried changing the properties to Google API 15 and also edited the xml file but it still doesn't work. Any help would be useful, thanks!
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mapdemo" android:versionCode="8"
android:versionName="4.0.3">
<!-- Copied from Google Maps Library/AndroidManifest.xml. -->
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- External storage for caching. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- My Location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Maps API needs OpenGL ES 2.0. -->
<uses-feature android:glEsVersion="0x00020000"
android:required="true" />
<!-- End of copy. -->
<application android:icon="#drawable/ic_launcher" <!--Error: No resource found that matches the given name (at 'icon' with value '#drawable/ic_launcher')-->
android:label="#string/demo_title" android:hardwareAccelerated="true"> <!--Error: No resource found that matches the given name (at 'label' with value '#string/basic_map_demo_label')
-->
<!-- ** You need to replace the key below with your own key. ** The example
key below will not be accepted because it is not linked to the certificate
which you will use to sign this application. See: https://developers.google.com/maps/documentation/android/start
for instructions on how to get your own key. -->
<meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="i_enter_my_key_here" />
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LegalInfoActivity" android:label="#string/legal_info" />
<activity android:name=".BasicMapDemoActivity" android:label="#string/basic_map_demo_label" />
<activity android:name=".CameraDemoActivity" android:label="#string/camera_demo_label" />
<activity android:name=".CircleDemoActivity" android:label="#string/circle_demo_label" />
<activity android:name=".EventsDemoActivity" android:label="#string/events_demo_label" />
<activity android:name=".GroundOverlayDemoActivity"
android:label="#string/ground_overlay_demo_label" />
<activity android:name=".IndoorDemoActivity" android:label="#string/indoor_demo_label" />
<activity android:name=".LayersDemoActivity" android:label="#string/layers_demo_label" />
<activity android:name=".LocationSourceDemoActivity"
android:label="#string/location_source_demo_label" />
<activity android:name=".MapInPagerDemoActivity"
android:label="#string/map_in_pager_demo_label" />
<activity android:name=".MarkerDemoActivity" android:label="#string/marker_demo_label" />
<activity android:name=".MultiMapDemoActivity" android:label="#string/multi_map_demo_label" />
<activity android:name=".MyLocationDemoActivity"
android:label="#string/my_location_demo_label" />
<activity android:name=".OptionsDemoActivity" android:label="#string/options_demo_label" />
<activity android:name=".PolygonDemoActivity" android:label="#string/polygon_demo_label" />
<activity android:name=".PolylineDemoActivity" android:label="#string/polyline_demo_label" />
<activity android:name=".ProgrammaticDemoActivity"
android:label="#string/programmatic_demo_label" />
<activity android:name=".RawMapViewDemoActivity"
android:label="#string/raw_map_view_demo_label" />
<activity android:name=".RetainMapDemoActivity"
android:label="#string/retain_map_demo_label" />
<activity android:name=".SaveStateDemoActivity"
android:label="#string/save_state_demo_label" />
<activity android:name=".SnapshotDemoActivity" android:label="#string/snapshot_demo_label" />
<activity android:name=".SplitStreetViewPanoramaAndMapDemoActivity"
android:label="#string/split_street_view_panorama_and_map_demo_label" />
<activity android:name=".StreetViewPanoramaBasicDemoActivity"
android:label="#string/street_view_panorama_basic_demo_label" />
<activity android:name=".StreetViewPanoramaEventsDemoActivity"
android:label="#string/street_view_panorama_events_demo_label" />
<activity android:name=".StreetViewPanoramaNavigationDemoActivity"
android:label="#string/street_view_panorama_navigation_demo_label" />
<activity android:name=".StreetViewPanoramaOptionsDemoActivity"
android:label="#string/street_view_panorama_options_demo_label" />
<activity android:name=".StreetViewPanoramaViewDemoActivity"
android:label="#string/street_view_panorama_view_demo_label" />
<activity android:name=".TileCoordinate`enter code here`DemoActivity"
android:label="#string/tile_coordinate_demo_label" />
<activity android:name=".TileOverlayDemoActivity"
android:label="#string/tile_overlay_demo_label" />
<activity android:name=".UiSettingsDemoActivity"
android:label="#string/ui_settings_demo_label" />
<activity android:name=".VisibleRegionDemoActivity"
android:label="#string/visible_region_demo_label" />
</application>
</manifest>
Make sure you have a file called ic_launcher in the res/drawable directory. This is usually a png that follows the requirements at Android Iconography. For learning purposes you can just have the ic_launcher in the drawable directory (that you may have to add to your project) with a single icon inside. Later when you get to your actual project you may want different icon sizes as per the specs.
Also make sure you have a string named demo_title in a resource file somewhere. Usually there is a file called, for example "strings.xml" in the res/values directory and inside there is a string declaration:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="demo_title">This is my Demo</string>
</resources>

Android Studio "applications have the same package name"

My application in Android Studio has separate components for mobile devices and for Google Glasses. When I attempt to load the mobile version onto a Nexus 10 (Android version 4.4.2) I get the following error:
Applications have the same package name com.example.carterpedersen.datatransfer:
mobile, glass
I can, however, load the app onto a glass device (XE19.1) with no problem.
I find this error perplexing because my app has been running with no problem for several weeks, and all of a sudden the mobile component is crippled. I did recently add a dependency on the glass R to the mobile component, but even this was a few days before this error showed itself.
I tried refactoring the mobile directory, as well as the whole package, with no success.
I have searched SO and other sources but I didn't find any duplicates; please link me if I am wrong on this point. Thanks for the help. Provided manifests are below.
Mobile manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.carterpedersen.datatransfer" >
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.carterpedersen.datatransfer.FileRetrieval"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.example.carterpedersen.datatransfer.BluetoothClient"
android:label="#string/title_activity_bluetooth_client" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Glass Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.carterpedersen.datatransfer" >
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.carterpedersen.datatransfer.LauncherActivity"
android:label="#string/title_activity_launcher" >
</activity>
<activity
android:name="com.example.carterpedersen.datatransfer.LiveCardMenuActivity"
android:theme="#style/MenuTheme" >
</activity>
<!-- Service responsible for maintaining LiveCard -->
<service
android:name="com.example.carterpedersen.datatransfer.LiveCardDataCollect"
android:icon="#drawable/ic_glass_logo"
android:label="#string/title_activity_live_card_data_collect" >
<intent-filter>
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="#xml/voice_trigger" />
</service>
<!-- For content sharing permissions -->
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.example.carterpedersen.datatransfer.fileprovider"
android:exported="false"
android:grantUriPermissions="true" >
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/file_paths" />
</provider>
<!-- Selects file for sharing to client. -->
<activity
android:name="com.example.carterpedersen.datatransfer.FileShareActivity"
android:label="#string/title_activity_file_share" >
<intent-filter>
<action android:name="android.intent.action.PICK" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.OPENABLE" />
<data android:mimeType="*/*" />
</intent-filter>
</activity>
<activity
android:name="com.example.carterpedersen.datatransfer.BluetoothHost"
android:label="#string/title_activity_bluetooth_host" >
</activity>
<receiver android:name="com.example.carterpedersen.datatransfer.BluetoothHost$HostBroadRec" >
<intent-filter>
<action android:name="transapps.g6.new.alert" />
</intent-filter>
</receiver>
</application>
Try using just one manifest (combined for use on both mobile and Glass - I'm assuming one apk correct?)
Just close completely the android studio and reopen it. My problem solved after this.
By the way you can try this command on cmd:
adb uninstall com.your.package
Try changing the package name in each of the AndroidManifest.xml files. So, for example, change to:
Mobile
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.carterpedersen.mobile.datatransfer" >
Glass
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.carterpedersen.glass.datatransfer" >
The package name should be unique amongst applications. Refer to the package attribute definition.

"Application not installed" error and API levels

I've developed my first Android app, and have successfully deployed it to my Galaxy S4. The app was developed for API level 19.
When I tried to install it on an older phone (HTC Desire, running Android 2.3) I got an error saying that the apk could not be parsed. I guessed that this was because the API level for the app was 19, so revised this in my Android manifest to API level 9, regenerated the APK, then tried installing it on the HTC again. This time it tried to install the app, advised me of the permissions being requested, but then gave the error message "Application not installed"
Can anyone suggest what my options are from here? My Android manifest is below.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ian.mealtimer"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="9" />
<application
android:name="com.ian.mealtimer.MealTimerApplication"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.ian.mealtimer.MainActivity"
android:label="#string/app_name"
android:launchMode="singleTask" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.ian.mealtimer.PresetItemsActivity"
android:label="#string/preset_item" >
</activity>
<activity
android:name="com.ian.mealtimer.MealActivity"
android:label="#string/title_activity_meal" >
<!-- android:parentActivityName="com.ian.mealtimer.MainActivity" > -->
<!-- <meta-data -->
<!-- android:name="android.support.PARENT_ACTIVITY" -->
<!-- android:value="com.ian.mealtimer.MainActivity" /> -->
</activity>
<activity
android:name="com.ian.mealtimer.MealItemActivity"
android:label="#string/title_activity_meal_item" >
android:parentActivityName="com.ian.mealtimer.MealActivity" >
<!-- <meta-data -->
<!-- android:name="android.support.PARENT_ACTIVITY" -->
<!-- android:value="com.ian.mealtimer.MealActivity" /> -->
</activity>
<activity
android:name="com.ian.mealtimer.MealItemDetailActivity"
android:label="#string/title_activity_meal_item_detail"
android:parentActivityName="com.ian.mealtimer.MealItemActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.ian.mealtimer.MealItemActivity" />
</activity>
<activity
android:name="com.ian.mealtimer.SelectPresetItemActivity"
android:label="#string/title_activity_select_preset_item" >
</activity>
<activity
android:name="com.ian.mealtimer.SavedMealsActivity"
android:label="#string/title_activity_saved_meals" >
</activity>
<activity
android:name="com.ian.mealtimer.SetMealTimersActivity"
android:label="#string/title_activity_set_meal_timers"
android:parentActivityName="com.ian.mealtimer.MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.ian.mealtimer.MainActivity" />
</activity>
<receiver android:name=".AlarmReceiver" >
</receiver>
</application>
<permission
android:name="android.permission.STATUS_BAR_SERVICE"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" >
</uses-permission>
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" >
</uses-permission>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" >
</uses-permission>
</manifest>
The Application not installed occurs when there is a conflict with the old installed app with the new installed app. First of all you installed it first with the api as 19 then installed it again with api as 9 with out uninstalling it first.
solution:
Uninstalled the app first then use the android:minSdkVersion="9" in the manifest
`

Android: My app supports 0 devices

You know, I'm really disappointed right now. I spent the last 5 months making this app, from design to coding a..z and now I'm this close: my app supports 0 devices.
Then I spent almost 24 hours already trying to figure out what the heck is going on and still couldn't get it working. I need help.
p.s: The "Localizations: default+49 languages" field: in my app I only have English with the default values/strings.xml but I don't mind users in other languages on their phone will see my app in English.
UPDATE: Found and added my clarified answer, however the accepted answer got me going the right way. So thank you.
Here is what I got:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="xxxxxxxxxxx"
android:versionCode="2"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.CAMERA" />
<uses-feature android:name="android.hardware.camera.AUTOFOCUS" />
<application
android:hardwareAccelerated="true"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/Holo.Theme"
android:name="org.holoeverywhere.app.Application">
<!-- Blank Activity -->
<activity
android:name=".BlankActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Access Activity -->
<activity
android:name=".AccessActivity"
android:label="#string/title_activity_access"
android:screenOrientation="portrait">
</activity>
<!-- Register Activity -->
<activity
android:name=".RegisterActivity"
android:screenOrientation="portrait"
android:label="#string/lbActRegister">
</activity>
<!-- Login Activity -->
<activity
android:name=".LoginActivity"
android:screenOrientation="portrait"
android:label="#string/lbActLogin">
</activity>
<!-- Recovery Activity -->
<activity
android:name=".RecoveryActivity"
android:screenOrientation="portrait"
android:label="#string/lbActRecovery">
</activity>
<!-- Dashboard Activity -->
<activity
android:name=".DashboardActivity"
android:label="#string/app_name"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden|screenSize">
</activity>
<!-- Edit Profile Activity -->
<activity
android:name=".EditProfileActivity"
android:screenOrientation="portrait"
android:label="#string/lbActEditProfile">
</activity>
<!-- Feedback Activity -->
<activity
android:name=".FeedbackActivity"
android:screenOrientation="portrait"
android:label="#string/lbActFeedback">
</activity>
<!-- TOSU Activity -->
<activity
android:name=".TOSUActivity"
android:screenOrientation="portrait"
android:label="#string/lbActTerms">
</activity>
<!-- About Activity -->
<activity
android:name=".AboutActivity"
android:screenOrientation="portrait"
android:label="#string/lbActAbout">
</activity>
<!-- Donation Activity -->
<activity
android:name=".DonationActivity"
android:screenOrientation="portrait"
android:label="#string/lbActDonation">
</activity>
<!-- Image Upload Activity -->
<activity
android:name=".photo.ImageUploadActivity"
android:screenOrientation="portrait"
android:label="#string/lbActUpload"
android:configChanges="orientation|keyboardHidden|screenSize">
</activity>
<!-- Me Detail Activity -->
<activity
android:name=".photo.MeDetailActivity"
android:label="#string/lbActCollection"
android:parentActivityName=".DashboardActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value=".DashboardActivity" />
</activity>
<!-- Explore Detail Activity -->
<activity
android:name=".photo.ExploreDetailActivity"
android:label="#string/lbActExplore"
android:parentActivityName=".DashboardActivity"
android:uiOptions="splitActionBarWhenNarrow"
android:configChanges="orientation|keyboardHidden|screenSize">
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value=".DashboardActivity" />
</activity>
<!-- Liked Detail Activity -->
<activity
android:name=".photo.LikedDetailActivity"
android:label="#string/lbActLikes"
android:parentActivityName=".DashboardActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value=".DashboardActivity" />
</activity>
</application>
</manifest>
Try to change android.hardware.CAMERA with android.hardware.camera. Then
For any of the permissions below, you can disable filtering based on
the implied feature by explicitly declaring the implied feature
explicitly, in a element, with an
android:required="false" attribute.
And according to the permissions features, you didn't add the feature android.hardware.camera.autofocus.
So add this feature or change your camera permission with :
<uses-feature android:name="android.hardware.camera" android:required="false" />
Hope it works :)

Categories

Resources