TFLITE 插件不适用于 flutter 中的情绪检测应用程序

问题描述 投票:0回答:1

我正在尝试使用

tflite
插件来使用模型进行情绪检测应用程序。但是显示错误。任何帮助将不胜感激。

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\flutter\.pub-cache\hosted\pub.dartlang.org\tflite-1.1.2\android\build.gradle' line: 24

* What went wrong:
A problem occurred evaluating project ':tflite'.
> No signature of method: build_29ou9k6xal0pml6qvuo3exmb2.android() is applicable for argument types: (build_29ou9k6xal0pml6qvuo3exmb2$_run_closure2) values: [build_29ou9k6xal0pml6qvuo3exmb2$_run_closure2@4db06c22]

* Try:
> 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.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
Exception: Gradle task assembleDebug failed with exit code 1
flutter flutter-layout flutter-dependencies flutter-test tflite
1个回答
0
投票

最后,我得到了解决方案。问题出在 Gradle 文件中,必须将其从编译更改为 API,因为 Gradle 7.0 及更高版本的新实现应更改为 API 或实现,compile =api.

您将在 Windows 的这个位置找到该文件:

C:\Users\[your username]\AppData\Local\Pub\Cache\hosted\pub.dev\tflite-1.1.2\android\build.gradle 

或者你可以使用相对路径:

%AppData%\Local\Pub\Cache\hosted\pub.dev\tflite-1.1.2\android\build.gradle
© www.soinside.com 2019 - 2024. All rights reserved.