我创建了一个默认的颤振项目,并在intellij中打开它。iOS部分工作正常。在android站点上,当我尝试在intellij中构建android模块时,会收到以下错误。如果我单独在android studio中打开android模块(使用菜单项“在android studio中打开android模块”),它似乎可以工作。这是预期的吗?

Error:(3, 18) java: package android.os does not exist
Error:(5, 22) java: package io.flutter.app does not exist
Error:(8, 35) java: cannot find symbol
  symbol: class FlutterActivity
Error:(10, 27) java: cannot find symbol
  symbol:   class Bundle
  location: class com.yourcompany.helloflutter.MainActivity
Error:(9, 3) java: method does not override or implement a method from a supertype
Error:(11, 5) java: cannot find symbol
  symbol:   variable super
  location: class com.yourcompany.helloflutter.MainActivity
/Users/roger/Documents/hello_flutter/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
Error:(3, 32) java: package io.flutter.plugin.common does not exist
Error:(9, 35) java: cannot find symbol
  symbol:   class PluginRegistry

最佳答案

你必须在Android Studio中打开整个项目,而不仅仅是Android模块。同时在Android Studio中安装dart&flutter插件。它将帮助你正常工作。

关于flutter - Flutters Android Java源代码显示IntelliJ中的错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/50181957/

10-11 14:57
查看更多