CodeMinion / another_brother

Another Brother Flutter SDK
BSD 3-Clause "New" or "Revised" License
21 stars 19 forks source link

Issues getting started 5.12.23 on iOS #48

Closed mikhael28 closed 1 year ago

mikhael28 commented 1 year ago

Hi there! I'm looking at using the another_brother package to integrate with Brother's printing SDKs - having some issues pop up, would love to post them here for others to potentially chime in. It's probably a pain, but my environment is sort of bleeding edge on the dependency side.

Flutter doctor (verbose)

[✓] Flutter (Channel stable, 3.10.0, on macOS 13.3.1 22E772610a darwin-arm64, locale en-US)
    • Flutter version 3.10.0 on channel stable at /Users/mikhael-cedar/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 84a1e904f4 (3 days ago), 2023-05-09 07:41:44 -0700
    • Engine revision d44b5a94c9
    • Dart version 3.0.0
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/mikhael-cedar/Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E222b
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.78.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.64.0

[✓] Connected device (4 available)
    • Android SDK built for arm64 (mobile) • emulator-5554                        • android-arm64  • Android 10 (API 29) (emulator)
    • iPad Air (5th generation) (mobile)   • D38CC173-E764-4BEB-B799-D4EA8D95BBE6 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-4
      (simulator)
    • macOS (desktop)                      • macos                                • darwin-arm64   • macOS 13.3.1 22E772610a darwin-arm64
    • Chrome (web)                         • chrome                               • web-javascript • Google Chrome 113.0.5672.92

[✓] Network resources
    • All expected network resources are available.

MacOS Ventura 13.3.1a 14' M1 Pro (Apple Silicon) XCode Version 14.3 (14E222b) Gradle v8 Latest stable 3.10.0 Flutter

flutter --version
Flutter 3.10.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 84a1e904f4 (3 days ago) • 2023-05-09 07:41:44 -0700
Engine • revision d44b5a94c9
Tools • Dart 3.0.0 • DevTools 2.23.1

Steps to Reproduce:

  1. Fork the demo prime(https://github.com/CodeMinion/Demo-Another-Brother-Prime) and clone to local machine.
  2. cd into the repository, and clone the another brother repository directly into the codebase (with 0.0.34, which was just merged in a few hours ago).
  3. Run flutter pub get, which works just fine. Below is the output of transitive dependencies.
    [Demo-Another-Brother-Prime] flutter pub get
    Resolving dependencies...
    * another_brother 0.0.34 from path another_brother (was 0.0.30 from path ../another_brother)
    > async 2.11.0 (was 2.9.0)
    > boolean_selector 2.1.1 (was 2.1.0)
    > characters 1.3.0 (was 1.2.1)
    > collection 1.17.1 (was 1.16.0)
    convert 3.0.2 (3.1.1 available)
    ffi 2.0.1 (2.0.2 available)
    fixnum 1.0.1 (1.1.0 available)
    flutter_blue_plus 1.3.1 (1.4.0 available)
    flutter_lints 1.0.4 (2.0.1 available)
    + js 0.6.7
    lints 1.0.1 (2.1.0 available)
    > matcher 0.12.15 (was 0.12.12) (0.12.16 available)
    > material_color_utilities 0.2.0 (was 0.1.5) (0.5.0 available)
    > meta 1.9.1 (was 1.8.0)
    > path 1.8.3 (was 1.8.2)
    path_provider 2.0.11 (2.0.15 available)
    path_provider_android 2.0.20 (2.0.27 available)
    path_provider_linux 2.1.7 (2.1.10 available)
    path_provider_macos 2.0.6 (2.0.7 available)
    path_provider_platform_interface 2.0.4 (2.0.6 available)
    path_provider_windows 2.1.3 (2.1.6 available)
    permission_handler 8.3.0 (10.2.0 available)
    permission_handler_platform_interface 3.7.0 (3.9.0 available)
    plugin_platform_interface 2.1.3 (2.1.4 available)
    rxdart 0.27.5 (0.27.7 available)
    > source_span 1.9.1 (was 1.9.0) (1.10.0 available)
    > stack_trace 1.11.0 (was 1.10.0)
    > stream_channel 2.1.1 (was 2.1.0)
    > string_scanner 1.2.0 (was 1.1.1)
    > test_api 0.5.1 (was 0.4.12) (0.5.2 available)
    typed_data 1.3.1 (1.3.2 available)
    > vector_math 2.1.4 (was 2.1.2)
    win32 3.0.0 (5.0.0 available)
    xdg_directories 0.2.0+2 (1.0.0 available)
    Changed 16 dependencies!
    exit code 0
  4. flutter run with an iOS simulator running from XCode yields this error.
    (base) mikhael-cedar@Mikhaeks-MBP Demo-Another-Brother-Prime % flutter run
    Launching lib/main.dart on iPad Air (5th generation) in debug mode...
    Updating project for Xcode compatibility.
    Upgrading project.pbxproj
    Upgrading Runner.xcscheme
    Upgrading Info.plist
    Removing script build phase dependency analysis.
    Adding input path to Thin Binary build phase.
    Running pod install...                                             975ms
    Running Xcode build...                                                  
    Xcode build done.                                            5.0s
    Failed to build iOS app
    Error (Xcode): Building for iOS Simulator, but linking in dylib built for iOS,
    file '/Users/mikhael-cedar/Workspace/Demo-Another-Brother-Prime/ios/Pods/BRLMPrinter
    Kit/BRLMPrinterKit/BRLMPrinterKit.framework/BRLMPrinterKit' for architecture arm64
    Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)
    Could not build the application for the simulator.
    Error launching application on iPad Air (5th generation).
  5. It was at this point in time, I thought about checking in to see how the Android build would be going.
    
    (base) mikhael-cedar@Mikhaeks-MBP Demo-Another-Brother-Prime % flutter run
    Connected devices:
    Android SDK built for arm64 (mobile) • emulator-5554                        •
    android-arm64 • Android 10 (API 29) (emulator)
    iPad Air (5th generation) (mobile)   • D38CC173-E764-4BEB-B799-D4EA8D95BBE6 •
    ios           • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)

Checking for wireless devices...

[1]: Android SDK built for arm64 (emulator-5554) [2]: iPad Air (5th generation) (D38CC173-E764-4BEB-B799-D4EA8D95BBE6) Please choose one (or "q" to quit): 1 Using hardware rendering with device Android SDK built for arm64. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering". Launching lib/main.dart on Android SDK built for arm64 in debug mode... Upgrading build.gradle

FAILURE: Build failed with an exception.

BUILD FAILED in 6s Running Gradle task 'assembleDebug'... 7.5s

┌─ Flutter Fix ───────────────────────────────────────────────────────────────┐ │ [!] Your project's Gradle version is incompatible with the Java version │ │ that Flutter is using for Gradle. │ │ │ │ To fix this issue, first, check the Java version used by Flutter by running │ │ flutter doctor --verbose. │ │ │ │ Then, update the Gradle version specified in │ │ /Users/mikhael-cedar/Workspace/Demo-Another-Brother-Prime/android/gradle/wr │ │ apper/gradle-wrapper.properties to be compatible with that Java version. │ │ See the link below for more information on compatible Java/Gradle versions: │ │ https://docs.gradle.org/current/userguide/compatibility.html#java │ │ │ │ │ └─────────────────────────────────────────────────────────────────────────────┘ Exception: Gradle task assembleDebug failed with exit code 1


6. I upgraded from Gradle 6.7 to the current version I'm using generally, 8 - but got an error. 

FAILURE: Build failed with an exception.

BUILD FAILED in 4s

7. Migrated down to 7.3.3 and the build progressed a lot further, and got to

Launching lib/main.dart on Android SDK built for arm64 in debug mode... Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: unexpected element (uri:"", local:"extension-level"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. warning: [options] source value 7 is obsolete and will be removed in a future release warning: [options] target value 7 is obsolete and will be removed in a future release warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 3 warnings /Users/mikhael-cedar/.pub-cache/hosted/pub.dev/permission_handler-8.3.0/android/src/main/java/com/baseflow/permissionhandler/ServiceManager.java:75: warning: [deprecation] queryIntentActivities(Intent,int) in PackageManager has been deprecated List callAppsList = pm.queryIntentActivities(callIntent, 0); ^ error: warnings found and -Werror specified /Users/mikhael-cedar/.pub-cache/hosted/pub.dev/permission_handler-8.3.0/android/src/main/java/com/baseflow/permissionhandler/PermissionUtils.java:317: warning: [deprecation] getPackageInfo(String,int) in PackageManager has been deprecated .getPackageInfo(context.getPackageName(), PackageManager.GET_PERMISSIONS); ^ 1 error 2 warnings

FAILURE: Build failed with an exception.

BUILD FAILED in 17s Running Gradle task 'assembleDebug'... 17.7s Exception: Gradle task assembleDebug failed with exit code 1

8. I updated the `permission_handler` library to 10.2.0 - and it worked! Build builds! Whether or not it prints I have no idea, because I don't have my printer, but the Android simulator booted the app! When I tried to print something, it asked for permissions to access files, and then it crashed. Here are the logs.

Using hardware rendering with device Android SDK built for arm64. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering". Launching lib/main.dart on Android SDK built for arm64 in debug mode... Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: unexpected element (uri:"", local:"extension-level"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> WARN: Unable to load JNA library (OS: Mac OS X 13.3.1) java.lang.UnsatisfiedLinkError: /Users/mikhael-cedar/Library/Caches/JNA/temp/jna2897125375076643214.tmp: dlopen(/Users/mikhael-cedar/Library/Caches/JNA/temp/jna2897125375076643214.tmp, 0x0001): tried: '/Users/mikhael-cedar/Library/Caches/JNA/temp/jna2897125375076643214.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/mikhael-cedar/Library/Caches/JNA/temp/jna2897125375076643214.tmp' (no such file), '/Users/mikhael-cedar/Library/Caches/JNA/temp/jna2897125375076643214.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64')) at java.base/jdk.internal.loader.NativeLibraries.load(Native Method) at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(Unknown Source) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source) at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source) at java.base/java.lang.Runtime.load0(Unknown Source) at java.base/java.lang.System.load(Unknown Source) at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018) at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988) at com.sun.jna.Native.(Native.java:195) at com.intellij.jna.JnaLoader.load(JnaLoader.java:16) at com.intellij.jna.JnaLoader.isLoaded(JnaLoader.java:29) at com.intellij.openapi.util.io.FileSystemUtil.getMediator(FileSystemUtil.java:54) at com.intellij.openapi.util.io.FileSystemUtil.(FileSystemUtil.java:46) at com.intellij.openapi.vfs.impl.ZipHandler.setFileAttributes(ZipHandler.java:62) at com.intellij.openapi.vfs.impl.ZipHandler$1.createAccessor(ZipHandler.java:44) at com.intellij.openapi.vfs.impl.ZipHandler$1.createAccessor(ZipHandler.java:39) at com.intellij.util.io.FileAccessorCache.createHandle(FileAccessorCache.java:61) at com.intellij.util.io.FileAccessorCache.get(FileAccessorCache.java:54) at com.intellij.openapi.vfs.impl.ZipHandler.getCachedZipFileHandle(ZipHandler.java:84) at com.intellij.openapi.vfs.impl.ZipHandler.acquireZipHandle(ZipHandler.java:131) at com.intellij.openapi.vfs.impl.ZipHandlerBase.createEntriesMap(ZipHandlerBase.java:47) at com.intellij.openapi.vfs.impl.ArchiveHandler.getEntriesMap(ArchiveHandler.java:183) at com.intellij.openapi.vfs.impl.jar.CoreJarHandler.(CoreJarHandler.java:42) at com.intellij.openapi.vfs.impl.jar.CoreJarFileSystem.lambda$new$0(CoreJarFileSystem.java:33) at com.intellij.util.containers.ConcurrentFactoryMap$2.create(ConcurrentFactoryMap.java:181) at com.intellij.util.containers.ConcurrentFactoryMap.get(ConcurrentFactoryMap.java:40) at com.intellij.openapi.vfs.impl.jar.CoreJarFileSystem.findFileByPath(CoreJarFileSystem.java:44) at com.intellij.core.JavaCoreProjectEnvironment.addJarToClassPath(JavaCoreProjectEnvironment.java:79) at com.android.tools.lint.UastEnvironment$ProjectEnvironment.registerPaths(UastEnvironment.kt:201) at com.android.tools.lint.gradle.LintExtractAnnotations.extractAnnotations(LintExtractAnnotations.kt:46) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at com.android.tools.lint.gradle.api.ReflectiveLintRunner.extractAnnotations(ReflectiveLintRunner.kt:64) at com.android.build.gradle.tasks.ExtractAnnotations.doTaskAction(ExtractAnnotations.java:218) at com.android.build.gradle.internal.tasks.NonIncrementalTask$taskAction$$inlined$recordTaskAction$1.invoke(AndroidVariantTask.kt:74) at com.android.build.gradle.internal.tasks.NonIncrementalTask$taskAction$$inlined$recordTaskAction$1.invoke(AndroidVariantTask.kt:34) at com.android.build.gradle.internal.tasks.Blocks.recordSpan(Blocks.java:91) at com.android.build.gradle.internal.tasks.NonIncrementalTask.taskAction(NonIncrementalTask.kt:57) at jdk.internal.reflect.GeneratedMethodAccessor120.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29) at org.gradle.api.internal.tasks.execution.TaskExecution$2.run(TaskExecution.java:239) at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29) at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68) at org.gradle.api.internal.tasks.execution.TaskExecution.executeAction(TaskExecution.java:224) at org.gradle.api.internal.tasks.execution.TaskExecution.executeActions(TaskExecution.java:207) at org.gradle.api.internal.tasks.execution.TaskExecution.executeWithPreviousOutputFiles(TaskExecution.java:190) at org.gradle.api.internal.tasks.execution.TaskExecution.execute(TaskExecution.java:168) at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:89) at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:40) at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:53) at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:50) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73) at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:50) at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:40) at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:68) at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:38) at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48) at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:36) at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41) at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74) at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55) at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51) at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:29) at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:61) at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:42) at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:60) at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:27) at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:188) at org.gradle.internal.execution.steps.BuildCacheStep.lambda$execute$1(BuildCacheStep.java:75) at org.gradle.internal.Either$Right.fold(Either.java:175) at org.gradle.internal.execution.caching.CachingState.fold(CachingState.java:59) at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:73) at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:48) at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:38) at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:27) at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:36) at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:22) at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:109) at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$2(SkipUpToDateStep.java:56) at java.base/java.util.Optional.orElseGet(Unknown Source) at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:56) at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38) at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:73) at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:44) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27) at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:89) at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:50) at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:114) at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:57) at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:76) at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:50) at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:93) at java.base/java.util.Optional.orElseGet(Unknown Source) at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:93) at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38) at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:43) at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:31) at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40) at org.gradle.api.internal.tasks.execution.TaskExecution$3.withWorkspace(TaskExecution.java:284) at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40) at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30) at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37) at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27) at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:44) at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:33) at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:76) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:142) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:131) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:77) at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52) at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:74) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:402) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:389) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:382) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:368) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:61) at java.base/java.lang.Thread.run(Unknown Source) Running Gradle task 'assembleDebug'... 15.0s ✓ Built build/app/outputs/flutter-apk/app-debug.apk. Installing build/app/outputs/flutter-apk/app-debug.apk... 525ms D/FlutterBluePlugin( 3784): onAttachedToEngine D/FlutterBluePlugin( 3784): setup D/FlutterBluePlugin( 3784): onAttachedToActivity Syncing files to device Android SDK built for arm64... 87ms

Flutter run key commands. r Hot reload. 🔥🔥🔥 R Hot restart. h List all available interactive commands. d Detach (terminate "flutter run" but leave application running). c Clear the screen q Quit (terminate the application on the device).

A Dart VM Service on Android SDK built for arm64 is available at: http://127.0.0.1:59601/08NiErDAHnI=/ The Flutter DevTools debugger and profiler on Android SDK built for arm64 is available at: http://127.0.0.1:9102?uri=http://127.0.0.1:59601/08NiErDAHnI=/ D/EGL_emulation( 3784): eglMakeCurrent: 0x7d136bf820: ver 3 0 (tinfo 0x7d1887ff00) D/EGL_emulation( 3784): eglMakeCurrent: 0x7d18248b20: ver 3 0 (tinfo 0x7d18218f40) E/BluetoothAdapter( 3784): Bluetooth binder is null E/AndroidRuntime( 3784): FATAL EXCEPTION: Thread-7 E/AndroidRuntime( 3784): Process: com.rouninlabs.demo_another_brother_prime, PID: 3784 E/AndroidRuntime( 3784): java.lang.NullPointerException: Attempt to invoke virtual method 'android.bluetooth.le.BluetoothLeScanner android.bluetooth.BluetoothAdapter.getBluetoothLeScanner()' on a null object reference E/AndroidRuntime( 3784): at com.brother.ptouch.sdk.BLEDeviceSearcher.startScan(BLEDeviceSearcher.java:41) E/AndroidRuntime( 3784): at com.brother.ptouch.sdk.BLEDeviceSearcher$1.run(BLEDeviceSearcher.java:61) E/BluetoothAdapter( 3784): Bluetooth binder is null I/Process ( 3784): Sending signal. PID: 3784 SIG: 9 Lost connection to device.

ANYWAYS, back to iOS :)

10. Well, same issue. I went ahead and opened XCode and updated the minimum distribution to iOS 11 for all the pods, as Flutter 3.10/XCode 14.3 require this. Same issue, but I'm pretty confident this step is necessary.
11. It seems that the issue is caused by the iOS simulators on Xcode, running on ARM, are somehow not supported - so, following someone's advice on SO I added an addition post_install hook in the Podfile. Full post_install code is below:

post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) target.build_configurations.each do |bc| bc.build_settings['ARCHS[sdk=iphonesimulator*]'] = uname -m end end end

12. This made some progress - the Xcode build built, but the iOS app was not built. Logs here:

(base) mikhael-cedar@Mikhaeks-MBP Demo-Another-Brother-Prime % flutter run Launching lib/main.dart on iPad Air (5th generation) in debug mode... Running pod install... 1,005ms Running Xcode build...
└─Compiling, linking and signing... 3.7s Xcode build done. 14.5s Failed to build iOS app Error (Xcode): Framework not found another_brother Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation) Could not build the application for the simulator. Error launching application on iPad Air (5th generation).

13. Running the build from XCode yielded a slightly different error

Undefined symbols for architecture arm64: "_OBJCCLASS$_BROTHERSDK", referenced from: objc-class-ref in TbStartCommunicationMethodCall.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

14. I then set the simulators to run on Rosetta, X64, and that works - however, i end up getting an error that it cannot find `another_brother` 

Parse Issue (Xcode): Module 'another_brother' not found /Users/mikhael-cedar/Workspace/Demo-Another-Brother-Prime/ios/Runner/GeneratedPluginRegistrant.m:11:8

15. I ran flutter clean, but to no avail. Pod install shows the installation of another brother. 

(base) mikhael-cedar@Mikhaeks-MBP ios % pod install Analyzing dependencies Downloading dependencies Installing BRLMPrinterKit (4.0.2.1) Installing BROTHERSDK (0.1.0) Installing Flutter (1.0.0) Installing Protobuf (3.23.0) Installing another_brother (0.0.1) Installing flutter_blue_plus (0.0.1) Installing path_provider_ios (0.0.1) Installing permission_handler_apple (9.0.4) Generating Pods project Integrating client project Pod installation complete! There are 5 dependencies from the Podfile and 8 total pods installed.

[!] Automatically assigning platform iOS with version 11.0 on target Runner because no platform was specified. Please specify a platform for this target in your Podfile. See https://guides.cocoapods.org/syntax/podfile.html#platform.

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target Runner to Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig or include the Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig in your build configuration (Flutter/Release.xcconfig).


16. I changed another brother before the clean, to go back to pulling from the pub.dev package (0.0.33) instead of locally, as I thought that might be the solution. I think the issue at this point, is that XCode is still expecting another brother to come locally, isntead of remotely. 

Any thoughts on the last step?
CodeMinion commented 1 year ago

Hi @mikhael28 ,

Thanks for reaching out and for the detailed info.

Here are a couple of things that might help:

Thanks again for reaching out. I hope this helps but don't hesitate to reach out if you still running into trouble.

mikhael28 commented 1 year ago

@CodeMinion so, my question is - how can I get around not building for iOS? Is the only option, that I will have to foresake the XCode simulator... forever? Is there a way to conditionally import fake Driver software, so that if I'm not actively using the APIs, that it will import dummy code/driver dependencies?

Because, I would imagine, most developers will not be okay with permanently giving up the Simulator UI.

Another question would be - why are we using the TypeB SDK? Looking at the compatibility list on their website, the ver4.x SDK seems to have much better support for iOS and Android - especially for the QL models, which are what I care about the most.

mikhael28 commented 1 year ago

Well, I've gone ahead and decided to have the app work on a physical device for now. @CodeMinion do you know when 0.0.34 will be merged into the pub.dev release? Also, is there going to be another hackathon this year?

CodeMinion commented 1 year ago

Hi @mikhael28 ,

Glad you got it working. I am currently waiting for some verification on some of the new printers we added (which I do not own) and if those clear we will be publishing to pub.dev soon after.

As for the hackathon I believe there will be, though you should reach out to Linus over Slack for more details. I chat with him from time to time over the slack from last year's hackathon.

mikhael28 commented 1 year ago

Great, ty! I don't have time to compete this year, but I'm happy to a demo to participants of some real world usage in the logistics/international freight space.