我的 Flutter 应用程序运行良好,直到我停止成功构建时为止
android/app/src/main/kotlin/com/apps/myapp/MainActivity.kt 文件
package com.apps.myapp
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
控制台
Built build/app/outputs/repo.
Building plugin workmanager...
✓ Built build/app/outputs/repo.
e: /home/apps/myapp/android/app/src/main/kotlin/com/apps/myapp/MainActivity.kt: (3, 19): Unresolved reference: embedding
e: /home/apps/myapp/android/app/src/main/kotlin/com/apps/myapp/MainActivity.kt: (5, 21): Unresolved reference: FlutterActivity
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Compilation error. See log for more details
* 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.
请帮助解决此问题!谢谢。
答案 0 :(得分:0)
确保您至少使用 flutter 2.2.2。我遇到了同样的问题,但我能够通过以下方式解决它:
pubspec.yaml
中的所有 flutter 插件答案 1 :(得分:0)
我找到了解决方案。就我而言,问题是由 "title": {
"mapping": {
"analyzer": "mmc_custom",
"index": "analyzed",
"store": "true",
"term_vector": "with_positions_offsets",
"type": "string"
}
}
包引起的。我通过使用 location: ^1.4.1
的替代包解决了这个问题。我希望这也能帮助别人,祝你好运。