Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It works on android but not on ios #8

Open
muriloventuroso opened this issue Jul 22, 2022 · 2 comments
Open

It works on android but not on ios #8

muriloventuroso opened this issue Jul 22, 2022 · 2 comments

Comments

@muriloventuroso
Copy link

I'm using this plugin to print receipts on a thermal printer. On Android it works correctly. But not on iOS. The printer is detected and connected, but it gives an error when printing.
I tested the sample code and it also fails to print.

[VERBOSE-2:ui_dart_state.cc(198)] Unhandled Exception: PlatformException(FLUETOOTH_ERROR, The device does not support receiving bytes!, null, null)
#0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
#1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:167:18)
<asynchronous suspension>
#2      _MyAppState._print (package:fluetooth_example/main.dart:142:5)
<asynchronous suspension>
flutter doctor -v
[✓] Flutter (Channel stable, 3.0.5, on macOS 12.5 21G72 darwin-x64, locale en-US)
    • Flutter version 3.0.5 at /Users/muriloventuroso/Downloads/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (9 days ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✗] 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 (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[✓] VS Code (version 1.69.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
    • iPhone (mobile) • 00008030-001C211411E8802E • ios        • iOS 15.5 19F77
    • macOS (desktop) • macos                     • darwin-x64 • macOS 12.5 21G72 darwin-x64

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 2 categories.
@iandis
Copy link
Owner

iandis commented Jul 23, 2022

Hi @muriloventuroso thank you for submitting the issue.

Unfortunately, I couldn't manage to reproduce it on iOS. However, the issue might be because I made the library to only look for devices having .writeWithoutResponse characteristics. So if you wouldn't mind, please try this branch I just pushed that might fix this issue.

@muriloventuroso
Copy link
Author

Unfortunately it didn't work. Same error. Apparently the device does not have the .writeWithoutResponse or .write characteristics.

I installed the POS-Printer app on ios and it works correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants