繁体   English   中英

为属性 '$4' 指定的 Flutter (Barcode_scan) build\barcode_scan\extracted-protos\main' 不存在

[英]Flutter (Barcode_scan) build\barcode_scan\extracted-protos\main' specified for property '$4' does not exist

我正在使用这个package 来扫描二维码。 但我升级到 3.x 版本,有错误:

[   +2 ms] FAILURE: Build failed with an exception.
[   +2 ms] * What went wrong:
[        ] Some problems were found with the configuration of task ':barcode_scan:generateDebugProto'.
[        ] > Directory '<projectName>\build\barcode_scan\extracted-protos\main' specified for property '$4' does not exist.
[  +19 ms] * Try:
[  +17 ms] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

我尝试将main文件夹添加到extracted-protos ,但是当我运行应用程序时,这个文件夹丢失了。

在花了 2 天时间试图修复它之后。 最后我想出了如何:

Go 到android文件夹 > build.gradle文件。 添加行后:

buildscript {
ext.kotlin_version = '1.3.61'
repositories {
    google()
    jcenter()
}

dependencies {
    classpath 'com.android.tools.build:gradle:3.5.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.12' //add this line
  }
}

它工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM