Protobuf Gradle 插件版本 0.8.6 及更高版本 vs Project 'flutter_blue' 使用版本 0.8.3

Dav*_*vid 3 gradle flutter

使用:

  • VS 代码:1.29.1
  • 颤振:1.0.0
  • 颤振蓝:0.4.1
  • 使用 flutter_blue/example

启动调试器时,我得到:

Error running Gradle:
ProcessException: Process "C:\Development\flutter\bluetooth_example\android\gradlew.bat" exited abnormally:
Configure project :flutter_blue
The com.google.protobuf plugin was already applied to the project: :flutter_blue and will not be applied again after plugin: android-library

FAILURE: Build failed with an exception.
* What went wrong:
The Android Gradle plugin supports only Protobuf Gradle plugin version 0.8.6 and higher. Project 'flutter_blue' is using version 0.8.3.
Run Code Online (Sandbox Code Playgroud)

有什么建议吗?

谢谢

Yon*_*kee 5

我创建了一个拉取请求来解决这个问题。

https://github.com/pauldemarco/flutter_blue/pull/147

这是 flutter_blue 包中的 build.gradle 文件中所需的更改。

 dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.3' <- Remove
        classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.6' <-- Add
    }
Run Code Online (Sandbox Code Playgroud)

您可以通过将版本编辑为 8.3.6 来手动执行此操作,尽管您可能还需要更新项目清单文件中的 minSDK 版本。