Apparence-io / CamerAwesome

📸 Embedding a camera experience within your own app shouldn't be that hard. A flutter plugin to integrate awesome Android / iOS camera experience.
https://ApparenceKit.dev
MIT License
910 stars 199 forks source link

Unable to establish connection on channel on OnePlus and Sony device #399

Open FantaMagier opened 8 months ago

FantaMagier commented 8 months ago

Steps to Reproduce

Run the code on the specific devices: It works on other devices without problems. Only this two devices have the Problem. The "mobile_scanner" Flutter plugin, which also uses CameraX, works on these devices. Version: camerawesome: ^2.0.0-dev.1

CameraAwesomeBuilder.previewOnly(
        onImageForAnalysis: (img) =>
            barcodeProcessing.handleBarcodeImage(img, context),
        imageAnalysisConfig: AnalysisConfig(
          androidOptions: const AndroidAnalysisOptions.nv21(
            width: 1024,
          ),
          maxFramesPerSecond: 5,
          autoStart: true,
        ),
        progressIndicator: const CameraLoadingWidget(),
        builder: (cameraModeState, previewSize, previewRect) {
          return Column(
            mainAxisAlignment: MainAxisAlignment.end,
            crossAxisAlignment: CrossAxisAlignment.end,
            children: [
              CameraFlashButton(state: cameraModeState),
              // const CameraSwitchModeButton(),
            ],
          );
        },
      ),

Expected results

Camera Preview and Image analysis to scan Barcodes

Actual results

Stuck on loading only see the progressIndicator

PlatformException: PlatformException(channel-error, Unable to establish connection on channel., null, null) File "pigeon.dart", line 751, in CameraInterface.setupCamera File "preparing_camera_state.dart", line 194, in PreparingCameraState._init File "preparing_camera_state.dart", line 159, in PreparingCameraState._startPreviewMode File "preparing_camera_state.dart", line 40, in PreparingCameraState.start ... (2 additional frame(s) were not displayed)

About your device

Brand Model OS
OnePlus 8 Pro Android 11
Sony Xperia 1 IV Android 13

Your flutter version

Flutter 3.13.6 • channel stable • https://github.com/flutter/flutter.git Framework • revision ead455963c (4 weeks ago) • 2023-09-26 18:28:17 -0700 Engine • revision a794cf2681 Tools • Dart 3.1.3 • DevTools 2.25.0

g-apparence commented 8 months ago

I have to update the CameraX version. Can you update it and make a another try?

FantaMagier commented 8 months ago

I have not managed to increase the version of CameraX. But I tested the version camerawesome 1.4.0 and there the camera works on the devices.