title: Google Play Store Error Security Implicit Pending Intent is not resolved even after trying suggestion from google doc
body: <p><strong>We have already used FLAG_IMMUTABLE with pending intent for Version&gt;=23 . Here are all the dependencies we are using in our project, even after updating the firebase, one signal library used for sending/receiving notification, google play store is still giving the pending intent security error on uploading the apk.
  Following are the dependencies used and the code for notification.
  PendingIntent.FLAG_IMMUTABLE. Can Anyone suggest what could be the possible solution</strong></p>
  <pre><code>
   implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation 'androidx.appcompat:appcompat:1.2.0'
      implementation 'androidx.browser:browser:1.3.0'
      implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
      implementation 'io.reactivex:rxandroid:1.2.1'
      implementation 'io.reactivex:rxjava:1.2.1'
      implementation 'com.squareup.okhttp3:logging-interceptor:3.5.0'
      implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
      implementation 'com.squareup.retrofit2:converter-jackson:2.1.0'
      implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
      implementation &quot;com.google.dagger:dagger:2.12&quot;
      implementation 'androidx.navigation:navigation-fragment-ktx:2.3.3'
      implementation 'androidx.navigation:navigation-ui-ktx:2.3.3'
      implementation 'androidx.drawerlayout:drawerlayout:1.1.1'
      implementation 'androidx.fragment:fragment-ktx:1.3.0'
      implementation 'com.google.android.gms:play-services-analytics-impl:17.0.1'
      kapt &quot;com.google.dagger:dagger:2.12&quot;
      implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
      implementation 'com.github.bumptech.glide:glide:4.11.0'
      implementation 'androidx.media:media:1.2.1'
      implementation 'androidx.legacy:legacy-support-v4:1.0.0'
      implementation 'com.google.firebase:firebase-inappmessaging-display:20.1.1'
  
      implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
      implementation 'com.google.firebase:firebase-invites:17.0.0'
      implementation 'com.google.firebase:firebase-core:20.0.2'
      implementation 'com.google.firebase:firebase-dynamic-links:21.0.0'
  
      implementation 'com.google.firebase:firebase-messaging:23.0.0'
      implementation 'com.google.android.gms:play-services-auth:20.1.0'
      implementation 'com.google.android.gms:play-services-auth-api-phone:18.0.1'
      implementation 'com.google.firebase:firebase-auth:21.0.1'
  
  
      implementation 'com.google.maps.android:android-maps-utils:0.5'
      implementation 'com.google.android.gms:play-services-location:18.0.0'
      implementation 'com.google.android.gms:play-services-maps:17.0.0'
      implementation('com.google.android.libraries.places:places:2.4.0') {
          exclude module: 'glide'
      }
      implementation 'com.google.firebase:firebase-config:21.0.1'
  
      implementation 'androidx.cardview:cardview:1.0.0'
      implementation 'androidx.recyclerview:recyclerview:1.1.0'
      implementation 'com.google.android.gms:play-services-gcm:17.0.0'
  
  
      implementation files('libs/YouTubeAndroidPlayerApi.jar')
      implementation 'com.google.android.material:material:1.3.0'
      implementation 'org.jsoup:jsoup:1.11.3'
  
      implementation 'com.google.code.gson:gson:2.8.6'
      implementation 'com.facebook.android:facebook-android-sdk:12.0.0'
      implementation 'com.facebook.android:audience-network-sdk:4.99.1'
      implementation 'com.facebook.android:facebook-share:12.0.0'
      implementation 'com.facebook.android:facebook-login:12.0.0'
      implementation 'com.google.code.gson:gson:2.8.6'
      implementation 'com.truizlop.sectionedrecyclerview:library:1.2.0'
      implementation &quot;org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version&quot;
      implementation &quot;org.jetbrains.anko:anko:$anko_version&quot;
      implementation 'com.github.PhilJay:MPAndroidChart:v3.0.2'
  
      implementation 'com.theartofdev.edmodo:android-image-cropper:2.3.1'
      implementation &quot;androidx.viewpager2:viewpager2:1.0.0&quot;
      implementation 'com.android.support:multidex:1.0.3'
      implementation &quot;com.airbnb.android:lottie:3.4.0&quot;
      implementation 'com.google.firebase:firebase-crashlytics:18.2.6'
      implementation &quot;com.android.installreferrer:installreferrer:2.2&quot;
      implementation 'com.github.jkwiecien:EasyImage:3.2.0'
  
  
      implementation 'com.onesignal:OneSignal:4.7.0'
      //for inApp Update
      implementation 'com.google.android.play:core:1.9.1'
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation 'androidx.core:core:1.3.2'
      implementation 'androidx.appcompat:appcompat:1.2.0'
      implementation 'androidx.lifecycle:lifecycle-process:2.3.0'
      implementation 'com.moengage:moe-android-sdk:11.0.04'
      implementation 'com.moengage:rich-notification:2.0.01'
      implementation(&quot;com.moengage:geofence:1.0.00&quot;)
      implementation(&quot;com.moengage:push-amp-plus:3.0.01&quot;)
  
      // implementation 'com.github.mreram:showcaseview:1.1'
  
      annotationProcessor &quot;com.google.dagger:dagger-compiler:2.12&quot;
      kapt &quot;com.google.dagger:dagger-compiler:2.12&quot;
  
      testDebugImplementation 'junit:junit:4.12'
      androidTestImplementation 'androidx.test.ext:junit:1.1.1'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
      testImplementation 'org.mockito:mockito-core:2.19.0'
  
  
      //    Add Zxing library to generate barcode
      implementation 'com.google.zxing:core:3.3.0'
      implementation 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
      implementation project(':tokenautocomplete')
      implementation project(':linkpreviewlibrary')
  
      //flaoting action button
      implementation 'com.github.clans:fab:1.6.4'
  
      implementation &quot;androidx.annotation:annotation:1.1.0&quot;
      implementation &quot;com.karumi:dexter:5.0.0&quot;
      testImplementation 'junit:junit:4.13.2'
  
      androidTestImplementation 'com.android.support.test.espresso:espresso-intents:2.2.2'
      androidTestImplementation 'com.android.support.test:rules:0.5'
      androidTestImplementation 'com.android.support.test:runner:0.5'
  
      implementation &quot;io.grpc:grpc-okhttp:1.32.2&quot;
      implementation 'com.github.douglasjunior:android-simple-tooltip:0.2.2'
  
  </code></pre>
  <pre><code>
   private void sendNotification(String notificationTitle, String notificationBody, Bitmap bitmap, Intent intent, Intent backIntent) {
          intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  
          PendingIntent pendingIntent;
  
          if (backIntent != null) {
              backIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
              Intent[] intents = new Intent[]{backIntent, intent};
              if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {
                  pendingIntent = PendingIntent.getActivities(this, notificationId++, intents, PendingIntent.FLAG_IMMUTABLE );
              } else {
                  pendingIntent = PendingIntent.getActivities(this, notificationId++, intents, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT);
              }
          } else {
              if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {
                  pendingIntent = PendingIntent.getActivity(this, notificationId++, intent, PendingIntent.FLAG_IMMUTABLE);
              } else {
                  pendingIntent = PendingIntent.getActivity(this, notificationId++, intent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT);
              }
          }
  
          Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
          NotificationCompat.Builder notificationBuilder;
  
  
          NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
  
  
          String name = &quot;gramophone_channel&quot;;
          String id = &quot;gramophone_channel_1&quot;; // The user-visible name of the channel.
          String description = &quot;gramophone_first_channel&quot;; // The user-visible description of the channel.
          if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.O) {
              int importance = NotificationManager.IMPORTANCE_HIGH;
              NotificationChannel mChannel = null;
              if (notificationManager != null) {
                  mChannel = notificationManager.getNotificationChannel(id);
              }
              if (mChannel == null) {
                  mChannel = new NotificationChannel(id, name, importance);
                  mChannel.setDescription(description);
                  mChannel.enableVibration(true);
                  mChannel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});
                  if (notificationManager != null) {
                      notificationManager.createNotificationChannel(mChannel);
                  }
              }
  
              notificationBuilder = new NotificationCompat.Builder(this, id)
                      .setAutoCancel(true)   //Automatically delete the notification
                      .setSmallIcon(R.drawable.leaf_logo) //Notification icon
                      .setContentIntent(pendingIntent)
                      .setContentTitle(notificationTitle)
                      .setContentText(notificationBody)
                      .setLargeIcon(bitmap)
                      .setSound(defaultSoundUri);
  
          } else {
              notificationBuilder = new NotificationCompat.Builder(this)
                      .setAutoCancel(true)   //Automatically delete the notification
                      .setSmallIcon(R.drawable.leaf_logo) //Notification icon
                      .setContentIntent(pendingIntent)
                      .setContentTitle(notificationTitle)
                      .setContentText(notificationBody)
                      .setLargeIcon(bitmap)
                      .setSound(defaultSoundUri);
  
          }
          if (notificationManager != null) {
              notificationManager.notify(notificationId++ /* ID of notification */, notificationBuilder.build());
          }
      }
      ```
  </code></pre>