[ad_1]
Steps to Reproduce
- set flash on
controller.setFlashMode(FlashMode.all the time); - take image on app
- image taked however flash not present, with error Unhandled Exception: CameraException(setFlashModeFailed, Machine doesn’t have flash capabilities)
solely error on IOS (gadget instance iPhone 12 actual gadget), on android is success
this my code
Future<void> initCamera() async {
WidgetsFlutterBinding.ensureInitialized();
_cameras = await availableCameras();
controller = CameraController(_cameras[selectedCameraIdx], ResolutionPreset.max);
_initializeControllerFuture = controller.initialize().then((_) {
if (!mounted) {
return;
}
setState(() {});
}).catchError((Object e) {
if (e is CameraException) {
swap (e.code) {
case 'CameraAccessDenied':
print('Person denied digicam entry.');
break;
default:
print('Deal with different errors.');
break;
}
}
});
if (flashMode == FlashMode.all the time && selectedCameraIdx == 0) {
controller.setFlashMode(FlashMode.all the time);
} else {
controller.setFlashMode(FlashMode.off);
}
}
lib model digicam: ^0.10.0+1
flutter physician -v
[✓] Flutter (Channel steady, 3.3.3, on macOS 12.6 21G115 darwin-x64, locale
en-ID)
• Flutter model 3.3.3 on channel steady at /Customers/person/Paperwork/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 18a827f (4 days in the past), 2022-09-28 10:03:14 -0700
• Engine revision 5c984c26eb
• Dart model 2.18.2
• DevTools model 2.15.0
[✗] Android toolchain - develop for Android gadgets
✗ Unable to find Android SDK.
Set up Android Studio from:
https://developer.android.com/studio/index.html
On first launch it is going to help you in putting in the Android SDK
elements.
(or go to https://flutter.dev/docs/get-started/set up/macos#android-setup
for detailed directions).
If the Android SDK has been put in to a customized location, please use
flutter config --android-sdk to replace to that location.
[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
• Xcode at /Functions/Xcode.app/Contents/Developer
• Construct 14A400
• CocoaPods model 1.11.3
[✓] Chrome - develop for the net
• Chrome at /Functions/Google Chrome.app/Contents/MacOS/Google Chrome
[!] Android Studio (not put in)
• Android Studio not discovered; obtain from
https://developer.android.com/studio/index.html
(or go to https://flutter.dev/docs/get-started/set up/macos#android-setup
for detailed directions).
[✓] VS Code (model 1.71.2)
• VS Code at /Functions/Visible Studio Code.app/Contents
• Flutter extension model 3.48.0
[✓] Linked gadget (3 out there)
• eggy’s iPhone (cellular) • 1f5485a3d742f10c8703ae423589d7882a37f26c • ios
• iOS 12.5.6 16H71
• macOS (desktop) • macos •
darwin-x64 • macOS 12.6 21G115 darwin-x64
• Chrome (net) • chrome •
web-javascript • Google Chrome 106.0.5249.61
! Error: eggy’s iPhone is busy: Fetching debug symbols for eggy’s iPhone.
Xcode will proceed when eggy’s iPhone is completed. (code -10)
[✓] HTTP Host Availability
• All required HTTP hosts can be found
! Physician discovered points in 2 classes.
[ad_2]
