[Resolved] com.google.android.play:core has added this note for core:1.10.3: Goolge play warning for Android 14

 Email from Google 

Cash dhan earning app

https://play.google.com/store/apps/details?id=com.fantasy.rewards

Update com.google.android.play 

Cash Dhan : Cash Earning app
Jun 18, 2024 21:46

com.google.android.play:core has added this note for core:1.10.3:

Update your Play Core Maven dependency to an Android 14 compatible version! Your current Play Core library is incompatible with targetSdkVersion 34 (Android 14), which introduces a backwards-incompatible change to broadcast receivers to improve user security. As a reminder, from August 31, Google Play requires all new app releases to target Android 14. Update to the latest Play Core library version dependency to avoid app crashes: https://developer.android.com/guide/playcore#playcore-migration

You may not be able to release future versions of your app with this SDK version to production or open testing.


Solution:

Removed implementation 'com.google.android.play:core:1.10.3' as its not supported for android 14

From build.gradle and added below

//implementation 'com.google.android.play:core:1.10.3'
implementation 'com.google.android.play:review:2.0.1'

 

Then under Mainactivity java class

 

Added following

import com.google.android.gms.tasks.*;
import com.google.android.play.core.review.ReviewInfo;
import com.google.android.play.core.review.ReviewManager;
import com.google.android.play.core.review.ReviewManagerFactory;

 

 

update my java code for review from below

void inAppReview(){
        reviewManager = ReviewManagerFactory.create(activity);
        com.google.android.play.core.tasks.Task<
ReviewInfo> request = reviewManager.requestReviewFlow();
       request.addOnCompleteListener(task -> {
      
if (task.isSuccessful()) {
      
// Getting the ReviewInfo object
      
ReviewInfo reviewInfo = task.getResult();
       com.google.android.play.core.tasks.Task<
Void> flow = reviewManager.launchReviewFlow(activity, reviewInfo);
       flow.addOnCompleteListener(task1 -> {

       });
       }
       });
       }

TO

void inAppReview(){

   
reviewManager = ReviewManagerFactory.create(activity);
   
// Directly call requestReviewFlow on ReviewManager
   
Task<ReviewInfo> request = reviewManager.requestReviewFlow();

    request.addOnCompleteListener(task -> {
       
if (task.isSuccessful()) {
            ReviewInfo reviewInfo = task.getResult();
           
reviewManager.launchReviewFlow(activity, reviewInfo).addOnCompleteListener(task1 -> {
               
// Handle flow launch completion (optional)

           
});
        }
    });
}

 

Compiled the code and its done .


Comments

Popular posts from this blog

🥳2000+Digital Products Mega Bundle + Free Bonuses with Digital Product Selling Course🥳 rs 99 Only