App crash with google_mlkit_barcode_scanning: ^0.8.0
Tested on iOS(iPhone X- 16.5.1)
[ServicesDaemonManager] interruptionHandler is called. -[FontServicesDaemonManager connection]_block_invoke
*** Terminating app due to uncaught exception 'NSMallocException', reason: 'Failed to grow buffer'
*** First throw call stack:
(0x19644948c 0x18f731050 0x1965dc5ec 0x1965d4528 0x1964c31e0 0x190834488 0x19081ee44 0x110bd6ad0 0x196452d10 0x110bd6b84 0x110bd6b30 0x196452d10 0x110bd6b84 0x110bd6788 0x110bd7af0 0x110bd3b60 0x19d1ea7a8 0x19d1eb780 0x19d1cce10 0x19d1cca88 0x1964d1a2c 0x1964b56c8 0x1964b9da0 0x1cd7b7998 0x19874efd8 0x19874ec50 0x107d1d2b4 0x1b3c0f344)
libc++abi: terminating due to uncaught exception of type NSException
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x00000001d0e95158 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`:
-> 0x1d0e95158 <+8>: b.lo 0x1d0e95174 ; <+36>
0x1d0e9515c <+12>: stp x29, x30, [sp, #-0x10]!
0x1d0e95160 <+16>: mov x29, sp
0x1d0e95164 <+20>: bl 0x1d0e90b30 ; cerror_nocancel
Target 0: (Runner) stopped.
Lost connection to device.
[✓] Flutter (Channel stable, 3.10.3, on macOS 13.0.1 22A400 darwin-arm64, locale en-NP) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc3) [✓] Xcode - develop for iOS and macOS (Xcode 14.3.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.2) [✓] VS Code (version 1.80.1)
Podfile
$iOSVersion = '14.0'
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=*]"] = "armv7"
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = $iOSVersion
end
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
....
if Gem::Version.new($iOSVersion) > Gem::Version.new(config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'])
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = $iOSVersion
end
end
...
end
end
end
end
class _QrCameraViewState extends State<QrCameraView> {
static List<CameraDescription> _cameras = [];
CameraController? _controller;
int _cameraIndex = -1;
double _currentZoomLevel = 1.0;
double _minAvailableZoom = 1.0;
double _maxAvailableZoom = 1.0;
double _minAvailableExposureOffset = 0.0;
double _maxAvailableExposureOffset = 0.0;
double _currentExposureOffset = 0.0;
bool _changingCameraLens = false;
@override
void initState() {
super.initState();
_initialize();
}
void _initialize() async {
if (_cameras.isEmpty) {
_cameras = await availableCameras();
}
for (var i = 0; i < _cameras.length; i++) {
if (_cameras[i].lensDirection == widget.initialCameraLensDirection) {
_cameraIndex = i;
break;
}
}
if (_cameraIndex != -1) {
unawaited(_startLiveFeed());
}
}
@override
void dispose() {
_stopLiveFeed();
super.dispose();
}
@override
Widget build(BuildContext context) {
if (_cameras.isEmpty) return Container();
if (_controller == null) return Container();
if (_controller?.value.isInitialized == false) return Container();
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.background,
appBar: AppBar(
title: Text(
widget.title,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.appBar,
),
leading: const BackLeadingButton(),
backgroundColor: Theme.of(context).colorScheme.background,
),
body: ColoredBox(
color: Theme.of(context).colorScheme.background,
child: Center(
child: _changingCameraLens
? Container()
: CameraPreview(
_controller!,
child: CustomPaint(
painter: BlurPainter(),
child: Container(),
),
),
),
),
);
}
Future<void> _startLiveFeed() async {
final camera = _cameras[_cameraIndex];
_controller = CameraController(
camera,
// Set to ResolutionPreset.high. Do NOT set it to ResolutionPreset.max because for some phones does NOT work.
ResolutionPreset.high,
enableAudio: false,
imageFormatGroup: Platform.isAndroid
? ImageFormatGroup.nv21
: ImageFormatGroup.bgra8888,
);
await _controller?.initialize().then((_) {
if (!mounted) {
return;
}
_controller?.getMinZoomLevel().then((value) {
_currentZoomLevel = value;
_minAvailableZoom = value;
});
_controller?.getMaxZoomLevel().then((value) {
_maxAvailableZoom = value;
});
_currentExposureOffset = 0.0;
_controller?.getMinExposureOffset().then((value) {
_minAvailableExposureOffset = value;
});
_controller?.getMaxExposureOffset().then((value) {
_maxAvailableExposureOffset = value;
});
_controller?.startImageStream(_processCameraImage).then((value) {
if (widget.onCameraFeedReady != null) {
widget.onCameraFeedReady!();
}
if (widget.onCameraLensDirectionChanged != null) {
widget.onCameraLensDirectionChanged!(camera.lensDirection);
}
});
setState(() {});
});
}
Future<void> _stopLiveFeed() async {
await _controller?.stopImageStream();
await _controller?.dispose();
_controller = null;
}
void _processCameraImage(CameraImage image) {
final inputImage = _inputImageFromCameraImage(image);
if (inputImage == null) return;
widget.onImage(inputImage);
}
final _orientations = {
DeviceOrientation.portraitUp: 0,
DeviceOrientation.landscapeLeft: 90,
DeviceOrientation.portraitDown: 180,
DeviceOrientation.landscapeRight: 270,
};
InputImage? _inputImageFromCameraImage(CameraImage image) {
if (_controller == null) return null;
// get image rotation
// it is used in android to convert the InputImage from Dart to Java: https://github.com/flutter-ml/google_ml_kit_flutter/blob/master/packages/google_mlkit_commons/android/src/main/java/com/google_mlkit_commons/InputImageConverter.java
// `rotation` is not used in iOS to convert the InputImage from Dart to Obj-C: https://github.com/flutter-ml/google_ml_kit_flutter/blob/master/packages/google_mlkit_commons/ios/Classes/MLKVisionImage%2BFlutterPlugin.m
// in both platforms `rotation` and `camera.lensDirection` can be used to compensate `x` and `y` coordinates on a canvas: https://github.com/flutter-ml/google_ml_kit_flutter/blob/master/packages/example/lib/vision_detector_views/painters/coordinates_translator.dart
final camera = _cameras[_cameraIndex];
final sensorOrientation = camera.sensorOrientation;
// print(
// 'lensDirection: ${camera.lensDirection}, sensorOrientation: $sensorOrientation, ${_controller?.value.deviceOrientation} ${_controller?.value.lockedCaptureOrientation} ${_controller?.value.isCaptureOrientationLocked}');
InputImageRotation? rotation;
if (Platform.isIOS) {
rotation = InputImageRotationValue.fromRawValue(sensorOrientation);
} else if (Platform.isAndroid) {
var rotationCompensation =
_orientations[_controller!.value.deviceOrientation];
if (rotationCompensation == null) return null;
if (camera.lensDirection == CameraLensDirection.front) {
// front-facing
rotationCompensation = (sensorOrientation + rotationCompensation) % 360;
} else {
// back-facing
rotationCompensation =
(sensorOrientation - rotationCompensation + 360) % 360;
}
rotation = InputImageRotationValue.fromRawValue(rotationCompensation);
// print('rotationCompensation: $rotationCompensation');
}
if (rotation == null) return null;
// print('final rotation: $rotation');
// get image format
final format = InputImageFormatValue.fromRawValue(image.format.raw as int);
// validate format depending on platform
// only supported formats:
// * nv21 for Android
// * bgra8888 for iOS
if (format == null ||
(Platform.isAndroid && format != InputImageFormat.nv21) ||
(Platform.isIOS && format != InputImageFormat.bgra8888)) return null;
// since format is constraint to nv21 or bgra8888, both only have one plane
if (image.planes.length != 1) return null;
final plane = image.planes.first;
// compose InputImage using bytes
return InputImage.fromBytes(
bytes: plane.bytes,
metadata: InputImageMetadata(
size: Size(image.width.toDouble(), image.height.toDouble()),
rotation: rotation, // used only in Android
format: format, // used only in iOS
bytesPerRow: plane.bytesPerRow, // used only in iOS
),
);
}
}
Crash not happening on iPhone 14 pro max(16.5.1(c))
@bibash28 : is it crashing when scanning the QR code? could you share the QR code as well
No, it is not crashing while scanning. App is crashing after sometime. There is not specific qr code. @fbernaly
@bibash28 : have you try our example app? could you reproduce with our example app? if yes, share detailed steps to reproduce.
Experienced this also. Crash happens after continuously open and close scanner after some 5-8times.
google_mlkit_barcode_scanning: ^0.9.0
Revision: '0'
ABI: 'arm64'
Timestamp: 2023-09-15 17:08:50.476545708+0800
Process uptime: 3114s
Cmdline: com.example.transvirtual
pid: 19547, tid: 9202, name: CameraBackgroun >>> com.example.transvirtual <<<
uid: 10809
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x00000076f67409aa
x0 b4000076dbb42000 x1 00000000703cb810 x2 00000076f67409aa x3 00000000000199aa
x4 00000076f67409aa x5 0000000000000000 x6 0000000000000000 x7 00000078002d7a70
x8 b4000078b4814c00 x9 0000000000000000 x10 000000780086ed18 x11 b400007800a87a50
x12 000000780086eff8 x13 00000078a9ca7a0c x14 0000000000000000 x15 000000780086edac
x16 0000000000000000 x17 0000000000000000 x18 00000076e3260000 x19 b400007800a87000
x20 0000000000000000 x21 b400007800a870c8 x22 b4000076dbb42000 x23 0000000000000000
x24 0000000000000000 x25 00000000000199aa x26 00000000000199a9 x27 00000000ffffff80
x28 00000000ffffff80 x29 0000000000000000
lr 000000009c29feac sp 000000780086eea0 pc 000000789b4f5bb0 pst 0000000080001000
backtrace:
#00 pc 0000000000035bb0 /apex/com.android.art/lib64/libjavacore.so (Memory_peekByte(_JNIEnv*, _jclass*, long)+0) (BuildId: 058a3af6bcbdbcdce4bfe922408e624f)
#01 pc 0000000002004ea8 /memfd:jit-cache (deleted) (art_jni_trampoline+120)
#02 pc 00000000020050d8 /memfd:jit-cache (deleted) (java.nio.DirectByteBuffer.get+72)
#03 pc 00000000020055f8 /memfd:jit-cache (deleted) (java.nio.DirectByteBuffer.get+216)
#04 pc 0000000002006650 /memfd:jit-cache (deleted) (java.nio.ByteBuffer.compareTo+240)
#05 pc 000000000201a114 /memfd:jit-cache (deleted) (io.flutter.plugins.camera.media.ImageStreamReaderUtils.areUVPlanesNV21+644)
#06 pc 000000000201f930 /memfd:jit-cache (deleted) (io.flutter.plugins.camera.media.ImageStreamReaderUtils.yuv420ThreePlanesToNV21+176)
#07 pc 00000000020157ac /memfd:jit-cache (deleted) (io.flutter.plugins.camera.media.ImageStreamReader.parsePlanesForNv21+364)
#08 pc 0000000002012ab8 /memfd:jit-cache (deleted) (io.flutter.plugins.camera.media.ImageStreamReader.onImageAvailable+232)
#09 pc 00000000003605a4 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#10 pc 00000000004906bc /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+1248) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#11 pc 0000000000509f9c /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+780) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#12 pc 00000000003797d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#13 pc 00000000000361b4 [anon:dalvik-classes2.dex extracted in memory from /data/app/~~KaeCdYu770F4L4dAOSaYQg==/com.example.transvirtual-I-2pE2whMevLcToVhz1ToQ==/base.apk!classes2.dex] (io.flutter.plugins.camera.media.ImageStreamReader.lambda$subscribeListener$2$io-flutter-plugins-camera-media-ImageStreamReader+0)
#14 pc 000000000037cde0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#15 pc 0000000000491214 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4152) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#16 pc 0000000000509f9c /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+780) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#17 pc 00000000003797d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#18 pc 0000000000035cd0 [anon:dalvik-classes2.dex extracted in memory from /data/app/~~KaeCdYu770F4L4dAOSaYQg==/com.example.transvirtual-I-2pE2whMevLcToVhz1ToQ==/base.apk!classes2.dex] (io.flutter.plugins.camera.media.ImageStreamReader$$ExternalSyntheticLambda0.onImageAvailable+0)
#19 pc 000000000037cde0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#20 pc 0000000000491214 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4152) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#21 pc 000000000050acac /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+4124) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#22 pc 00000000003797d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#23 pc 00000000003b1b70 /system/framework/framework.jar (android.media.ImageReader$1.run+0)
#24 pc 000000000037cde0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#25 pc 0000000000491214 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4152) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#26 pc 000000000050acac /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+4124) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#27 pc 00000000003797d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#28 pc 00000000001cb9f4 /system/framework/framework.jar (android.os.Handler.handleCallback+0)
#29 pc 000000000037cde0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#30 pc 0000000000491214 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4152) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#31 pc 000000000050a300 /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+1648) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#32 pc 00000000003797d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#33 pc 00000000001cb83c /system/framework/framework.jar (android.os.Handler.dispatchMessage+0)
#34 pc 000000000037cde0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#35 pc 0000000000491214 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4152) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#36 pc 0000000000509f9c /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+780) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#37 pc 00000000003797d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#38 pc 00000000001f097c /system/framework/framework.jar (android.os.Looper.loopOnce+0)
#39 pc 000000000037cde0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#40 pc 0000000000491214 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4152) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#41 pc 000000000050a300 /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+1648) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#42 pc 00000000003797d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#43 pc 00000000001f11c4 /system/framework/framework.jar (android.os.Looper.loop+0)
#44 pc 000000000037cde0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#45 pc 0000000000491214 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4152) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#46 pc 000000000050a300 /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+1648) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#47 pc 00000000003797d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#48 pc 00000000001caed0 /system/framework/framework.jar (android.os.HandlerThread.run+0)
#49 pc 000000000037cde0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#50 pc 000000000037c560 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+672) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#51 pc 0000000000377168 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#52 pc 00000000003605a4 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#53 pc 000000000034b930 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+144) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#54 pc 00000000004f3e38 /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1888) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#55 pc 00000000000eb910 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208) (BuildId: f74e738c3fdb73d042a4e80cb5479864)
#56 pc 000000000007e4c0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: f74e738c3fdb73d042a4e80cb5479864)`
`**Melchors-MacBook-Pro-2 mobile-external-flutter % flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.13.1, on macOS 13.5.2 22G91 darwin-arm64, locale en-PH) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 14.3.1) [✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. [✓] Android Studio (version 2022.3) [✓] VS Code (version 1.82.2) [✓] Connected device (2 available) [✓] Network resources
! Doctor found issues in 1 category. **`
Tried doing steps on sample codes, experienced it also. Just suddenly stop the app, crashed.
Full log:
Launching lib/main.dart on RMX3085 in debug mode...
Running Gradle task 'assembleDebug'...
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
W/FlutterActivityAndFragmentDelegate( 7944): A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps.
Debug service listening on ws://127.0.0.1:53109/C7dhsQuaEf8=/ws
Syncing files to device RMX3085...
D/OplusScrollToTopManager( 7944): com.google_mlkit_example/com.google_mlkit_example.MainActivity,This DecorView@f49b66a[MainActivity] change focus to true
D/BLASTBufferQueue( 7944): [SurfaceView[com.google_mlkit_example/com.google_mlkit_example.MainActivity]#1](f:0,a:1) acquireNextBufferLocked size=1080x2268 mFrameNumber=1 applyTransaction=true mTimestamp=22580871853806(auto) mPendingTransactions.size=0 graphicBufferId=34119220199425 transform=0
D/ProfileInstaller( 7944): Installing profile for com.google_mlkit_example
D/OplusInputMethodManagerInternal( 7944): get inputMethodManager extension: com.android.internal.view.IInputMethodManager$Stub$Proxy@d946b21
I/CameraManagerExtImpl( 7944): getInstance success!
I/CameraManagerExtImpl( 7944): packagename is com.google_mlkit_example
I/OplusCameraManager( 7944): saveOpPackageName, mOpPackageName: com.google_mlkit_example
I/OplusCameraManagerGlobal( 7944): setClientInfo, packageName: com.google_mlkit_example, uid: 10813, pid: 7944
I/OplusCameraManagerGlobal( 7944): Connecting to camera service
I/CameraManagerGlobal( 7944): Connecting to camera service
D/OplusCameraUtils( 7944): new OplusCameraUtils!
I/OplusCameraManagerGlobal( 7944): setClientInfo, packageName: com.google_mlkit_example, uid: 10813, pid: 7944
I/OplusCameraManagerGlobal( 7944): setClientInfo, packageName: com.google_mlkit_example, uid: 10813, pid: 7944
W/FinalizerDaemon( 7944): type=1400 audit(0.0:3391): avc: denied { getopt } for path="/dev/socket/usap_pool_primary" scontext=u:r:untrusted_app:s0:c45,c259,c512,c768 tcontext=u:r:zygote:s0 tclass=unix_stream_socket permissive=0 app=com.google_mlkit_example
D/BufferQueueConsumer( 7944): [](id:1f0800000002,api:0,p:-1,c:7944) connect: controlledByApp=true
I/OplusCameraManagerGlobal( 7944): setClientInfo, packageName: com.google_mlkit_example, uid: 10813, pid: 7944
D/CompatibilityChangeReporter( 7944): Compat change id reported: 206033068; UID 10813; state: ENABLED
D/BufferQueueConsumer( 7944): [](id:1f0800000003,api:0,p:-1,c:7944) connect: controlledByApp=true
D/BufferQueueConsumer( 7944): [](id:1f0800000004,api:0,p:-1,c:7944) connect: controlledByApp=true
I/OplusCameraManagerGlobal( 7944): setClientInfo, packageName: com.google_mlkit_example, uid: 10813, pid: 7944
I/CameraDeviceImplExtImpl( 7944): getInstance success!
I/OplusCameraManagerGlobal( 7944): setClientInfo, packageName: com.google_mlkit_example, uid: 10813, pid: 7944
I/OplusCameraUtils( 7944): current activityName: com.google_mlkit_example.MainActivity
I/OplusCameraUtils( 7944): getComponentName, componentName: com.google_mlkit_example/com.google_mlkit_example.MainActivity, packageName:com.google_mlkit_example, activityName:com.google_mlkit_example.MainActivity
E/CameraManagerGlobal( 7944): Camera 5 is not available. Ignore physical camera status change
E/CameraManagerGlobal( 7944): Camera 6 is not available. Ignore physical camera status change
I/Camera ( 7944): startPreview
I/Camera ( 7944): CameraCaptureSession onConfigured
I/Camera ( 7944): Updating builder settings
D/Camera ( 7944): Updating builder with feature: ExposureLockFeature
D/Camera ( 7944): Updating builder with feature: ExposurePointFeature
D/OplusStatistics--( 7944): newThread.ThreadFactory
D/OplusCamera2StatisticsManager( 7944): addInfo, eventMap: {halLevel=3, cameraId=0, pkgName=com.google_mlkit_example, connentTime=1694769787474, apLevel=2}
D/Camera ( 7944): Updating builder with feature: ZoomLevelFeature
D/Camera ( 7944): Updating builder with feature: AutoFocusFeature
D/Camera ( 7944): Updating builder with feature: NoiseReductionFeature
I/Camera ( 7944): updateNoiseReduction | currentSetting: fast
D/Camera ( 7944): Updating builder with feature: FocusPointFeature
D/Camera ( 7944): Updating builder with feature: ResolutionFeature
D/Camera ( 7944): Updating builder with feature: SensorOrientationFeature
D/Camera ( 7944): Updating builder with feature: FlashFeature
D/Camera ( 7944): Updating builder with feature: ExposureOffsetFeature
D/Camera ( 7944): Updating builder with feature: FpsRangeFeature
I/Camera ( 7944): refreshPreviewCaptureSession
I/Quality ( 7944): SlowBinder: com.google_mlkit_example to android.hardware.camera2.ICameraDeviceUser cost= 233 code= 14
I/Camera ( 7944): startPreviewWithImageStream
I/Camera ( 7944): CameraCaptureSession onConfigured
I/Camera ( 7944): Updating builder settings
D/Camera ( 7944): Updating builder with feature: ExposureLockFeature
D/Camera ( 7944): Updating builder with feature: ExposurePointFeature
D/Camera ( 7944): Updating builder with feature: ZoomLevelFeature
D/Camera ( 7944): Updating builder with feature: AutoFocusFeature
D/Camera ( 7944): Updating builder with feature: NoiseReductionFeature
I/Camera ( 7944): updateNoiseReduction | currentSetting: fast
D/Camera ( 7944): Updating builder with feature: FocusPointFeature
D/Camera ( 7944): Updating builder with feature: ResolutionFeature
D/Camera ( 7944): Updating builder with feature: SensorOrientationFeature
D/Camera ( 7944): Updating builder with feature: FlashFeature
D/Camera ( 7944): Updating builder with feature: ExposureOffsetFeature
D/Camera ( 7944): Updating builder with feature: FpsRangeFeature
I/Camera ( 7944): refreshPreviewCaptureSession
I/Camera ( 7944): CameraCaptureSession onClosed
I/mali_config( 7944): @get_buffer_dataspace_setting: update dataspace from GE (0x00000000 -> 0x08020000)
E/ion ( 7944): ioctl c0044901 failed with code -1: Invalid argument
I/mali_config( 7944): @get_buffer_dataspace_setting: update dataspace from GE (0x00000000 -> 0x08020000)
I/mali_config( 7944): @get_buffer_dataspace_setting: update dataspace from GE (0x00000000 -> 0x08020000)
I/mali_config( 7944): @get_buffer_dataspace_setting: update dataspace from GE (0x00000000 -> 0x08020000)
I/mali_config( 7944): @get_buffer_dataspace_setting: update dataspace from GE (0x00000000 -> 0x08020000)
I/mali_config( 7944): @get_buffer_dataspace_setting: update dataspace from GE (0x00000000 -> 0x08020000)
I/mali_config( 7944): @get_buffer_dataspace_setting: update dataspace from GE (0x00000000 -> 0x08020000)
I/mali_config( 7944): @get_buffer_dataspace_setting: update dataspace from GE (0x00000000 -> 0x08020000)
D/TransportRuntime.JobInfoScheduler( 7944): Scheduling upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) with jobId=322184987 in 30000ms(Backend next call timestamp 1694755632020). Attempt 1
D/CompatibilityChangeReporter( 7944): Compat change id reported: 194532703; UID 10813; state: ENABLED
D/TransportRuntime.JobInfoScheduler( 7944): Scheduling upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) with jobId=327165724 in 86400000ms(Backend next call timestamp 0). Attempt 1
I/DynamiteModule( 7944): Considering local module com.google.mlkit.dynamite.barcode:10000 and remote module com.google.mlkit.dynamite.barcode:0
I/DynamiteModule( 7944): Selected local version of com.google.mlkit.dynamite.barcode
D/TransportRuntime.SQLiteEventStore( 7944): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
D/TransportRuntime.JobInfoScheduler( 7944): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
I/e_mlkit_example( 7944): Background concurrent copying GC freed 4978(372KB) AllocSpace objects, 43(63MB) LOS objects, 49% free, 22MB/45MB, paused 446us,72us total 106.635ms
I/tflite ( 7944): Initialized TensorFlow Lite runtime.
D/TransportRuntime.SQLiteEventStore( 7944): Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
W/libc ( 7944): Access denied finding property "ro.hardware.chipname"
I/tflite ( 7944): Created TensorFlow Lite XNNPACK delegate for CPU.
D/TransportRuntime.JobInfoScheduler( 7944): Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
I/native ( 7944): I0000 00:00:1694769789.056213 24780 oned_decoder_client.cc:695] barhopper::deep_learning::OnedDecoderClient is created successfully.
D/TransportRuntime.SQLiteEventStore( 7944): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
D/TransportRuntime.JobInfoScheduler( 7944): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
D/TransportRuntime.SQLiteEventStore( 7944): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
D/TransportRuntime.JobInfoScheduler( 7944): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
D/TransportRuntime.SQLiteEventStore( 7944): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
D/TransportRuntime.JobInfoScheduler( 7944): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
D/Activity( 7944): dispatchKeyEvent to com.google_mlkit_example.MainActivity@91b022 will call onBackPressed
I/Camera ( 7944): startPreview
I/Camera ( 7944): CameraCaptureSession onConfigured
I/Camera ( 7944): Updating builder settings
D/Camera ( 7944): Updating builder with feature: ExposureLockFeature
D/Camera ( 7944): Updating builder with feature: ExposurePointFeature
D/Camera ( 7944): Updating builder with feature: ZoomLevelFeature
D/Camera ( 7944): Updating builder with feature: AutoFocusFeature
D/Camera ( 7944): Updating builder with feature: NoiseReductionFeature
I/Camera ( 7944): updateNoiseReduction | currentSetting: fast
D/Camera ( 7944): Updating builder with feature: FocusPointFeature
D/Camera ( 7944): Updating builder with feature: ResolutionFeature
D/Camera ( 7944): Updating builder with feature: SensorOrientationFeature
D/Camera ( 7944): Updating builder with feature: FlashFeature
D/Camera ( 7944): Updating builder with feature: ExposureOffsetFeature
D/Camera ( 7944): Updating builder with feature: FpsRangeFeature
I/Camera ( 7944): refreshPreviewCaptureSession
D/TransportRuntime.SQLiteEventStore( 7944): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
I/Camera ( 7944): dispose
I/Camera ( 7944): close
D/TransportRuntime.JobInfoScheduler( 7944): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
E/CameraManagerGlobal( 7944): Camera 5 is not available. Ignore physical camera status change
E/CameraManagerGlobal( 7944): Camera 6 is not available. Ignore physical camera status change
D/BufferQueueConsumer( 7944): [ImageReader-1280x720f21m1-7944-0](id:1f0800000003,api:0,p:-1,c:7944) disconnect
D/BufferQueueConsumer( 7944): [ImageReader-1280x720f23m1-7944-1](id:1f0800000004,api:0,p:-1,c:7944) disconnect
D/BufferQueueConsumer( 7944): [SurfaceTexture-0-7944-0](id:1f0800000002,api:0,p:-1,c:7944) disconnect
I/Camera ( 7944): open | onClosed
D/OplusCamera2StatisticsManager( 7944): addPreviewInfo, eventMap: {halLevel=3, preview_time=7072, face_count=0, cameraId=0, touchxy_value=0,0, pkgName=com.google_mlkit_example, apLevel=2}
D/OplusCamera2StatisticsManager( 7944): addInfo, eventMap: {halLevel=3, cameraId=0, disconnectTime=1694769794546, pkgName=com.google_mlkit_example, connentTime=1694769787474, apLevel=2, timeCost=7072}
I/Camera ( 7944): close
D/BufferQueueConsumer( 7944): [](id:1f0800000005,api:0,p:-1,c:7944) connect: controlledByApp=true
I/OplusCameraManagerGlobal( 7944): setClientInfo, packageName: com.google_mlkit_example, uid: 10813, pid: 7944
D/BufferQueueConsumer( 7944): [](id:1f0800000006,api:0,p:-1,c:7944) connect: controlledByApp=true
D/BufferQueueConsumer( 7944): [](id:1f0800000007,api:0,p:-1,c:7944) connect: controlledByApp=true
I/OplusCameraManagerGlobal( 7944): setClientInfo, packageName: com.google_mlkit_example, uid: 10813, pid: 7944
I/OplusCameraManagerGlobal( 7944): setClientInfo, packageName: com.google_mlkit_example, uid: 10813, pid: 7944
I/OplusCameraUtils( 7944): current activityName: com.google_mlkit_example.MainActivity
I/OplusCameraUtils( 7944): getComponentName, componentName: com.google_mlkit_example/com.google_mlkit_example.MainActivity, packageName:com.google_mlkit_example, activityName:com.google_mlkit_example.MainActivity
E/CameraManagerGlobal( 7944): Camera 5 is not available. Ignore physical camera status change
E/CameraManagerGlobal( 7944): Camera 6 is not available. Ignore physical camera status change
I/Camera ( 7944): startPreview
I/Camera ( 7944): CameraCaptureSession onConfigured
I/Camera ( 7944): Updating builder settings
D/Camera ( 7944): Updating builder with feature: ExposureLockFeature
D/Camera ( 7944): Updating builder with feature: ExposurePointFeature
D/Camera ( 7944): Updating builder with feature: ZoomLevelFeature
D/Camera ( 7944): Updating builder with feature: AutoFocusFeature
D/Camera ( 7944): Updating builder with feature: NoiseReductionFeature
I/Camera ( 7944): updateNoiseReduction | currentSetting: fast
D/Camera ( 7944): Updating builder with feature: FocusPointFeature
D/Camera ( 7944): Updating builder with feature: ResolutionFeature
D/Camera ( 7944): Updating builder with feature: SensorOrientationFeature
D/Camera ( 7944): Updating builder with feature: FlashFeature
D/Camera ( 7944): Updating builder with feature: ExposureOffsetFeature
D/Camera ( 7944): Updating builder with feature: FpsRangeFeature
I/Camera ( 7944): refreshPreviewCaptureSession
D/OplusCamera2StatisticsManager( 7944): addInfo, eventMap: {halLevel=3, cameraId=0, pkgName=com.google_mlkit_example, connentTime=1694769795054, apLevel=2}
I/Quality ( 7944): SlowBinder: com.google_mlkit_example to android.hardware.camera2.ICameraDeviceUser cost= 269 code= 14
I/Camera ( 7944): startPreviewWithImageStream
I/Camera ( 7944): CameraCaptureSession onConfigured
I/Camera ( 7944): Updating builder settings
D/Camera ( 7944): Updating builder with feature: ExposureLockFeature
D/Camera ( 7944): Updating builder with feature: ExposurePointFeature
D/Camera ( 7944): Updating builder with feature: ZoomLevelFeature
D/Camera ( 7944): Updating builder with feature: AutoFocusFeature
D/Camera ( 7944): Updating builder with feature: NoiseReductionFeature
I/Camera ( 7944): updateNoiseReduction | currentSetting: fast
D/Camera ( 7944): Updating builder with feature: FocusPointFeature
D/Camera ( 7944): Updating builder with feature: ResolutionFeature
D/Camera ( 7944): Updating builder with feature: SensorOrientationFeature
D/Camera ( 7944): Updating builder with feature: FlashFeature
D/Camera ( 7944): Updating builder with feature: ExposureOffsetFeature
D/Camera ( 7944): Updating builder with feature: FpsRangeFeature
I/Camera ( 7944): refreshPreviewCaptureSession
I/Camera ( 7944): CameraCaptureSession onClosed
I/DynamiteModule( 7944): Considering local module com.google.mlkit.dynamite.barcode:10000 and remote module com.google.mlkit.dynamite.barcode:0
I/DynamiteModule( 7944): Selected local version of com.google.mlkit.dynamite.barcode
I/native ( 7944): I0000 00:00:1694769795.435826 24790 oned_decoder_client.cc:695] barhopper::deep_learning::OnedDecoderClient is created successfully.
D/TransportRuntime.SQLiteEventStore( 7944): Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
D/TransportRuntime.JobInfoScheduler( 7944): Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
I/mali_config( 7944): @get_buffer_dataspace_setting: update dataspace from GE (0x00000000 -> 0x08020000)
I/mali_config( 7944): @get_buffer_dataspace_setting: update dataspace from GE (0x00000000 -> 0x08020000)
I/mali_config( 7944): @get_buffer_dataspace_setting: update dataspace from GE (0x00000000 -> 0x08020000)
W/System ( 7944): A resource failed to call Surface.release.
W/System ( 7944): A resource failed to call Surface.release.
I/mali_config( 7944): @get_buffer_dataspace_setting: update dataspace from GE (0x00000000 -> 0x08020000)
I/mali_config( 7944): @get_buffer_dataspace_setting: update dataspace from GE (0x00000000 -> 0x08020000)
I/mali_config( 7944): @get_buffer_dataspace_setting: update dataspace from GE (0x00000000 -> 0x08020000)
I/Camera ( 7944): CameraCaptureSession onClosed
W/System ( 7944): A resource failed to call Surface.release.
I/mali_config( 7944): @get_buffer_dataspace_setting: update dataspace from GE (0x00000000 -> 0x08020000)
I/mali_config( 7944): @get_buffer_dataspace_setting: update dataspace from GE (0x00000000 -> 0x08020000)
I/mali_config( 7944): @get_buffer_dataspace_setting: update dataspace from GE (0x00000000 -> 0x08020000)
D/Activity( 7944): dispatchKeyEvent to com.google_mlkit_example.MainActivity@91b022 will call onBackPressed
I/Camera ( 7944): startPreview
I/Quality ( 7944): SlowBinder: com.google_mlkit_example to android.hardware.camera2.ICameraDeviceUser cost= 218 code= 14
I/Camera ( 7944): CameraCaptureSession onConfigured
I/Camera ( 7944): Updating builder settings
D/Camera ( 7944): Updating builder with feature: ExposureLockFeature
D/Camera ( 7944): Updating builder with feature: ExposurePointFeature
D/Camera ( 7944): Updating builder with feature: ZoomLevelFeature
D/Camera ( 7944): Updating builder with feature: AutoFocusFeature
D/Camera ( 7944): Updating builder with feature: NoiseReductionFeature
I/Camera ( 7944): updateNoiseReduction | currentSetting: fast
D/Camera ( 7944): Updating builder with feature: FocusPointFeature
D/Camera ( 7944): Updating builder with feature: ResolutionFeature
D/Camera ( 7944): Updating builder with feature: SensorOrientationFeature
D/Camera ( 7944): Updating builder with feature: FlashFeature
D/Camera ( 7944): Updating builder with feature: ExposureOffsetFeature
D/Camera ( 7944): Updating builder with feature: FpsRangeFeature
I/Camera ( 7944): refreshPreviewCaptureSession
D/TransportRuntime.SQLiteEventStore( 7944): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
I/Camera ( 7944): dispose
I/Camera ( 7944): close
D/TransportRuntime.JobInfoScheduler( 7944): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
E/CameraManagerGlobal( 7944): Camera 5 is not available. Ignore physical camera status change
E/CameraManagerGlobal( 7944): Camera 6 is not available. Ignore physical camera status change
D/BufferQueueConsumer( 7944): [ImageReader-1280x720f21m1-7944-2](id:1f0800000006,api:0,p:-1,c:7944) disconnect
D/BufferQueueConsumer( 7944): [ImageReader-1280x720f23m1-7944-3](id:1f0800000007,api:0,p:-1,c:7944) disconnect
D/BufferQueueConsumer( 7944): [SurfaceTexture-0-7944-1](id:1f0800000005,api:0,p:-1,c:7944) disconnect
F/libc ( 7944): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x76d1f8c3bc in tid 24938 (CameraBackgroun), pid 7944 (e_mlkit_example)
Process name is com.google_mlkit_example, not key_process
keyProcess: 0
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'realme/RMX3085T2/RMX3085L1:13/SP1A.210812.016/R.122d282+220f0:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2023-09-15 17:23:16.968913326+0800
Process uptime: 896s
Cmdline: com.google_mlkit_example
pid: 7944, tid: 24938, name: CameraBackgroun >>> com.google_mlkit_example <<<
uid: 10813
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x00000076d1f8c3bc
x0 b400007883de0b00 x1 00000000703cb810 x2 00000076d1f8c3bc x3 00000000000053bc
x4 00000076d1f8c3bc x5 00000078a9f53fb2 x6 00000076d626e3f0 x7 7f7f7f7f7f7f7f7f
x8 b4000078b4814c00 x9 0000000000000000 x10 00000076d626dc88 x11 b4000076e5794e50
x12 00000076d626df68 x13 00000078a9ca7a0c x14 0000000000000000 x15 00000076d626dd1c
x16 0000000000000000 x17 0000000000000000 x18 00000076d511c000 x19 b4000076e5794400
x20 0000000000000000 x21 b4000076e57944c8 x22 b400007883de0b00 x23 0000000000000000
x24 0000000000000000 x25 00000000000053bc x26 00000000000053bb x27 00000000ffffff85
x28 00000000ffffff85 x29 00000076d626dfe0
lr 000000009c29ba7c sp 00000076d626de10 pc 000000789b4f5bb0 pst 0000000080001000
backtrace:
#00 pc 0000000000035bb0 /apex/com.android.art/lib64/libjavacore.so (Memory_peekByte(_JNIEnv*, _jclass*, long)+0) (BuildId: 058a3af6bcbdbcdce4bfe922408e624f)
#01 pc 0000000002000a78 /memfd:jit-cache (deleted) (art_jni_trampoline+120)
#02 pc 0000000002000ca8 /memfd:jit-cache (deleted) (java.nio.DirectByteBuffer.get+72)
#03 pc 0000000002001418 /memfd:jit-cache (deleted) (java.nio.DirectByteBuffer.get+216)
#04 pc 0000000002002220 /memfd:jit-cache (deleted) (java.nio.ByteBuffer.compareTo+240)
#05 pc 00000000003605a4 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#06 pc 00000000004906bc /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+1248) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#07 pc 0000000000509f9c /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+780) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#08 pc 00000000003797d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#09 pc 000000000001c16c [anon:dalvik-classes2.dex extracted in memory from /data/app/~~-4QM1JaNiN52ntgfQ6Z3xg==/com.google_mlkit_example-WSqzTSK29-fhbcOKM3jrZA==/base.apk!classes2.dex] (io.flutter.plugins.camera.media.ImageStreamReaderUtils.areUVPlanesNV21+0)
#10 pc 000000000037cde0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#11 pc 0000000000491214 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4152) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#12 pc 000000000050a300 /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+1648) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#13 pc 00000000003797d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#14 pc 000000000001c1f8 [anon:dalvik-classes2.dex extracted in memory from /data/app/~~-4QM1JaNiN52ntgfQ6Z3xg==/com.google_mlkit_example-WSqzTSK29-fhbcOKM3jrZA==/base.apk!classes2.dex] (io.flutter.plugins.camera.media.ImageStreamReaderUtils.yuv420ThreePlanesToNV21+0)
#15 pc 000000000037cde0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#16 pc 0000000000491214 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4152) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#17 pc 0000000000509f9c /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+780) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#18 pc 00000000003797d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#19 pc 000000000001c394 [anon:dalvik-classes2.dex extracted in memory from /data/app/~~-4QM1JaNiN52ntgfQ6Z3xg==/com.google_mlkit_example-WSqzTSK29-fhbcOKM3jrZA==/base.apk!classes2.dex] (io.flutter.plugins.camera.media.ImageStreamReader.parsePlanesForNv21+0)
#20 pc 000000000037cde0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#21 pc 0000000000491214 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4152) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#22 pc 0000000000509f9c /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+780) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#23 pc 00000000003797d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#24 pc 000000000001c5d0 [anon:dalvik-classes2.dex extracted in memory from /data/app/~~-4QM1JaNiN52ntgfQ6Z3xg==/com.google_mlkit_example-WSqzTSK29-fhbcOKM3jrZA==/base.apk!classes2.dex] (io.flutter.plugins.camera.media.ImageStreamReader.onImageAvailable+0)
#25 pc 000000000037cde0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#26 pc 0000000000491214 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4152) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#27 pc 0000000000509f9c /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+780) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#28 pc 00000000003797d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#29 pc 000000000001c5a8 [anon:dalvik-classes2.dex extracted in memory from /data/app/~~-4QM1JaNiN52ntgfQ6Z3xg==/com.google_mlkit_example-WSqzTSK29-fhbcOKM3jrZA==/base.apk!classes2.dex] (io.flutter.plugins.camera.media.ImageStreamReader.lambda$subscribeListener$2$io-flutter-plugins-camera-media-ImageStreamReader+0)
#30 pc 000000000037cde0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#31 pc 0000000000491214 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4152) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#32 pc 0000000000509f9c /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+780) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#33 pc 00000000003797d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#34 pc 000000000001c0c8 [anon:dalvik-classes2.dex extracted in memory from /data/app/~~-4QM1JaNiN52ntgfQ6Z3xg==/com.google_mlkit_example-WSqzTSK29-fhbcOKM3jrZA==/base.apk!classes2.dex] (io.flutter.plugins.camera.media.ImageStreamReader$$ExternalSyntheticLambda0.onImageAvailable+0)
#35 pc 000000000037cde0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#36 pc 0000000000491214 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4152) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#37 pc 000000000050acac /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+4124) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#38 pc 00000000003797d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#39 pc 00000000003b1b70 /system/framework/framework.jar (android.media.ImageReader$1.run+0)
#40 pc 000000000037cde0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#41 pc 0000000000491214 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4152) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#42 pc 000000000050acac /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+4124) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#43 pc 00000000003797d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#44 pc 00000000001cb9f4 /system/framework/framework.jar (android.os.Handler.handleCallback+0)
#45 pc 000000000037cde0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#46 pc 0000000000491214 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4152) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#47 pc 000000000050a300 /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+1648) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#48 pc 00000000003797d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#49 pc 00000000001cb83c /system/framework/framework.jar (android.os.Handler.dispatchMessage+0)
#50 pc 000000000037cde0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#51 pc 0000000000491214 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4152) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#52 pc 0000000000509f9c /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+780) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#53 pc 00000000003797d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#54 pc 00000000001f097c /system/framework/framework.jar (android.os.Looper.loopOnce+0)
#55 pc 000000000037cde0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#56 pc 0000000000491214 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4152) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#57 pc 000000000050a300 /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+1648) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#58 pc 00000000003797d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#59 pc 00000000001f11c4 /system/framework/framework.jar (android.os.Looper.loop+0)
#60 pc 000000000037cde0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#61 pc 0000000000491214 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4152) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#62 pc 000000000050a300 /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+1648) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#63 pc 00000000003797d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#64 pc 00000000001caed0 /system/framework/framework.jar (android.os.HandlerThread.run+0)
#65 pc 000000000037cde0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#66 pc 000000000037c560 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+672) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#67 pc 0000000000377168 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#68 pc 00000000003605a4 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#69 pc 000000000034b930 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+144) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#70 pc 00000000004f3e38 /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1888) (BuildId: 3cd43dfd934282c944e52afdac5120fb)
#71 pc 00000000000eb910 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208) (BuildId: f74e738c3fdb73d042a4e80cb5479864)
#72 pc 000000000007e4c0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: f74e738c3fdb73d042a4e80cb5479864)
Lost connection to device.
```
`
I believe something is wrong with using 'ResolutionPreset.high'
Here's my OPPO Reno 5 Pro 5G memory profile on 'ResolutionPreset.medium'
It hover around 390MB-450MB but never more than this. Very stable. No crash at all. The detection is a little janky however.
Now here's my test on 'ResolutionPreset.high'
Note that the memory remain 1.2GB even after i navigated to different page. And the app will crash shortly after on high preset. Clearly there are some kind of memory leak going on here.
Thanks @famasf1 for debugging this. Now that you have narrow down the issue I think you (or any other volunteer) can look at how the image is passed from CameraImage to InputImage and from InputImage to the native version in the FlutterMethodChannels. I think those Image conversion methods need a second pair or eyes, and a refactor.
I have some workload and I wont be able to work on this for a while, but contributions are always welcome.
@fbernaly I can help with this (see https://github.com/flutter-ml/google_ml_kit_flutter/issues/536). As far as I can tell, the Flutter layer for ML Kit is pretty thin: an InputImage is just converted into JSON data, then passed to custom, closed source native code, if I am not mistaken. I don't see code anywhere using Java code and the native InputImage type.
The Flutter source for ImageLabeler.processImage(InputImage) is the following:
https://github.com/flutter-ml/google_ml_kit_flutter/blob/master/packages/google_mlkit_image_labeling/lib/src/image_labeler.dart
Beyond this point, it is not possible to get access to the source code and hence it is not possible to investigate what's being done with InputImage instances.
/// Processes the given image for image labeling, it returns a List of [ImageLabel].
Future<List<ImageLabel>> processImage(InputImage inputImage) async {
final result = await _channel.invokeMethod(
'vision#startImageLabelDetector', <String, dynamic>{
'options': options.toJson(),
'id': id,
'imageData': inputImage.toJson()
});
final imageLabels = <ImageLabel>[];
for (final dynamic json in result) {
imageLabels.add(ImageLabel.fromJson(json));
}
return imageLabels;
}
@andynewman10: what do you mean with beyond that point? That method uses Flutter Method Channels to call native API depending on the platform, this is what is next after calling that method:
- Android: https://github.com/flutter-ml/google_ml_kit_flutter/blob/master/packages/google_mlkit_image_labeling/android/src/main/java/com/google_mlkit_image_labeling/ImageLabelDetector.java
- iOS: https://github.com/flutter-ml/google_ml_kit_flutter/blob/master/packages/google_mlkit_image_labeling/ios/Classes/GoogleMlKitImageLabelingPlugin.m
Here is more info about Flutter Method Channels: https://docs.flutter.dev/platform-integration/platform-channels
@bibash28 can you please set the camera resolutions to low because as per the camera package, image streaming work smoothly on low resolution. Thank you
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.