0

I tried & searched so many times, but I'm not getting what's wrong here in my code. Some devices play a sound, but some don't. Ex: Samsung Note 3, Samsung on5, lecco le s2. I'm using 9.4 GCM API.

Error:

10-24 21:30:03.396 6813-6813/apk.apk.com E/FirebaseInstanceId: Failed to resolve target intent service, skipping classname enforcement
10-24 21:30:03.397 6813-6813/apk.apk.com E/FirebaseInstanceId: Error while delivering the message: ServiceIntent not found

Code:

Intent intent = new Intent(this,Splash_Activity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
int requestCode = 0;
PendingIntent pendingIntent = PendingIntent.getActivity(this, requestCode, intent, PendingIntent.FLAG_ONE_SHOT);
Uri sound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder noBuilder = new NotificationCompat.Builder(this)
        .setSmallIcon(R.drawable.n_logo)
        .setContentText(message)
        .setAutoCancel(true)
        .setSound(sound)
        .setVibrate(new long[] { 1000, 1000, 1000, 1000, 1000 })
        .setContentTitle(getResources().getString(R.string.app_name))
        .setContentIntent(pendingIntent);

NotificationManager notificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(0, noBuilder.build()); //0 = ID of notification
AL.
  • 36,815
  • 10
  • 142
  • 281
Ajit
  • 1
  • 2
  • So this works on Samsung note 3? And does not work on Lecco? What do you see in logcat when debugging this? – Ivan Oct 24 '16 at 14:57
  • sound dont work on samsung note 3 android 5.1.1 & samsung on5 android 6.0. & lecco le s2 on other devices such as samsung grand its working not seeing anything in debugging – Ajit Oct 24 '16 at 14:58
  • if you're not able to see debug logs in logcat, I'm not able to help you – Ivan Oct 24 '16 at 14:59
  • i will check again let me see – Ajit Oct 24 '16 at 15:00
  • im not getting any error or anything while debugging this im able to successful build apk its just some devices not getting sound, vibrate & proper logo. – Ajit Oct 24 '16 at 15:22
  • try connecting working device in usb debug mode and collect logging output, then do the same for not working device, compare the logs, if no difference found, try at higher debug level, e.g. TRACE – Ivan Oct 24 '16 at 15:24
  • i will try & let you know – Ajit Oct 24 '16 at 15:28
  • 10-24 21:30:03.396 6813-6813/apk.apk.com E/FirebaseInstanceId: Failed to resolve target intent service, skipping classname enforcement 10-24 21:30:03.397 6813-6813/apk.apk.com E/FirebaseInstanceId: Error while delivering the message: ServiceIntent not found. – Ajit Oct 24 '16 at 16:01
  • Awesome, now you can add this to the question description as some evidence. Which device is this from? What are the corresponding lines for the other device? – Ivan Oct 24 '16 at 16:11
  • this is for leeco le 2 which is not getting sound. i dont have other device at the moment so can't check. – Ajit Oct 24 '16 at 16:12

0 Answers0