The flash is part of the camera system.
Only one app is allowed run the camera system at a time.
Which phone?
Which version of android?
Which carrier?
Is your flashlight app the one pre-installed on the phone or a third-party app from the app store?
With the camera app not working, and the flashlight app reporting that the hardware is in use, you may need to take the phone to a repair shop for some hardware diagnostics.
Hopefully someone with a bit more experience will be by to comment a bit more.