Error when installing android application - android

I trying to use C2DM in my android application, but after I added it I can't install the application. I get this error "Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED". But I can't see whats wrong.
Anyone that know what I have done wrong?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="Wordy.Game"
android:versionCode="1"
android:versionName="0.1"
android:installLocation="preferExternal">
<uses-sdk android:minSdkVersion="8" />
<permission
android:name="Wordy.Game.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission
android:name="Wordy.Game.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<application android:label="#string/app_name" android:icon="#drawable/wordy">
<activity android:name="Main"
android:label="#string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver
android:name=".C2DMRegistrationReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter >
<action android:name="com.google.android.c2dm.intent.REGISTRATION" >
</action>
<category android:name="Wordy.Game" />
</intent-filter>
</receiver>
<receiver
android:name=".C2DMRegistrationReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter >
<action android:name="com.google.android.c2dm.intent.RECEIVE" >
</action>
<category android:name="Wordy.Game" />
</intent-filter>
</receiver>
<activity android:name="Result" android:label="#string/app_name" android:screenOrientation="portrait" />
<activity android:name="PlayField" android:label="#string/app_name" android:screenOrientation="portrait" />
<activity android:name="Game" android:label="#string/app_name" android:screenOrientation="portrait" />
<activity android:name="News" android:label="#string/app_name" android:screenOrientation="portrait" />
<activity android:name="PlayOnline" android:label="#string/app_name" android:screenOrientation="portrait" />
<activity android:name="UsersOnline" android:label="#string/app_name" android:screenOrientation="portrait" />
</application>
</manifest>

I finally found whats wrong, the package name on the application was not allowed to start with capital letter.

try prefixing your activityies with a . or the full package name:
<activity android:name="com.gizm0.YourClass"></activvity>
or
<activity android:name=".YourClass"></activvity>

Related

ERROR in android studio of Multiple entries with same key

ERROR: Multiple entries with same key: android:appComponentFactory=REPLACE and android:appComponentFactory=REPLACE
this error comes when i try to sync the gradle.
this error is after i updated android studio to latest version
here is mainfest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.hoogle.news">
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application
android:icon="#mipmap/ic_app"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_app_round"
android:supportsRtl="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="#style/Theme.AppCompat.NoActionBar"
tools:replace="android:appComponentFactory,android:appComponentFactory,android:appComponentFactory">
<activity
android:name=".FullscreenActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="#string/app_name"
android:theme="#style/FullscreenTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".isNetworkAvailable"
android:label="#string/app_name"
android:theme="#style/Theme.AppCompat.Light.NoActionBar.FullScreen">
<intent-filter>
<action android:name="android.net.wifi.WIFI_STATE_CHANGED" />
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="#style/Theme.AppCompat.Light.NoActionBar.FullScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
</application>
</manifest>
just delete this line under application to solve multiple error entries and merged mainfest error
tools:replace="android:appComponentFactory,android:appComponentFactory,android:appComponentFactory">

Supported devices is 0-Google play

Manifest:
This was working fine before some time. Now it shows 0-supported devices!
Please help me on this.
Shows these features on console though I am not using it.
android.hardware.screen.PORTRAIT
android.hardware.TOUCHSCREEN
android.hardware.WIFI
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app.irb.wallpro"
android:versionCode="5"
android:versionName="1.0.5" >
<uses-sdk
android:minSdkVersion="8"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<!-- Include next permission if you want to allow UIL to cache images on SD card -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<application
android:name="com.irbrothers.wallpro.ui.WallProApplication"
android:allowBackup="true"
android:icon="#drawable/app_icon"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.irbrothers.wallpro.ui.SplashActivity"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.irbrothers.wallpro.ui.PropertiesActivity"
android:configChanges="orientation"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.irbrothers.wallpro.ui.HomeActivity"
android:configChanges="orientation|screenSize"
android:launchMode="singleTask" >
</activity>
<activity
android:name="com.irbrothers.wallpro.ui.EULA"
android:configChanges="orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.irbrothers.wallpro.ui.AboutActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="adjustPan" >
</activity>
<activity
android:name="com.startapp.android.publish.list3d.List3DActivity"
android:taskAffinity="com.app.irbrothers.wallpro.AppWall"
android:theme="#android:style/Theme" />
<activity
android:name="com.startapp.android.publish.AppWallActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:taskAffinity="com.app.irbrothers.wallpro.AppWall"
android:theme="#android:style/Theme.Translucent" />
<service android:name="com.irbrothers.wallpro.alarm.NotificationService" />
<receiver android:name="com.irbrothers.wallpro.recievers.NotificationAlarmReciever" >
<intent-filter>
<action android:name="com.irbrothers.notification" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.DATE_CHANGED" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.TIMEZONE_CHANGED" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.TIME_SET" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.TIME_TICK" />
</intent-filter>
</receiver>
</application>
</manifest>
Solved
Do not use any library which is already present in framework. Ex: "json-simple" here.

How do i declare my Activity as Launcher?

I am trying to build a kind of custom lockscreen.
In order to achieve that I need to disable the HOME button.
From this post I understand that I can achieve that by declaring my Activity as a Launcher.
Please how do I do that? (it is in the Manifest obviously)
This is the Manifest.
The Activity that "acts" as a lockscreen is LockScreen
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.appengine.paranoid_android.lost"
android:versionCode="2"
android:versionName="1.1" >
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".InfoSetup"
android:clearTaskOnLaunch="true"
android:label="#string/activity_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=".LockScreen"
android:clearTaskOnLaunch="true"
android:label="#string/activity_name"
android:launchMode="singleInstance"
android:theme="#android:style/Theme.NoTitleBar" >
<service
android:name=".InfoService"
android:label="#string/service_name" />
<receiver android:name="com.appengine.paranoid_android.lost.BootCompleteReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
<action android:name="android.intent.action.PACKAGE_CHANGED" />
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<data android:scheme="package" />
</intent-filter>
</receiver>
</activity>
</application>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<!-- <uses-permission android:name="android.permission.DISABLE_KEYGUARD"/> -->
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" >
</uses-sdk>
Move the intent filter to your activity
<activity
android:name=".LockScreen"
android:clearTaskOnLaunch="true"
android:label="#string/activity_name"
android:launchMode="singleInstance"
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>

How do I properly specify my starting activity in the android manifest?

This is my android manifest and for some reason my MainActivity does not start first. The activity that starts first whenever I run the application is RegisterActivity. Can anyone help me figure out why?
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.indigohate"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<permission
android:name="com.indigohate.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.indigohate.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<service android:name="com.indigohate.GCMIntentService" />
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.indigohate" />
</intent-filter>
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.indigohate" />
</intent-filter>
</receiver>
<activity
android:name="com.indigohate.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="com.indigohate.RegisterActivity"
android:launchMode="singleTop" />
<activity
android:name="com.indigohate.UserRegister"
android:launchMode="singleTop" />
<activity
android:name="com.indigohate.LoginActivity"
android:launchMode="singleTop" >
</activity>
<activity
android:name="com.indigohate.RideRequest"
android:label="#string/title_activity_ride_request" >
</activity>
<activity
android:name="com.indigohate.TimePickerFragment"
android:label="#string/title_activity_time_picker_fragment" >
</activity>
<activity
android:name="com.indigohate.SearchResultsListActivity"
android:launchMode="singleTop" />
<activity
android:name="com.indigohate.LoadingScreenActivity"
android:label="#string/title_activity_loading_screen" >
</activity>
<activity
android:name="com.indigohate.HomeActivity"
android:label="#string/title_activity_home" >
</activity>
<activity
android:name="com.indigohate.LostPasswordActivity"
android:label="#string/title_activity_lost_password" >
</activity>
<activity
android:name="com.indigohate.RideOfferActivity"
android:label="#string/title_activity_ride_offer" >
</activity>
<activity
android:name="com.indigohate.StartRideActivity"
android:label="#string/title_activity_start_ride" >
</activity>
<activity
android:name="com.indigohate.StopRideActivity"
android:label="#string/title_activity_stop_ride" >
</activity>
<activity
android:name="com.indigohate.CalendarActivity"
android:label="#string/title_activity_calendar" >
</activity>
<activity
android:name="com.indigohate.ProfileActivity"
android:label="#string/title_activity_profile" >
</activity>
<activity
android:name="com.indigohate.MakeCommentActivity"
android:label="#string/title_activity_make_comment" >
</activity>
<activity
android:name="com.indigohate.PaymentInformationActivity"
android:label="#string/title_activity_payment_information" >
</activity>
<activity
android:name="com.indigohate.RideHistoryActivity"
android:label="#string/title_activity_ride_history" >
</activity>
</application>
</manifest>
It's because you kept this attribute in your RegisterActivity
android:launchMode="singleTop"
Remove all these launchmodes in all activities. Keep it only in your MainActivity:
<activity
android:name="com.indigohate.MainActivity"
android:label="#string/app_name"
android:launchMode="singleTop"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
The starting activity contains <category android:name="android.intent.category.LAUNCHER" /> to ensure that it's a launcher activity when an app starts.

The <activity> element must be a direct child of the <application> element

I just wanted to launch my application, but it always fails and gives me this error. Before, it would just install the .apk file, but now it just fails to start at all. I just began and was following the Android Developing tutorial.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.myfirstapp.MainActivity"
android:label="#string/app_name" >
<activity
android:name="com.example.myfirstapp.DisplayMessageActivity"
android:label="#string/title_activity_display_message"
android:parentActivityName="com.example.myfirstapp.MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.myfirstapp.MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</meta-data>
</activity>
</activity>
</application>
</manifest>
You can't have nested activity tags inside your Manifest, fix this issue and it should work.
YES - for example:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="3" />
<uses-permission android:name="android.permission.SET_WALLPAPER"></uses-permission>
<uses-permission android:name="android.permission.VIBRATE"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-feature android:name="android.hardware.camera" />
<application
android:icon="#drawable/icon" android:label="#string/app_name">
<!-- Boot window -->
<activity
android:name=".ServicesDemo" android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Second window -->
<activity android:name=".MainActivity" android:label="#string/app_name"
android:parentActivityName=".ServicesDemo" />
<!-- Second window -->
<activity android:name=".MyWall" android:label="#string/app_name"
android:parentActivityName=".ServicesDemo" />
<!-- Second window -->
<activity android:name=".MyRotations" android:label="#string/app_name"
android:parentActivityName=".ServicesDemo" />
<!-- Second window -->
<activity android:name=".MySetting" android:label="#string/app_name"
android:parentActivityName=".ServicesDemo" />
<receiver
android:enabled="true"
android:name=".IntentReceiver"
android:permission="android.permission.RECEIVE_BOOT_COMPLETED"
>
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
<action android:name="android.intent.action.HEADSET_PLUG" />
<action android:name="android.intent.action.SCREEN_ON" />
<action android:name="android.intent.action.SCREEN_OFF" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<service android:enabled="true" android:name=".MyService" />
<service android:enabled="true" android:name=".MyNewpic" />
</application>
</manifest>
You don't nest Activities in other Activities. This is how it should look like:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.myfirstapp.MainActivity"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.example.myfirstapp.DisplayMessageActivity"
android:label="#string/title_activity_display_message"
android:parentActivityName="com.example.myfirstapp.MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.myfirstapp.MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</meta-data>
</activity>
</application>
</manifest>
Do read the Android docs for the AndroidManifest.xml file

Categories

Resources