简体   繁体   English

如何修复 Flutter for Android 问题?

[英]How do I fix a Flutter for Android issue?

I'm doing an app in Android Studio, and decided to make a Flutter project since it would help me a lot, but I seem to be running into a problem that I've seen no one have.我正在 Android Studio 中做一个应用程序,并决定制作一个 Flutter 项目,因为它对我有很大帮助,但我似乎遇到了一个我从未见过的问题。 On my MainActivity in the android/app/src/main folder, I have it extend FlutterActivity but it's showing an error, not being able to find io.flutter.embedding.在 android/app/src/main 文件夹中的 MainActivity 上,我扩展了 FlutterActivity 但它显示错误,无法找到 io.flutter.embedding。 When I go to Project Structure, it tells me that I have an invalid item 'Flutter for Android' in the dependencies list of my 'myappname.android' module.当我转到项目结构时,它告诉我我的“myappname.android”模块的依赖项列表中有一个无效的项目“Flutter for Android”。 I have downloaded the Flutter SDK and I have the project pointing there, but other than that I have no idea how to solve this problem.我已经下载了 Flutter SDK 并且我有项目指向那里,但除此之外我不知道如何解决这个问题。 Any ideas?有任何想法吗? Flutter doctor diagnosis, if asked颤振医生诊断,如果被问到

Edit: Provided an image of the errors:编辑:提供了错误的图像:

Dependency error依赖错误

Library error库错误

MainActivity error主活动错误

That was entirely my bad, I had no idea I had to open both Flutter Project and the Android Module of said project on Android Studio.那完全是我的错,我不知道我必须在 Android Studio 上同时打开 Flutter 项目和该项目的 Android 模块。 Everything is working great now, thanks and sorry!现在一切都很好,谢谢和抱歉!

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

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