ERROR: E/ActivityThread: Failed to find provider info for com.dianxinos.dxbs.DuCandyCooProvider

  android, java

Im going mad with these 3 errors

2021-04-14 16:13:57.700 7975-8013/? E/ActivityThread: Failed to find provider info for com.dianxinos.dxbs.DuCandyCooProvider
2021-04-14 16:13:57.701 7975-8013/? E/ActivityThread: Failed to find provider info for com.dianxinos.optimizer.duplay.DuCandyCooProvider
2021-04-14 16:13:57.766 7975-8013/? E/ActivityThread: Failed to find provider info for com.estrongs.android.pop.DuCandyCooProvider

Whenever I open the app it get crashed, I have tried everything but nothing is working,

I have created a service which run’s the floating widget and have used a GitHub library for screen recording and it was working fine, I don’t know what happened

this is my mainActivity if you find anything wrong anything please comment below

public class MainActivity extends AppCompatActivity implements HBRecorderListener {

    private HBRecorder recorder;
    private boolean hasPermissions = false, FAB = true;
    Intent data2;
    int id;
    MeowBottomNavigation bottomNavigation;
    FloatingActionButton main, add;
    TextView add_FAB;
    boolean audio = true;
    FloatingViewService service;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        recorder = new HBRecorder(this, this);
        checkFloatingPermission();
    }

    @Override
    protected void onStart() {
        super.onStart();
        // Bind to LocalService
        Intent intent = new Intent(this, FloatingViewService.class);
        bindService(intent, connection, Context.BIND_AUTO_CREATE);
    }

    /**
     * Defines callbacks for service binding, passed to bindService()
     */
    private ServiceConnection connection = new ServiceConnection() {
        @Override
        public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
            FloatingViewService.LocalBinder binder = (FloatingViewService.LocalBinder) iBinder;
            service = binder.getServerInstance();
        }

        @Override
        public void onServiceDisconnected(ComponentName componentName) {

        }
    };

    private void checkReadWritePermission() {
        if (checkSelfPermission(Manifest.permission.RECORD_AUDIO, PERMISSION_REQ_ID_RECORD_AUDIO) && checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE, PERMISSION_REQ_ID_WRITE_EXTERNAL_STORAGE)) {
            hasPermissions = true;
            MediaProjectionManager mediaProjectionManager = (MediaProjectionManager) getSystemService(Context.MEDIA_PROJECTION_SERVICE);
            Intent permissionIntent = mediaProjectionManager != null ? mediaProjectionManager.createScreenCaptureIntent() : null;
            startActivityForResult(permissionIntent, 101);
            setNavBar();
            bottomNavigation.show(1, true);
            setFAB();
            getAllFiles();
        }
    }

    private void setFAB() {
        add_FAB = findViewById(R.id.text_for_FAB);
        main = findViewById(R.id.main_fab);
        add = findViewById(R.id.fab_addView);

        main.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (FAB) {
                    add.setVisibility(View.VISIBLE);
                    add_FAB.setVisibility(View.VISIBLE);
                    FAB = false;
                } else {
                    add.setVisibility(View.GONE);
                    add_FAB.setVisibility(View.GONE);
                    FAB = true;
                }
            }
        });
        add.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                service.startRecording();
//                if (checkSelfPermission(Manifest.permission.RECORD_AUDIO, PERMISSION_REQ_ID_RECORD_AUDIO) && checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE, PERMISSION_REQ_ID_WRITE_EXTERNAL_STORAGE)) {
//                    hasPermissions = true;
//                }
//                if (hasPermissions) {
//                    ImageView temp = findViewById(R.id.startRecording);
//                    temp.callOnClick();
//                    //  startRecordingScreen();
//                }
            }
        });
    }

    private void setNavBar() {
        bottomNavigation = findViewById(R.id.bottom_navbar);
        bottomNavigation.add(new MeowBottomNavigation.Model(1, R.drawable.ic_baseline_home_24));
        bottomNavigation.add(new MeowBottomNavigation.Model(2, R.drawable.ic_baseline_settings_24));

        bottomNavigation.setOnShowListener(new MeowBottomNavigation.ShowListener() {
            @Override
            public void onShowItem(MeowBottomNavigation.Model item) {
                Fragment fragment = null;
                switch (item.getId()) {
                    case 1: {
                        fragment = new FragmenHome();
                        break;
                    }
                    case 2: {
                        fragment = new FragmenSettings();
                        break;
                    }
                }
                getSupportFragmentManager().beginTransaction().replace(R.id.frameLayout, fragment).commit();
            }
        });

        bottomNavigation.setOnClickMenuListener(new MeowBottomNavigation.ClickListener() {
            @Override
            public void onClickItem(MeowBottomNavigation.Model item) {
            }
        });

        bottomNavigation.setOnReselectListener(new MeowBottomNavigation.ReselectListener() {
            @Override
            public void onReselectItem(MeowBottomNavigation.Model item) {
            }
        });
    }

    private void checkFloatingPermission() {
        //Check if the application has draw over other apps permission or not?
        //This permission is by default available for API<23. But for API > 23
        //you have to ask for the permission in runtime.
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !Settings.canDrawOverlays(this)) {

            //If the draw over permission is not available open the settings screen
            //to grant the permission.
            AlertDialog.Builder temp = new AlertDialog.Builder(this);
            temp.setMessage("Display overlay permission for floating widget");
            temp.setCancelable(false);
            temp.setPositiveButton("OK", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
                            Uri.parse("package:" + getPackageName()));
                    startActivityForResult(intent, CODE_DRAW_OVER_OTHER_APP_PERMISSION);
                }
            });
            temp.show();

        } else {
            checkReadWritePermission();
            Toast.makeText(this, "floting permission already given", Toast.LENGTH_SHORT).show();
            //initializeView();
        }
    }

    private void initializeView() {
        startService(new Intent(MainActivity.this, FloatingViewService.class));
    }

    private boolean checkSelfPermission(String permission, int requestCode) {
        if (ContextCompat.checkSelfPermission(this, permission) != PackageManager.PERMISSION_GRANTED) {
            ActivityCompat.requestPermissions(this, new String[]{permission}, requestCode);
            return false;
        }
        return true;
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        switch (requestCode) {
            case PERMISSION_REQ_ID_RECORD_AUDIO:
                if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                    checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE, PERMISSION_REQ_ID_WRITE_EXTERNAL_STORAGE);
                } else {
                    hasPermissions = false;
                }
                break;

            case PERMISSION_REQ_ID_WRITE_EXTERNAL_STORAGE:
                if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                    hasPermissions = true;
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                        //startRecordingScreen();
                    }
                } else {
                    hasPermissions = false;
                }
                MediaProjectionManager mediaProjectionManager = (MediaProjectionManager) getSystemService(Context.MEDIA_PROJECTION_SERVICE);
                Intent permissionIntent = mediaProjectionManager != null ? mediaProjectionManager.createScreenCaptureIntent() : null;
                startActivityForResult(permissionIntent, 101);
                setNavBar();
                bottomNavigation.show(1, true);
                setFAB();
                getAllFiles();
                break;

            default:
                break;
        }
    }

    public void startRecordingScreen() {
        if (recorder.isBusyRecording()) {
            recorder.stopScreenRecording();
        }
        recorder.startScreenRecording(data2, id, this);

    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == CODE_DRAW_OVER_OTHER_APP_PERMISSION) {
            //Check if the permission is granted or not.
            if (resultCode == RESULT_OK) {
                initializeView();
                //checkReadWritePermission();
            } else { //Permission is not available
                initializeView();
                checkReadWritePermission();
            }
        }

        if (requestCode == 101) {
            if (resultCode == RESULT_OK) {
                data2 = data;
                id = resultCode;
            }
        }
    }

    @Override
    public void HBRecorderOnStart() {
        Toast.makeText(this, "recording start", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void HBRecorderOnComplete() {
        Toast.makeText(this, "file saved at:   " + recorder.getFilePath(), Toast.LENGTH_LONG).show();
    }

    @Override
    public void HBRecorderOnError(int errorCode, String reason) {
        Toast.makeText(this, "recording error", Toast.LENGTH_SHORT).show();
    }

    private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
        @RequiresApi(api = Build.VERSION_CODES.N)
        @Override
        public void onReceive(Context context, Intent intent) {
            //Toast.makeText(MainActivity.this, "worked worked yo yo", Toast.LENGTH_SHORT).show();
            int type = intent.getIntExtra("type", 0);
            if (type == START_RECORDING) {
                if (checkSelfPermission(Manifest.permission.RECORD_AUDIO, PERMISSION_REQ_ID_RECORD_AUDIO) && checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE, PERMISSION_REQ_ID_WRITE_EXTERNAL_STORAGE)) {
                    hasPermissions = true;
                }
                if (hasPermissions) {
                    startRecordingScreen();
                }
            } else if (type == STOP_RECORDING)
                recorder.stopScreenRecording();

            else if (type == PAUSE_RECORDING) {
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
                    recorder.pauseScreenRecording();
                    Toast.makeText(MainActivity.this, "Recording paused", Toast.LENGTH_SHORT).show();
                }
            } else if (type == RESUME_RECORDING) {
                recorder.resumeScreenRecording();
                Toast.makeText(MainActivity.this, "Recording resumed", Toast.LENGTH_SHORT).show();
            } else if (type == TAKE_SS) {
                Toast.makeText(MainActivity.this, "Screen Shot", Toast.LENGTH_SHORT).show();
                //saveBitmap(takeScreenshot());
            } else if (type == RECORD_AUDIO) {
                if (audio) {
                    recorder.isAudioEnabled(false);
                    audio = false;
                } else {
                    recorder.isAudioEnabled(true);
                    audio = true;
                }
            }
        }
    };


    private Bitmap takeScreenshot() {
        View rootView = findViewById(android.R.id.content).getRootView();
        rootView.setDrawingCacheEnabled(true);
        return rootView.getDrawingCache();
    }

    public void saveBitmap(Bitmap bitmap) {
        File imagePath = new File(Environment.getExternalStorageDirectory() + "/screenshot.png");
        FileOutputStream fos;
        try {
            fos = new FileOutputStream(imagePath);
            bitmap.compress(Bitmap.CompressFormat.PNG, 100, fos);
            fos.flush();
            fos.close();
        } catch (FileNotFoundException e) {
            Log.e("GREC", e.getMessage(), e);
        } catch (IOException e) {
            Log.e("GREC", e.getMessage(), e);
        }
    }

    @Override
    public void onResume() {
        super.onResume();
        registerReceiver(broadcastReceiver, new IntentFilter(
                FloatingViewService.BROADCAST_ACTION));
    }


}

Source: Android Questions

LEAVE A COMMENT