Search code examples
flutterdartbluetoothjava-iowindows64

**flutter_blue_plus** This version of %1 is not compatible with the version of >Windows you're running. What should I do?


So this project of mine had flutter_blue plugin in it. And I just switched to flutter_blue_plus. And now I can't run it on my system. And this is the error it shows. And when I checked, it feels like no one else is facing this issue. There's no mention on the flutter_blue_plus package issue list either. And i found some of the similar kind of problems on stackOverflow from years ago. And it seems like they're just android problems. And I'm not an android developer. Another known flutter developer faced the same issue with the original flutter_blue package on M1 pro. And on his device, flutter_blue_plus runs properly. I'm using Windows 11 for my development.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':flutter_blue_plus:generateDebugProto'.

java.io.IOException: Cannot run program "E:\Dev\Gradle\caches\modules-2\files->2.1\com.google.protobuf\protoc\3.18.0\61d7f5d8849eb1c9b86ff07ca3f6172ce904ed4\protoc-3.18.0-osx->x86_64.exe": CreateProcess error=216, This version of %1 is not compatible with the version of >Windows you're running. Check your computer's system information and then contact the software >publisher

I've tried the basic steps, like cleaning and rebuilding project. And here is the device speceficaiton im using. flutter doctor -v.

[√] Flutter (Channel stable, 3.7.0, on Microsoft Windows [Version 10.0.22623.1245], locale en-US)
    • Flutter version 3.7.0 on channel stable at C:\SDK_FILES\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b06b8b2710 (6 days ago), 2023-01-23 16:55:55 -0800
    • Engine revision b24591ed32
    • Dart version 2.19.0
    • DevTools version 2.20.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at C:\SDK_FILES\Android_Studio_Components
    • Platform android-33, build-tools 33.0.1
    • ANDROID_HOME = C:\SDK_FILES\Android_Studio_Components
    • Java binary at: C:\SDK_FILES\Android\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.3.32825.248
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2022.1)
    • Android Studio at C:\SDK_FILES\Android
    • 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 11.0.15+0-b2043.56-8887301)

[√] VS Code (version 1.74.3)
    • VS Code at C:\Users\User\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.58.0

[√] Connected device (4 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • Android 10 (API 29) (emulator)
    • Windows (desktop)                  • windows       • windows-x64    • Microsoft Windows [Version 10.0.22623.1245]
    • Chrome (web)                       • chrome        • web-javascript • Google Chrome 109.0.5414.120
    • Edge (web)                         • edge          • web-javascript • Microsoft Edge 109.0.1518.61

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

• No issues found!

Solution

  • If someone is facing this problem. Or anything that looks familiar to it. You can try checking your gradle.properties file inside your projects android folder. And if there's any line that looks like this

    protoc_platform=osx-x86_64
    

    Try removing it. To my little bit of understanding it's just saying the gradle system to look for the macOs operating system while creating the protoc buffer. And it's not finding it bcz the platform is windows. At least in my case, it was. It can be vice versa.