Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8741733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:22:07+00:00 2026-06-13T11:22:07+00:00

I have this exception: java.lang.NoSuchMethodError: android.app.Notification$Builder.setProgress at android.support.v4.app.NotificationCompatIceCreamSandwich.a dd(NotificationCompatIceCreamSandwich.java:31) at android.support.v4.app.NotificationCompat$NotificationCompatImplIceCreamSandwich.build(NotificationCompat.java:104) at android.support.v4.app.NotificationCompat$Builder.build(NotificationCompat.java:558) at

  • 0

I have this exception:

java.lang.NoSuchMethodError: android.app.Notification$Builder.setProgress at android.support.v4.app.NotificationCompatIceCreamSandwich.a
dd(NotificationCompatIceCreamSandwich.java:31)
        at android.support.v4.app.NotificationCompat$NotificationCompatImplIceCreamSandwich.build(NotificationCompat.java:104)
        at android.support.v4.app.NotificationCompat$Builder.build(NotificationCompat.java:558)
        at com.problemio.GCMIntentService.generateNotification(GCMIntentService.java:132)
        at com.problemio.GCMIntentService.onMessage(GCMIntentService.java:71)
        at com.google.android.gcm.GCMBaseIntentService.onHandleIntent(GCMBaseIntentService.java:223)
        at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:59)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:132)
        at android.os.HandlerThread.run(HandlerThread.java:60)

Here is my GCMIntentService.java

package com.problemio;

import static com.google.android.gcm.GCMConstants.ERROR_SERVICE_NOT_AVAILABLE;
import static com.google.android.gcm.GCMConstants.EXTRA_ERROR;
import static com.google.android.gcm.GCMConstants.EXTRA_REGISTRATION_ID;
import static com.google.android.gcm.GCMConstants.EXTRA_SPECIAL_MESSAGE;
import static com.google.android.gcm.GCMConstants.EXTRA_TOTAL_DELETED;
import static com.google.android.gcm.GCMConstants.EXTRA_UNREGISTERED;
import static com.google.android.gcm.GCMConstants.INTENT_FROM_GCM_LIBRARY_RETRY;
import static com.google.android.gcm.GCMConstants.INTENT_FROM_GCM_MESSAGE;
import static com.google.android.gcm.GCMConstants.INTENT_FROM_GCM_REGISTRATION_CALLBACK;
import static com.google.android.gcm.GCMConstants.VALUE_DELETED_MESSAGES;

import java.util.Random;
import java.util.concurrent.TimeUnit;
import com.google.android.gcm.GCMBaseIntentService;

import android.app.AlarmManager;
import android.app.IntentService;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.PowerManager;
import android.os.SystemClock;
import android.support.v4.app.NotificationCompat;
import android.util.Log;
import android.widget.Toast;

import utils.GCMConstants;
import utils.SendEmail;

public class GCMIntentService extends GCMBaseIntentService 
{
    public GCMIntentService() 
    {
            super(ProblemioActivity.SENDER_ID);
    }

    @Override
      protected void onRegistered(Context ctxt, String regId) {
        Log.d(getClass().getSimpleName(), "onRegistered: " + regId);
        Toast.makeText(this, regId, Toast.LENGTH_LONG).show();
      }

      @Override
      protected void onUnregistered(Context ctxt, String regId) {
        Log.d(getClass().getSimpleName(), "onUnregistered: " + regId);
      }

      @Override
      protected void onMessage(Context ctxt, Intent message) 
      {
        Bundle extras=message.getExtras();

        for (String key : extras.keySet()) 
        {
            //sendEmail( "Key: " + key , "value: " + extras.getString(key) );

          Log.d(getClass().getSimpleName(),
                String.format("onMessage: %s=%s", key,
                              extras.getString(key)));
        }

        generateNotification(ctxt, extras.getString("message"), "New Message");
      }

        // Subject , body
        public void sendEmail( String subject , String body )
        {
            String[] params = new String[] { "http://www.problemio.com/problems/send_email_mobile.php", subject, body };

            SendEmail task = new SendEmail();
            task.execute(params);               
        }    

      @Override
      protected void onError(Context ctxt, String errorMsg) {
        Log.d(getClass().getSimpleName(), "onError: " + errorMsg);
      }

      @Override
      protected boolean onRecoverableError(Context ctxt, String errorMsg) {
        Log.d(getClass().getSimpleName(), "onRecoverableError: " + errorMsg);

        return(true);
      } 

      private static void generateNotification(Context context, String message, String title ) 
      {
            int icon = R.drawable.ic_launcher;
            long when = System.currentTimeMillis(); // can change this to a future time if desired

            NotificationManager notificationManager = 
                    (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);

            Intent notificationIntent = new Intent(context, ProblemioActivity.class);

            // set intent so it does not start a new activity
            notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
            PendingIntent intent = PendingIntent.getActivity(context, 0, notificationIntent, 0);        
            Uri defaultSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);            

             Notification notification = new NotificationCompat.Builder(context)
             .setContentTitle(title)
             .setContentText(message)
             .setContentIntent(intent)
             .setSmallIcon(icon)
             .setLights(Color.YELLOW, 1, 2)
             .setAutoCancel(true)
             .setSound(defaultSound)
             .build();

            notificationManager.notify(0, notification);
    }     
}

and the crash happens on this line:

generateNotification(ctxt, extras.getString("message"), "New Message");

Should I just wrap that line in something like this:

if ( android.os.Build.VERSION.SDK_INT >= 8 )
{

}

In my manifest I allow all sdk versions like this:

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:22:08+00:00Added an answer on June 13, 2026 at 11:22 am

    There is a support library bug filed for this, see here. A fixed v4 support library can be downloaded from this link in comment #2.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this exception that I get in my crash reports from Android: java.lang.NoSuchMethodError:
I have this exception: java.lang.RuntimeException: Unable to start service com.problemio.BillingService@41342be8 with null: java.lang.NullPointerException at
I have this stack trace (part of) Servlet.service() for servlet action threw exception java.lang.NumberFormatException:
I am encountering this exception. Exception :java.lang.NoSuchMethodError: org.codehaus.groovy.ast.ModuleNode.getStarImports()Ljava/util/List; I have tried various version of
I have a problem regarding java.lang.NoSuchMethodError. This program is about Compiler API (JSR 199).
I have this code try { //AN EXCEPTION IS GENERATED HERE!!! } catch {
I have a source like this: Exception e = new Exception(Exception); IOException ioE =
I have this error when I am trying to read the file: Exception in
I have this error when trying to generate the meta model with JOOQ: org.jooq.exception.DataAccessException:
I have this code: ie1.link(:text, /Exception:/) It is producing an error message which I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.