Android Error: Default Activity not found - android

I have a launcher activity but android studio says "Default activity not found". This started after I added a login activity which I wanted it to be the launcher activity (meant for when the user signs up only). So I would like the Main activity to be the launcher activity once the user installs my app and provide their credentials. Your help is much appreciated.
This is my manifest with both my login and main activities.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="mypackage"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="22" />
<library />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.BATTERY_STATS"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.WRITE_SMS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="mypackage.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="otherpackage.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<permission
android:name="mypackage.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<permission
android:name="com.google.android.c2dm.permission.RECEIVE"></permission>
<permission
android:name="otherpackage.permission.C2D_MESSAGE"
android:protectionLevel="signature"></permission>
<application
android:allowBackup="true"
android:icon="#drawable/image"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="key"/>
<Activity
android:name=".Login"
android:label="REGISTER"
android:noHistory="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</Activity>
<Activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</Activity>
<Activity
android:name=".MapActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAPACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</Activity>
<!--<activity
android:name=".MyMapActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MYMAPACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>-->
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!--Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!--this is to support pre KitKat -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="mypackage" />
<category android:name="otherpackage" />
</intent-filter>
</receiver>
<receiver android:name=".MapActivity$ResponseReceiver">
<intent-filter>
<action android:name="mypackage.MapActivity.ResponseReceiver.ACTION_RESP" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<service
android:name=".MapActivity$MyGcmListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service
android:name=".Login$MyInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
<service android:name="mypackage.RegistrationIntentService"></service>
<service
android:name=".FetchAddressIntentService"
android:exported="false"/>
</application>
</manifest>
This is the main activity.
public class MainActivity extends MapActivity {
#Override
public void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
new Handler().postDelayed(new Runnable() {
#Override
public void run() {
Intent i = new Intent(MainActivity.this, MapActivity.class);
startActivity(i);
}
}, 8000);
}
}
N.B The main activity extends my MapActivity, which extends FragmentActivity. It is starnge but I found this in logcat. I haven't implemented iheartradio library or anything. "Caused by: java.lang.ClassNotFoundException: com.clearchannel.iheartradio.alarm.LiveDeltaUpdateService"

change Activity to activity in manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="mypackage"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="22" />
<library />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.BATTERY_STATS"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.WRITE_SMS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="mypackage.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="otherpackage.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<permission
android:name="mypackage.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<permission
android:name="com.google.android.c2dm.permission.RECEIVE"></permission>
<permission
android:name="otherpackage.permission.C2D_MESSAGE"
android:protectionLevel="signature"></permission>
<application
android:allowBackup="true"
android:icon="#drawable/image"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="key"/>
<activity
android:name=".Login"
android:label="REGISTER"
android:noHistory="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".MapActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAPACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!--<activity
android:name=".MyMapActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MYMAPACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>-->
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!--Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!--this is to support pre KitKat -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="mypackage" />
<category android:name="otherpackage" />
</intent-filter>
</receiver>
<receiver android:name=".MapActivity$ResponseReceiver">
<intent-filter>
<action android:name="mypackage.MapActivity.ResponseReceiver.ACTION_RESP" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<service
android:name=".MapActivity$MyGcmListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service
android:name=".Login$MyInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
<service android:name="mypackage.RegistrationIntentService"></service>
<service
android:name=".FetchAddressIntentService"
android:exported="false"/>
</application>
</manifest>

You have a typo. <activity>, not <Activity>

A full AndroidManifest must contain the tag and the inside it.
You must declare the Activity with its fully qualified class name, and the package declaration can be ommited with a dot (.) if the Activity is inside the package of the application (declared at manifest.package attribute)
Such:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="br.com."
android:versionCode="1"
android:versionName="2.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="11" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_OWNER_DATA" />
<uses-permission android:name="android.permission.READ_OWNER_DATA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="false"
android:xlargeScreens="true" />
<application
android:name=".BvApplication"
android:hardwareAccelerated="true"
android:largeHeap="true"
android:icon="#drawable/icon"
android:label="#string/app_name" >
<activity
android:name=".BvNewsstandActivity"
android:launchMode="singleTop"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" >
</activity>
<activity
android:name=".LoginActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="br.com.digitalpages.reader.activity.HelpActivity"
android:theme="#style/Transp" />
<activity
android:name="br.com.digitalpages.reader.ReaderActivity"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" />
<activity
android:name="br.com.digitalpages.commons.activity.LoadingActivity"
android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity
android:name="br.com.digitalpages.commons.activity.WebActivity"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" />
</application>
PS: You MUST read the stack trace generated from the error while running the application, you can use the logcat window at Eclipse or Android Studio or the Android Device Monitor included in the Android SDK installation.

You can try this:
File->Invalidate Caches->Restart

Simply deleting the .gradle folder in C://Users/username did it for me. Invalidating caches etc didn't.

Related

GCM push notification not working in Android App

Push notification not working in my app.
When I send push notification it show message as below:
GCM HTTP status: 200
GCM response body: {"multicast_id":5052582973644051315,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"NotRegistered"}]}
My menifest code is as below:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.scryp">
<permission
android:name="com.scryp.permission.MAPS_RECEIVE"
android:protectionLevel="signature"></permission>
<uses-permission android:name="com.skryp.permission.MAPS_RECEIVE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="com.example.gcm.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.gcm.permission.C2D_MESSAGE" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:name=".activities.SkrypApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity
android:name="com.scryp.activities.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>
<service
android:name="com.scryp.activities.PushNotificationService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.scryp.activities" />
</intent-filter>
</receiver>
<activity
android:name="com.scryp.activities.LoginActivity"
android:label="#string/title_activity_login"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="com.scryp.activities.SignupActivity"
android:label="#string/title_activity_signup"
android:screenOrientation="portrait" />
<activity
android:name="com.scryp.activities.ForgotPasswordActivity"
android:label="#string/title_activity_forgot_password"
android:screenOrientation="portrait" />
<activity
android:name="com.scryp.activities.ProfileActivity"
android:label="#string/title_activity_profile"
android:screenOrientation="portrait" />
<activity
android:name="com.scryp.activities.CouponActivity"
android:label="#string/title_activity_coupon"
android:screenOrientation="portrait" />
<activity
android:name="com.scryp.activities.HomeActivity"
android:label="#string/title_activity_home"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan" />
<activity
android:name="com.scryp.activities.CouponDetailActivity"
android:screenOrientation="portrait"></activity>
<activity
android:name="com.scryp.activities.DownloadCouponActivity"
android:screenOrientation="portrait"></activity>
<activity
android:name="com.scryp.activities.TutorialActivity"
android:screenOrientation="portrait"></activity>
<activity android:name="com.facebook.FacebookActivity" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyB4rU0s2yS-3RGu5GQOb_L_JG6_H5toy60" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
</application>
</manifest>
<permission android:name="com.example.gcm.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.gcm.permission.C2D_MESSAGE" />
Change com.example.gcm to com.scryp:

Google Play Store - Find out why a device is incompatible

I published an android app in google playstore. Some clients complain about not being able to download the app as the play stores says it is "not compatible".
In google developer console, I can only see THAT a device is not supported. I want to know WHY a device is incompatible but that information is hidden from me.
Google has to have this information to determine compatibility, why is there no way to show this information to developers? Or am I wrong?
We'd really appreciate that feature, it is vital I think.
One device that fails, is for example: medion lifetab e10315
http://www.amazon.de/Medion-LIFETAB-Tablet-PC-Android-schwarz/dp/B00HA4M91W
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.example.changed.android2"
android:installLocation="auto"
android:versionCode="1"
android:versionName="xxx" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="18" />
<!-- Only this application can receive the messages and registration result -->
<permission
android:name="de.example.changed.android2.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<permission
android:name="de.example.changed.android2.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<!-- Required permission to check licensing. -->
<uses-permission android:name="com.android.vending.CHECK_LICENSE" />
<uses-permission android:name="de.example.changed.android2.permission.MAPS_RECEIVE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="de.example.changed.android2.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!--in app paying-->
<uses-permission android:name="com.android.vending.BILLING" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" >
</supports-screens>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false" />
<uses-feature
android:name="android.hardware.telephony"
android:required="false" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="false" />
<!-- suppress AndroidDomInspection -->
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:label="Tests for xxx"
android:targetPackage="de.example.changed.android2" />
<android:uses-permission android:name="android.permission.READ_PHONE_STATE" />
<application
android:name=".xxxApp"
android:allowBackup="false"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/Theme.xxx" >
<uses-library android:name="com.google.android.maps" />
<uses-library android:name="android.test.runner" />
<receiver
android:name=".services.C2DMReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="de.example.changed.android" />
</intent-filter>
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="de.example.changed.android" />
</intent-filter>
</receiver>
<receiver android:name=".services.NetworkChangeReceiver" >
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
</intent-filter>
</receiver>
<receiver android:name=".services.SMSReceiver" >
<intent-filter android:priority="9999" >
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
<activity
android:name=".ui.RegistrationActivity"
android:label="#string/app_name" >
</activity>
<activity
android:name=".ui.MapActivity"
android:configChanges="orientation|screenSize|keyboardHidden" />
<activity
android:name=".ui.SettingsActivity"
android:configChanges="orientation|screenSize" />
<activity
android:name=".ui.GroupsEdit"
android:parentActivityName=".ui.GroupsList" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="de.example.changed.android2.ui.GroupsList" />
</activity>
<activity
android:name=".ui.GroupsList"
android:parentActivityName=".ui.AlertListActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="de.example.changed.android2.ui.AlertListActivity" />
</activity>
<activity
android:name=".ui.AlertListActivity"
android:exported="true" />
<activity android:name=".ui.HelpActivity" />
<activity
android:name=".ui.AlertDetailActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:parentActivityName=".ui.AlertListActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="de.example.changed.android2.ui.AlertListActivity" />
</activity>
<activity
android:name=".ui.AlertPopupActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:noHistory="true" >
</activity>
<activity
android:name=".services.helper.test.EncryptionTest"
android:label="#string/title_activity_encryption_test" >
</activity>
<activity
android:name=".services.helper.test.EncryptionClientTest"
android:label="#string/title_activity_encryption_client_test" >
</activity>
<activity
android:name=".ui.BlockedAlertListActivity"
android:label="#string/title_activity_blocked_alert_list" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="de.example.changed.android2.ui.AlertListActivity" />
</activity>
<activity
android:name=".ui.StartActivity"
android:label="#string/app_name"
android:noHistory="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.FeedbackCustomTextActivity"
android:windowSoftInputMode="stateUnchanged" />
<!-- Widgets -->
<receiver
android:name=".ui.Widget"
android:label="#string/widget_title" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<intent-filter>
<action android:name="de.example.changed.android2.ui.Widget.WIDGET_CLICK" />
</intent-filter>
<intent-filter>
<action android:name="de.example.changed.android2.ui.Widget.WIDGET_UPDATE_UI" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/widget_provider" />
</receiver>
<!-- Services -->
<!-- Provider -->
<provider
android:name=".provider.FilterProvider"
android:authorities="de.example.changed" >
</provider>
<activity android:name=".ui.FeedbackOverviewActivity" >
</activity>
<activity
android:name=".ui.ProfileListActivity"
android:label="#string/title_activity_profile_list"
android:parentActivityName=".ui.GroupsList" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="de.example.changed.android2.ui.GroupsList" />
</activity>
<activity
android:name=".ui.ProfileEditActivity"
android:label="#string/title_activity_profile_edit" >
</activity>
<activity
android:name=".billing.BillingActivity"
android:label="#string/title_activity_billing" >
</activity>
</application>
</manifest>
remove android:targetSdkVersion="18"

Parse Push error "Cannot use GCM for push..." - Android

I am attempting to set up push notifications for my application. I have followed the appropriate quickstart guide and the tutorial and have, as far as I can tell, set everything up correctly, but when I run the app I get the following LogCat error:
E/com.parse.ManifestInfo(17775): Cannot use GCM for push because the app manifest is missing some required declarations. Please make sure that these permissions are declared as children of the root <manifest> element:
E/com.parse.ManifestInfo(17775): <uses-permission android:name="android.permission.INTERNET" />
E/com.parse.ManifestInfo(17775): <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
E/com.parse.ManifestInfo(17775): <uses-permission android:name="android.permission.VIBRATE" />
E/com.parse.ManifestInfo(17775): <uses-permission android:name="android.permission.WAKE_LOCK" />
E/com.parse.ManifestInfo(17775): <uses-permission android:name="android.permission.GET_ACCOUNTS" />
E/com.parse.ManifestInfo(17775): <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
E/com.parse.ManifestInfo(17775): <permission android:name="com.example.myapp.permission.C2D_MESSAGE" android:protectionLevel="signature" />
E/com.parse.ManifestInfo(17775): <uses-permission android:name="com.example.myapp.permission.C2D_MESSAGE" />
E/com.parse.ManifestInfo(17775): Also, please make sure that these services and broadcast receivers are declared as children of the <application> element:
E/com.parse.ManifestInfo(17775): <service android:name="com.parse.PushService" />
E/com.parse.ManifestInfo(17775): <receiver android:name="com.parse.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
E/com.parse.ManifestInfo(17775): <intent-filter>
E/com.parse.ManifestInfo(17775): <action android:name="com.google.android.c2dm.intent.RECEIVE" />
E/com.parse.ManifestInfo(17775): <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
E/com.parse.ManifestInfo(17775): <category android:name="com.example.myapp" />
E/com.parse.ManifestInfo(17775): </intent-filter>
E/com.parse.ManifestInfo(17775): </receiver>
Here's the relevant excerpt from my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<permission android:name="com.example.myapp.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.myapp.permission.C2D_MESSAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<!-- activities excluded to be concise -->
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.example.myapp" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.ParsePushBroadcastReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.parsePushBroadcastReceiver"
android:exported="false" >
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
<meta-data
android:name="com.parse.push.notification_icon"
android:resource="#drawable/push_icon" />
</application>
</manifest>
I've double and triple checked and it seems like I have everything that the error is saying I need. Is there something obvious that I'm missing here?
Other possibly relevant information:
My launcher activity
public class StartActivity extends ActionBarActivity {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Parse.initialize(this, "REDACTED", "REDACTED");
ParsePush.subscribeInBackground("");
ParseUser user = ParseUser.getCurrentUser();
Intent i;
if (user == null) {
i = new Intent(this, LogInActivity.class);
} else {
i = new Intent(this, MainActivity.class);
}
startActivity(i);
finish();
}
}
There is not currently anything related to pushes in any of my other classes. One possibility I haven't tested yet is that my lack of a ParsePushBroadcastReceiver subclass is causing a problem, but based on the documentation in the Parse API, this doesn't seem to be necessary for the basic push service.
My full manifest, in case it's needed:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<permission android:name="com.example.myapp.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.myapp.permission.C2D_MESSAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".LogInActivity"
android:label="#string/app_name" >
</activity>
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
</activity>
<activity
android:name=".ChatActivity"
android:label="#string/app_name"
android:windowSoftInputMode="stateHidden" >
</activity>
<activity
android:name=".StartActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.example.myapp" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.ParsePushBroadcastReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.parsePushBroadcastReceiver"
android:exported="false" >
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
<meta-data
android:name="com.parse.push.notification_icon"
android:resource="#drawable/push_icon" />
</application>
</manifest>
I'll happily provide any more information that's requested, this is all I could think of. Thanks in advance for any help.
Welp. After all the time I spent on this, it turns out I was just another victim of a typo. Although, I don't actually know what the typo was... I ended up just copy+pasting the error log into my manifest and erasing the timestamp (leaving just the suggested code) and using that to replace the relevant lines. I still can't see a difference, but it's working now. I feel pretty ridiculous.

Android Manifest no launcher found

Im working on android map API and I got it working. The problem is when add a new activity (.ListActivity) and make it my Launcher the console is giving me an error "No Launcher found". Here is my code...
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.themap"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
<permission
android:name="com.example.themap.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.themap.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="my_key" />
<activity
android:name="com.example.themap.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.themap.ListActivity"
android:label="#string/title_activity_list" >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</activity>
</application>
It has to be in an intent-filter together with the MAIN.
<activity
android:name="com.example.themap.ListActivity"
android:label="#string/title_activity_list" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
In your second activity addition you forgot to add intent-filter tags. that is why you are getting the error.
Change your xml file second activity addition as below.
<activity
android:name="com.example.themap.ListActivity"
android:label="#string/title_activity_list" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
tag is missing in com.example.themap.ListActivity
Also you have more than one android.intent.action.MAIN defined
This is defined in both your activities
Refer - http://developer.android.com/reference/android/content/Intent.html#ACTION_MAIN

Push Notification receiver android( manifest?)

I am using google push notifications, it worked perfectly until now,
At the moment the push notifications doesnt work beacause onRegistered is never launched. I think the problem is in the manifest(since the problem is that the receiver is never called) but I'm not sure
this is my manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.name.name"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.WRITE_SMS"/>
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.RESTART_PACKAGES"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.name.name.permission.C2D_MESSAGE" android:protectionLevel="normal" />
<application
android:allowBackup="true"
android:icon="#drawable/logo"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.name.name.Disclaimer"
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.name.name.Pago"
>
</activity>
<activity android:name="com.name.name.MainActivity" android:screenOrientation="portrait"></activity>
<activity android:name="com.name.name.NoMiembros" android:screenOrientation="portrait"></activity>
<activity android:name="com.name.name.ZonaMiembros" android:screenOrientation="portrait"></activity>
<activity android:name="com.name.name.PlayvideofromserverActivity" android:screenOrientation="portrait"></activity>
<activity android:name="com.name.name.GoPromo" android:screenOrientation="portrait"></activity>
<activity android:name="com.name.name.PantallaCarga" android:screenOrientation="portrait"></activity>
<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" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.name.name" />
</intent-filter>
</receiver>
<receiver android:name=".SMSHandler$MessageReceiver" android:exported="true">
<intent-filter android:priority="999">
<action android:name="android.provider.Telephony.SMS_RECEIVED"></action>
</intent-filter>
</receiver>
<service android:name=".GCMIntentService" />
</application>
</manifest>
Try changing this :
<uses-permission android:name="com.name.name.permission.C2D_MESSAGE"
android:protectionLevel="normal" />
To this :
<permission android:name="com.name.name.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.name.name.permission.C2D_MESSAGE" />
i'm not sure where the crossover stops, but i'm using C2DM instead of GCM still, and I'm declaring my message and registration receivers as local classes, not pointing to the google classes like you are.
<receiver
android:name=".utils.C2DMRegistrationReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" >
</action>
<category android:name="package.name.here" />
</intent-filter>
</receiver>
<receiver
android:name=".utils.C2DMMessageReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" >
</action>
<category android:name="package.name.here" />
</intent-filter>
</receiver>

Categories

Resources