flutter_blue icon indicating copy to clipboard operation
flutter_blue copied to clipboard

Could not resolve all files for configuration ':flutter_blue:protobufToolsLocator_protoc' Apple M1 chip

Open JAICHANGPARK opened this issue 4 years ago • 11 comments

Execution failed for task ':flutter_blue:generateDebugProto'.
> Could not resolve all files for configuration ':flutter_blue:protobufToolsLocator_protoc'.
   > Could not find protoc-3.11.4-osx-aarch_64.exe (com.google.protobuf:protoc:3.11.4).
     Searched in the following locations:
         https://jcenter.bintray.com/com/google/protobuf/protoc/3.11.4/protoc-3.11.4-osx-aarch_64.exe

JAICHANGPARK avatar Jul 29 '21 00:07 JAICHANGPARK

Same here on M1 and flutter_blue v0.8.0, anyone solved?

Pesta666 avatar Jul 30 '21 08:07 Pesta666

Same here on M1 and flutter_blue v0.8.0, anyone solved?

I created this comment as a solution: https://github.com/protocolbuffers/protobuf/issues/8062#issuecomment-892689597

Maybe I could have been more precise and separate the Mac and other architectures according to this post, but also worked: https://github.com/grpc/grpc-java/issues/7690#issuecomment-784239768

I hope this helps!

Good luck!

vborbely avatar Aug 04 '21 15:08 vborbely

@vborbely it's working perfectly now.

teddichiiwa avatar Aug 19 '21 02:08 teddichiiwa

Hey @vborbely, I still wasn't able to solve this problem for Android for my M1 Mac. Any update on the latest version of macOS Big Sur 11.5.2?

sultan18kh avatar Aug 25 '21 13:08 sultan18kh

Hey @vborbely, I still wasn't able to solve this problem for Android for my M1 Mac. Any update on the latest version of macOS Big Sur 11.5.2?

I also have this update for Big Sur, but the same solution works for me, what I wrote. What is your problem / error log?

vborbely avatar Aug 26 '21 02:08 vborbely

@vborbely I implemented the first solution but still got the same error regarding protobuf:protoc:3.13.0, it's like my changes to the flutter_blue gradle file aren't reflecting.

Couldn't understand the second solution though. Am I supposed to change that code in the flutter_blue gradle file or my own project's?

Screenshot 2021-08-26 at 11 15 22 AM Screenshot 2021-08-26 at 11 15 12 AM

sultan18kh avatar Aug 26 '21 06:08 sultan18kh

@vborbely I implemented the first solution but still got the same error regarding protobuf:protoc:3.13.0, it's like my changes to the flutter_blue gradle file aren't reflecting.

Couldn't understand the second solution though. Am I supposed to change that code in the flutter_blue gradle file or my own project's?

I checked the versions, and your error clearly says: "Could not find protoc-3.13.0-osx-aarch_64.exe"

In the repo https://repo1.maven.org/maven2/com/google/protobuf/protoc/ the first version, which has the Mac M1 architecture supported is 3.17.3, see image.

kép

So, do the procedure in Android Studio that I provided originally, and set to 3.17.3 in the flutter_blue library build.gradle file. I think a "flutter clean" will reset your changes, so don't to that, just a build.

I hope this helped.

vborbely avatar Aug 26 '21 06:08 vborbely

Reloaded Gradle project, restarted Android Studio and VS Code, still the same issue 😔

Screenshot 2021-08-26 at 12 09 37 PM

Edited My bad, I was using flutter_blue as well as flutter_reactive_ble in my project, so I had to make these changes in both. Build Successful Finally! 🙌

sultan18kh avatar Aug 26 '21 07:08 sultan18kh

I have the same problem in M1 Macmini ! Is there any issue? Thanks very much!

fisherjoe avatar Feb 13 '22 08:02 fisherjoe

use flutter_blue_plus

boskokg avatar Feb 13 '22 23:02 boskokg

Please update the protobuf section in build.gradle to

import org.apache.tools.ant.taskdefs.condition.Os
// Compatible with macOS on Apple Silicon
def archSuffix = Os.isFamily(Os.FAMILY_MAC) ? ':osx-x86_64' : ''
protobuf {
    protoc {
        artifact = "com.google.protobuf:protoc:3.20.1$archSuffix"
    }
    plugins {
        javalite {
            artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0$archSuffix"
        }
    }
}

Since you are now locked out of artifact = "com.google.protobuf:protoc:3.11.4", I specified in my own project that artifact = "com.google.protobuf:protoc:3.11.4:osx-x86_64" is invalid, which caused me to go to flutter_blue's source code and change it manually, which was really annoying. My development environment is macOS on Apple Silicon.

tenutos avatar Sep 01 '22 08:09 tenutos