C2DM permission.C2D_MESSAGE gives Installation error
I am trying to use C2DM in my Android app in Eclipse following the example on their developer site. But I keep getting "Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED" when trying to launch my app:
[2011-06-01 09:19:09 - xVoice] Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED [2011-06-01 09:19:09 - xVoice] Please check logcat output for more details. [2011-06-01 09:19:09 - xVoice] Launch canceled!
And Logcat gives me the following warning: 06-01 09:18:47.882: WARN/PackageParser(2488): /data/app/vmdl46038.tmp (at Binary XML file line #8): Bad class name Telenet.xVoice.permission.C2D_MESSAGE in package Telenet.xVoice
Can anybody see what the problem is?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="Telenet.xVoice"
android:versionCode="1"
android:versionName="1.0">
<!-- Only this app开发者_运维百科lication can receive the messages and registration result -->
<permission android:name="Telenet.xVoice.permission.C2D_MESSAGE" android:protectionLevel="signature"/>
<uses-permission android:name="Telenet.xVoice.permission.C2D_MESSAGE" />
<!-- This app has permission to register and receive message -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
<uses-sdk android:minSdkVersion="8"></uses-sdk>
<application android:label="@string/app_name" android:icon="@drawable/logo" android:name="xVoiceApp">
<activity android:name=".xVoice" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name=".xVoiceAppWidgetProvider" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="android.net.wifi.STATE_CHANGE" />
<action android:name="android.net.wifi.supplicant.CONNECTION_CHANGE" />
<action android:name="android.net.wifi.WIFI_STATE_CHANGED" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.HOME"/>
</intent-filter>
<!-- Receive the actual message -->
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="Telenet.xVoice" />
</intent-filter>
<!-- Receive the registration id -->
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="Telenet.xVoice" />
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="@xml/xvoice_appwidgetprovider_info" />
</receiver>
<activity android:name=".xVoicemail"></activity>
<activity android:name=".xCallLog"></activity>
<activity android:name=".xConfiguration"></activity>
<activity android:name=".xVoiceIncomming" android:theme="@android:style/Theme.Dialog" android:noHistory="true" ></activity>
<service android:name=".xVoiceService" />
</application>
</manifest>
In the generated code I found following class:
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package Telenet.xVoice;
public final class Manifest {
public static final class permission {
/** Only this application can receive the messages and registration result
*/
public static final String C2D_MESSAGE="Telenet.xVoice.permission.C2D_MESSAGE";
}
}
The given blow is my code i have used this code for C2DM it is running fine. compare your code with my given code and also check the fallowing think i given blow. 1) Email address you have registered for C2DM. 2) Check your local server. 3) http://code.google.com/android/c2dm/index.html take this url for more information and compare all your code with this given tutorial for google i have done it with this tutorial . I hope this is very helpful to you.
<?xml version="1.0" encoding="utf-8"?>
<permission android:name="com.cipl.TennisApp.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.cipl.TennisApp.permission.C2D_MESSAGE" />
<!-- This app has permission to register and receive message -->
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:debuggable="true" android:theme="@android:style/Theme.NoTitleBar">
<uses-library android:name="com.google.android.maps" />
<activity android:name="com.cipl.TennisApp.TennisAppActivity" android:label="@string/app_name">
</activity>
<activity android:name=".HomeActivity" 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>
<!-- C2DM service Receive -->
<service android:name="com.commonsware.android.c2dm.C2DMReceiver" />
<receiver android:name="com.google.android.c2dm.C2DMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.cipl.TennisApp" />
</intent-filter>
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.cipl.TennisApp" />
</intent-filter>
</receiver>
<!-- C2DM service Receive End -->
<activity android:name="com.google.android.c2dm.NotificationIntent"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.More.ChangePasswordActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.More.AccountsActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.More.DiscussionActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.More.MoreListActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.More.MessageActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.More.AboutUsActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.More.ContactUSActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.More.BlockUserActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.More.CreateNewTopic"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.More.AddCommentActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.More.PrivacyPolicyActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.More.MoreTabActivityGroupNew"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.TennisApp.DefaultDisplay"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.TennisApp.MatchesListActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.TennisApp.PlayersListActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.TennisApp.CourtsListActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.TennisApp.MatchListDetailsActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:noHistory="true" android:stateNotNeeded="true" android:name="com.cipl.TennisApp.Login"
android:label="@string/app_name" android:screenOrientation="portrait" android:launchMode="singleInstance"/>
<activity android:name="com.cipl.Courts.AddCourtActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.TennisApp.ForgotPasswordActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.TennisApp.InviteForMatchActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.TennisApp.SendMessageActivity"
android:label="@string/app_name" android:screenOrientation="portrait" android:windowSoftInputMode="adjustResize|adjustPan"/>
<activity android:name="com.cipl.TennisApp.RegistrationActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.TennisApp.TabGroupActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.TennisApp.TabGroupActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.TennisApp.PlayersListActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.TennisApp.CourtsListActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.TennisApp.HomeTabActivityGroup"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.TennisApp.TermsActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.Courts.AddCourtActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.TennisApp.PlayerProfileActiviy"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.Courts.CourtDetailActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.Matches.AddMatchActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.Matches.AddMatchActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.Matches.MatchDetailActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.Profile.MyProfile"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.Profile.EditMyProfileActivity"
android:label="@string/app_name" android:screenOrientation="portrait" android:windowSoftInputMode="adjustResize|adjustPan"/>
<activity android:name="com.cipl.Profile.SkillInfoActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.Profile.ProfileTabActivityGroup"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.Favorites.FavoritesTabActivityGroup"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.Favorites.FavoritesActivity"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<!-- <activity android:name="com.cipl.Courts.CourtDetailGetDirectionActivity"
android:label="@string/app_name" /> -->
<activity android:name="com.cipl.TennisApp.SetCurrentLocation"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.Courts.DrivingDirection"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.Notifications.NotificationTabActivityGroup"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<activity android:name="com.cipl.Notifications.ShowAllNotificationActiviry"
android:label="@string/app_name" android:screenOrientation="portrait"/>
<!-- AdMobActivity definition -->
<activity android:name="com.admob.android.ads.AdMobActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|keyboard|keyboardHidden" />
<!-- Track Market installs -->
<receiver android:name="com.admob.android.ads.analytics.InstallReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<meta-data android:value="true" android:name="ADMOB_ALLOW_LOCATION_FOR_ADS"/>
<!-- The application's publisher ID assigned by AdMob -->
<meta-data android:value="a14d6f97d8ea9fc" android:name="ADMOB_PUBLISHER_ID" />
</application>
<uses-permission android:name="android.permission.ACCESS_GPS" />
<uses-permission android:name="android.permission.ACCESS_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_OWNER_DATA" />
<uses-permission android:name="android.permission.WRITE_OWNER_DATA" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<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.UPDATE_DEVICE_STATS"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<supports-screens android:normalScreens="true"
android:largeScreens="true" android:anyDensity="true">
精彩评论