1

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!
Hippo Fish
  • 416
  • 2
  • 9
  • Based on the error message you received it looks to me as if you used a protobuf version for MacOS, but you are working on windows: `protoc-3.18.0-osx->x86_64.exe` It tells you that it can't use the osx build on x86_64 – Michael Kotzjan Jan 30 '23 at 07:04
  • @MichaelKotzjan What are you saying, even if it's possible (why i think it's possible bcz that package was added to the project by a mac user) i removed the package cleaned the whole project. then added it again. Still that didn't fixed it. So I don't know how that might have happened and how i can fix it. And is there any way to fix it? – Hippo Fish Jan 30 '23 at 08:23
  • I'm not experienced with flutter_blue_plus, but you could check if the path (`E:\Dev\Gradle\caches\modules-2\files->2.1\com.google.protobuf\protoc\3.18.0\61d7f5d8849eb1c9b86ff07ca3f6172ce904ed4\` in your error message) actually contains a windows executable. Is protobuf added by flutter_blue_plus? – Michael Kotzjan Jan 30 '23 at 08:36
  • 2
    Thank you so much for your time and help @MichaelKotzjan. We found the issue and it was really silly. So when that member of my team got into a similar problem on his mac he tried different ways to fix it. And one of the things he did is added this line `protoc_platform=osx-x86_64` to the `gradle.properties` file. And after removing this line that issue was fixed on my device. And on that mac after updating some stuffs that issue also got fixed. So thank you so much for your kind information and help – Hippo Fish Jan 30 '23 at 14:07
  • 2
    Glad you found it! Keep in mind that you are allowed to answer (and accept it) your own question. This way future readers can find the solution easier :) – Michael Kotzjan Jan 30 '23 at 14:49
  • 1
    Wow. I didn't know that. Thank you for the suggestion. And yes, I think a highlighted answer will be better for anyone seeking help from my dumb experience rather than these comments. So I am doing it. But again man. Thanks to you. – Hippo Fish Feb 14 '23 at 16:39

1 Answers1

2

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.

Hippo Fish
  • 416
  • 2
  • 9