GCM receiver package not found - java

I'm studying GCM (Google Cloud Messaging, old deprecated name is C2DM). I use different devices . operations run well , even if app is closed . but on nexus tablet, an error occurs when app is closed. if app is in progress , my GCM codes works on all devices that I try .
Now : I looked for these problem and I found there was an error manifests of others . If my manifest is wrong , why do ohter devices except nexus tablet, execute my codes properly ?
Could I think that my manifest is wrong?
this is my manifests :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.borda.C2DM"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<permission android:name="android.borda.C2DM.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="android.borda.C2DM.permission.C2D_MESSAGE" />
<!-- App receives GCM messages. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- GCM connects to Google Services. -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</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="android.borda.C2DM" />
</intent-filter>
</receiver>
<service android:name=".GCMIntentService" />
</application>
</manifest>

an error occurs when app is closed
What kind of error?
If you just can't receive gcm messages in your app (android 3.1+) when app is closed - take look on that question.

Related

App is not compatible with TVs on closed testing in the Google Play. This item is not compatible with your device

I'm developing an app for Android TV and TV-boxes.
My problem is that Android TV devices are available for installing my app from Google Play for internal testing, but NOT available for closed testing (but it still can be installed on the smartphones).
Screenshot: Google Play install dialog
My app starting from StartScreenActivity (it's splash screen).
The QUERY_ALL_PACKAGES is required for my app and declared.
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />
<uses-feature
android:name="android.software.leanback"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:banner="#mipmap/appbanner">
<activity
android:name=".ui.presentation.StartScreenActivity"
android:exported="true"
android:launchMode="singleTask"
android:screenOrientation="landscape"
android:theme="#style/SplashTheme">
<intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.presentation.MainActivity"
android:windowSoftInputMode="adjustPan"
android:screenOrientation="landscape"
android:exported="false">
</activity>
</application>
</manifest>
On the internal testing it works like expected, but no one can to install an app to TV on the close testing. Setting the android.software.leanback as required not helped - it just making all others devices not available for install.
What am I doing wrong? Please advise.
It was non-obvious, but all you need is to add Android TV form factor to the Google Play Console:
Release -> Advanced Settings -> Form Factors -> Add
How to add the form factor to the Play Console
I waited over 24 hours before my application was approved.
Now all TV devices are available.

couldn't load memtrack module (no such file or directory) android

I`ve tried all stuff i see on internet about that i cant do it work, please help me.
Here is my Andorid Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.aceptaelreto"
android:versionCode="8"
android:versionName="8.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-feature android:glEsVersion="0x00020000"></uses-feature>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
</activity>
<activity
android:name=".LoginActivity"
android:label="#string/title_activity_login"
android:windowSoftInputMode="adjustResize|stateHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
/>
</application>
<!--
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>
LogCat Out:
As you can see i have two activities, one for loggin in and one Main,
It was working perfectly but i get a DX error for using javax.xml.bind, i fixed removimg it and using simpleframework and now i have this issue, its driving me crazy.
If someone needs more code or more info please ask, also ill let you here the Github Repo where you can find all the code.
Well finally i realise that couldn't load memtrack module was not the problem, it was just a warning under it that says error to parse Xml File in line 36, i check it and i had
<meta-data
android:name="com.google.android.gms.version"
/>
What was causing some problems, finnally i remove it and nos its all ok.

Failure manifest parse error

Hey I am clueless as to why I get this error, it might be something to do with the GCM stuff because it stopped working after I added it... my package name is lowercase already which I see to be the main solution all over.
Here is my code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.lior.winklio">
<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="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<!-- for google cloud messaging -->
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!--
Creates a custom permission so only this app can receive its messages.
NOTE: the permission *must* be called PACKAGE.permission.C2D_MESSAGE,
where PACKAGE is the application's package name.
-->
<permission android:name="com.example.lior.winklio.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.google.android.gcm.demo.app.permission.C2D_MESSAGE" />
<!-- This app has permission to register and receive data message. -->
<uses-permission
android:name="com.google.android.c2dm.permission.RECEIVE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/facebook_app_id"/>
<!--google play services-->
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<!--
WakefulBroadcastReceiver that will receive intents from GCM
services and hand them to the custom IntentService.
The com.google.android.c2dm.permission.SEND permission is necessary
so only GCM services can send data messages for the app.
CHANGING ANDROID NAME FOR TUTORIAL FROM GcmBroadcastReceiver to MSGReciever
and GcmIntentService
-->
<receiver
android:name=".Modular.MSGReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.example.lior.winklio" />
</intent-filter>
</receiver>
<service android:name="Modular.MSGService" />
<activity
android:name="com.example.lior.winklio.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>
<!-- Chat Activity -->
<activity android:name=".ChatActivity"
android:launchMode="singleTask"
android:label="#string/app_name" />
<!-- Login Activity -->
<activity
android:name=".StarterActivity"
android:label="Winklio" >
</activity>
<activity
android:name="com.facebook.LoginActivity"
android:label="Winklio" >
</activity>
</application>
</manifest>
The error:
Installing com.example.lior.winklio
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.example.lior.winklio"
pkg: /data/local/tmp/com.example.lior.winklio
Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]

How to fix INSTALL_PARSE_FAILED_MANIFEST_MALFORMED in my android application

Hi I am trying to experiment with gcm but unable to make it work. Don't know where I am messing with it, below is the error I am getting. I am trying to deploy my application directly on device and debug from there but when ever I try to deploy it gives this error
Waiting for device.
Target device: HT24LW108632
Uploading file
local path: D:\Data\Android\AndroidTest\out\production\AndroidTest\AndroidTest.apk
remote path: /data/local/tmp/Android.Test
Installing Android.Test
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/Android.Test"
pkg: /data/local/tmp/Android.Test
Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="Android.Test"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="14"/>
<permission
android:name="Android.Test.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="Android.Test.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<application android:label="#string/app_name" android:icon="#drawable/ic_launcher">
<activity android:name="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>
<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="Android.Test" />
</intent-filter>
</receiver>
<service android:name=".GCMIntentService" />
</application>
</manifest>
My Device is HTC OneX
Android Version: 4.03
HTC Sense Version: 4.0
Software number: 1.29.110.11
HTC SDK API Level: 4.12
HTC Extension version: HTCExtension_403_1_GA_7
Please guide as I am new fish in Android Sea.
Edit-1:
I have noticed that if I comment this below line then application does deploy and execute but obviously I cant go forward without below mentioned permission ... please help....
<permission android:name="Android.Test.permission.C2D_MESSAGE" android:protectionLevel="signature" />
Change name package with Caps letters to little letters.
Change your
android:name="MainActivity"
TO
android:name=".MainActivity"
OR add the fully qualified package name in lowercase before your class name
android:name="thepackage.MainActivity"
Do change all the attributes named as android:name inside the activity tags as I suggested.
Instead of:
<permission android:name="android.permission.C2D_MESSAGE" android:protectionLevel="signature"/>
to:
<uses-permission android:name="android.permission.C2D_MESSAGE" android:protectionLevel="signature"/>
Try that.
<activity android:name="MainActivity"
should be formed like
<activity android:name="com.company.appname"
to do this without errors go to package (right click) > android tools > rename app package
try to write activity name follow by "."
Instead of
<activity android:name="MainActivity"
android:label="#string/app_name">
use
<activity android:name=".MainActivity"
android:label="#string/app_name">
I met this same issue in android studio
what solve this is to let company domain to be all small letters,
There's issue about this: http://code.google.com/p/android/issues/detail?id=37658
Capital letters can't be used in package names within permissions. You got (same as me) into difficult situation when you have deployed application with package name like this and you need to use GCM.
I tried to use some kind of short form of permission:
<permission android:name=".permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name=".permission.C2D_MESSAGE" />
I also defined service in the same way. It had to be in application package.
It worked on Android 4.3. Probably on 4.2 also. I know that on 4.0.3 it didn't.
make sure your package name is in small letters...
worked for me
write the java package name and all folders name in lowercase, it will work fine...
In my case I was mentioned the package name in small letters only. But for few of the activities I named it with partial name i.e android:name=".ContactUs" . After I solved it by prefixing full package name before all the activity name, service name and broadcast provider name in Manifest file.
Working code
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="vcan.doit.com">
<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.DesignDemo">
<activity
android:name="vcan.doit.com.LoginActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="vcan.doit.com.MainActivity"
android:theme="#style/Theme.DesignDemo" />
<activity
android:name="vcan.doit.com.CheeseDetailActivity"
android:parentActivityName="vcan.doit.com.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="vcan.doit.com.MainActivity" />
</activity>
<service android:name="vcan.doit.com.PushNotification.MyAndroidFirebaseMsgService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service android:name="vcan.doit.com.PushNotification.MyAndroidFirebaseInstanceIdService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<activity
android:name="vcan.doit.com.AboutUs"
android:label="#string/abt_us"
android:parentActivityName="vcan.doit.com.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="vcan.doit.com.MainActivity" />
</activity>
<activity
android:name="vcan.doit.com.ContactUs"
android:label="#string/contact_us"
android:parentActivityName="vcan.doit.com.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="vcan.doit.com.MainActivity" />
</activity>
<activity android:name="vcan.doit.com.WriteToUs"
android:label="#string/write_us"
android:parentActivityName="vcan.doit.com.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="vcan.doit.com.MainActivity" />
</activity>
</application>
I had this problem. My device memory was full. I solved my problem with freeing device memory.
For Android 12 (Android ", API Level 31) you can find this same error because of behavioural changes.
To get rid of it you must add android:exported="true" (or false*) to any <activity>, <activity-alias>,<service>, or <receiver> components that have <intent-filter>s declared in the app’s AndroidManifest.xml file.
* More info: Related official documentation

broadcast intent callback: result=CANCELLED forIntent

I have a mobile app, that registers to a c2dm server.
I have a server that sends a message to my app, to push a notification. The server receives ok result code from google c2dm.
In LogCat i see that my app receives the message but immediately produces the error i have in my post. And also the notification that i created is ignored.
08-10 16:28:09.157: W/GTalkService(13962): [DataMsgMgr] broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg=com.example.c2dmclient (has extras) }
i don't get it.
My manifest file is:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.c2dmclient"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<permission android:name="com.example.c2dmclient.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.example.c2dmclient.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.GET_ACCOUNTS" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<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="com.example.c2dmclient" />
</intent-filter>
</receiver>
<receiver
android:name=".C2DMMessageReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter >
<action android:name="com.google.android.c2dm.intent.RECEIVE" >
</action>
<category android:name="com.example.c2dmclient" />
</intent-filter>
</receiver>
<activity android:name="com.example.c2dmclient.RegistrationResultActivity" >
</activity>
<activity android:name="com.example.c2dmclient.MessageReceivedActivity" >
</activity>
</application>
</manifest>
If someone could help me please. i'm out of ideas
According to this forum post the situation arises in Android 3.1+ when the receiving app is in stopped state on the device (for example by using force stop from the settings). It will only start to receive messages again when it is manually started.
See also this post
Finally i have found where was the problem. When i was creating the notification, in the place of logo id, i have put 0. Now all it's working.

Categories