The error message "Warning: Camera failed" can be just a minor problem or a problem with the hardware itself.
There have been a lot of problems in the past and many were able to fix their issues by performing some troubleshooting procedures.
Here are some ways how you can troubleshoot your Galaxy J7:
Restart Samsung galaxy J7 in Safe Mode and observe if the screen is still flickering
If some third party apps are the reason behind this issue, then this can be found out in this way.
Press and hold the Power button until the Phone options is displayed and then release.
select the Reboot to Safe Mode prompt.
Select Restart and upon restart, Safe mode appears in the lower left of the unlock/home screen.
After the phone starts, observe if the flickering issue is fixed. If this still does not fix the problem, then this might be firmware issue.
If this fixes the issue, then some third party app is affecting the display. Start uninstalling the apps one by one starting from the most recent one.
To do this go to Apps-> Settings-> Application manager-> Select the app-> Uninstall.
Clear the cache and data of the camera app
This procedure will reset the app itself as it deletes cache and data along with your settings and preferences. Follow the below steps to reset:
From Home screen, tap the Apps icon.
Go to Settings-> Applications-> Application manager-> Camera -> Storage -> Clear data and click Ok
Tap on "Clear Cache" to delete the cache.
Do the same for gallery app and see if the problem is fixed.
Hard Reset your phone
If anything of the above options do not work, try to perform hard reset
. It will remove everything from your Samsung J7 and it will reset the settings
to factory defaults. Please follow the below mentioned steps to perform hard reset.
Hold the power button to switch off the handset.
Once the handset is off, press and hold together: Volume Up + Home + Power key for a couple of seconds.
Release held keys when the Samsung Logo appears on the screen and the phone will start in the recovery mode.
Select from Recovery Mode menu "wipe data / factory reset" using Volume buttons to navigate up and down and Power button to confirm your selection.
Choose the option "Yes -- delete all user data" to confirm the reset.
Lastly, select the option "reboot system now" to restart your phone.
If you still face the issue after the reset, this might be a hardware issue and you have to send it for repair.