Can't seem to locate the error in my app that Google's closed testing results show while reviewing my app for Play store

49 views Asked by At

I am trying to publish my first Android app on the Play Store and upon submitting my app for review in closed testing It keeps on getting the error and isn't getting approved. This is the Stack trace that I receive from Google:

at com.android.systemui.theme.ThemeOverlayController$2.onColorsChanged(go/retraceme 75715c7479327786a87a1fe249ded83ff2c803fd83efee8d94222161435eae16:13)

Exception java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
at com.android.systemui.theme.ThemeOverlayController.isSeedColorSet (go/retraceme 75715c7479327786a87a1fe249ded83ff2c803fd83efee8d94222161435eae16:11)
at com.android.systemui.theme.ThemeOverlayController.-$$Nest$mhandleWallpaperColors (go/retraceme 75715c7479327786a87a1fe249ded83ff2c803fd83efee8d94222161435eae16:277)
at com.android.systemui.theme.ThemeOverlayController$2.onColorsChanged (go/retraceme 75715c7479327786a87a1fe249ded83ff2c803fd83efee8d94222161435eae16:13)
at android.app.WallpaperManager$Globals.lambda$onWallpaperColorsChanged$1 (WallpaperManager.java:578)
at android.app.WallpaperManager$Globals.$r8$lambda$RMMQjTiJSYineAc1wmBHnXKAa4k
at android.app.WallpaperManager$Globals$$ExternalSyntheticLambda0.run
at android.os.Handler.handleCallback (Handler.java:958)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loopOnce (Looper.java:205)
at android.os.Looper.loop (Looper.java:294)
at android.app.ActivityThread.main (ActivityThread.java:8177)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:971)

This is my Code for setting up the wallpaper:

public class WallPaperActivity extends AppCompatActivity {

    ImageView imageViewWallpaper;
    CircleImageView userImage;
    FloatingActionButton fabDownload, fabWallpaper;
    Hit photo;
    Dialog dialog;
    Button cancelBtn, confirmBtn;
    TextView descTextDialog, username, downloads, views, likes;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_wall_paper);

        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

        imageViewWallpaper = findViewById(R.id.imageview_wallpaper);
        fabDownload = findViewById(R.id.fab_download);
        fabWallpaper = findViewById(R.id.fab_wallpaper);
        userImage = findViewById(R.id.userImage);
        username = findViewById(R.id.userName);
        downloads = findViewById(R.id.downloadCount);
        views = findViewById(R.id.viewsCount);
        likes = findViewById(R.id.likesCount);

        dialog = new Dialog(WallPaperActivity.this);
        dialog.setContentView(R.layout.custom_dialog_box);
        dialog.getWindow().setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        dialog.getWindow().setBackgroundDrawable(getDrawable(R.drawable.custom_dialog_bg));
        dialog.setCancelable(false);

        cancelBtn = dialog.findViewById(R.id.cancel_button);
        confirmBtn = dialog.findViewById(R.id.confirm_action);
        descTextDialog = dialog.findViewById(R.id.descText);


        Toast.makeText(this, "Loading....", Toast.LENGTH_SHORT).show();
        photo = (Hit) getIntent().getSerializableExtra("photo");
        Picasso.get().load(photo.getLargeImageURL()).into(imageViewWallpaper);

        if (photo.getUserImageURL() != null && !photo.getUserImageURL().isEmpty()){
            Picasso.get().load(photo.getUserImageURL()).error(R.drawable.user_icon).into(userImage);
        }else {
            userImage.setImageResource(R.drawable.user_icon);
        }


        username.setText(photo.getUser());
        downloads.setText(Utils.convertToKilo(photo.getDownloads()));
        views.setText(Utils.convertToKilo(photo.getViews()));
        likes.setText(Utils.convertToKilo(photo.getLikes()));


        fabWallpaper.setOnClickListener(view -> {

            descTextDialog.setText("Do you want to set this image as your wallpaper?");

            confirmBtn.setOnClickListener(view14 -> {
                new SetWallpaperTask(WallPaperActivity.this).execute(photo.getWebformatURL());
                dialog.dismiss();
            });
            cancelBtn.setOnClickListener(view13 -> dialog.dismiss());

            dialog.show();
        });

    }

}

SetWallpaperTask Class:

public class SetWallpaperTask extends AsyncTask<String, Void, Bitmap> {

    private Exception exception;
    private final Context context;

    public SetWallpaperTask(Context context) {
        this.context = context;
    }


    @Override
    protected Bitmap doInBackground(String... urls) {
        try {
            URL url = new URL(urls[0]);
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setDoInput(true);
            connection.connect();
            InputStream input = connection.getInputStream();
            return BitmapFactory.decodeStream(input);
        } catch (IOException e) {
            this.exception = e;
            return null;
        }
    }

    protected void onPostExecute(Bitmap bitmap) {
        if (bitmap != null) {
            WallpaperManager wallpaperManager = WallpaperManager.getInstance(context);
            try {
                wallpaperManager.setBitmap(bitmap);
                Toast.makeText(context, "Wallpaper Set!", Toast.LENGTH_SHORT).show();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        } else if (exception != null) {
            exception.printStackTrace();
        }
    }

}

I looked at my entire code thoroughly but still, I am not able to find what the problem is, it seems it is something with the built-in WallpaperManager library that I am using to set the wallpaper to the home screen but I don't know how to resolve this issue.

0

There are 0 answers