简体   繁体   English

当我在 build.gradle 中打开 flutter 项目红线中的 android 文件夹时出错

[英]Get error when i open the android folder in flutter project red lines in build.gradle any idea

I am trying to use fire-base when i am make a new project in flutter every things is fine but when i open the android folder in my project i get an error at this line of android>app>build.gradle any idea please当我在 flutter 中创建一个新项目时,我正在尝试使用 fire-base 一切都很好,但是当我在我的项目中打开 android 文件夹时,我在 android>app>build.gradle 的这一行出现错误,请知道

throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") throw new GradleException(“未找到颤振 SDK。在 local.properties 文件中使用 flutter.sdk 定义位置。”)

在此处输入图像描述

Assuming you have a successful installation of:假设您已成功安装:

  • Android Studio Android工作室
  • Flutter SDK (you can check if you run flutter doctor in your terminal Flutter SDK (您可以检查您是否在终端中运行flutter doctor
  • You have defined the Flutter sdk on your $PATH (Flutter doctor should tell you)您已经在$PATH上定义了 Flutter sdk (颤振医生应该告诉您)

I also found it difficult to open the Android folder in Android Studio.我还发现很难在 Android Studio 中打开Android文件夹。
What worked for me however was:然而,对我有用的是:

Remove the.idea/ folder for your project删除项目的 .idea/ 文件夹

I'm not sure if this step is necessary, but I always do it when I have conflicts opening project in either Android Studio or Intellij.我不确定这一步是否必要,但当我在 Android Studio 或 Intellij 中打开项目时遇到冲突时,我总是这样做。
This is basically where it keeps its configuration.这基本上是它保留其配置的地方。
在此处输入图像描述

Open up Android Studio打开Android工作室

Click on Open an existing Android Studio project单击打开现有的 Android Studio 项目
在此处输入图像描述

Select the android folder from your project Select 项目中的android文件夹

在此处输入图像描述

Hope that helped希望有帮助

the following steps might help you.以下步骤可能会对您有所帮助。

open your android project in flutter and select in this window, it won't show any error. 在此 window 中打开 flutter 和 select 中的 android 项目,它不会显示任何错误。 Then re-open your flutter project and select in this window, you will find everything is OK. 然后在这个window中重新打开你的flutter项目和select,你会发现一切正常。

暂无
暂无

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

相关问题 当我运行旧的android项目时,我从build.gradle收到一条错误消息 - When I run my old android project I get a error message from the build.gradle 将 Intellij Idea 用于 Flutter 时出现 android/app/build.gradle 错误 - Error in android/app/build.gradle while using Intellij Idea for Flutter 如何将现有的android项目(build.gradle)打开到android studio中 - How to open existing android project(build.gradle) into android studio 尝试运行 flutter 应用程序时,build.gradle 文件中出现错误 - When trying to run flutter application there is a Error in build.gradle file Android Studio 项目级 build.gradle 错误 - Android Studio project level build.gradle error 我运行我的项目并在我的 build.gradle 文件中出现以下错误我该怎么办? - i run my project and get following error in my build.gradle file what should i do? 加载项目时,应用脚本build.gradle错误发生 - When loading a project apply script build.gradle error occur Android:添加Firebase要求时出现build.gradle错误 - Android: build.gradle error when adding firebase requirements 我在 Android Studio 的我的 Flutter 应用程序中找不到我的项目结构,我也有一个 build.gradle 异常:(( - I cant find my Project Structure in My Flutter App in Android Studio and I also have a build.gradle exception : (( 将Facebook SDK添加到Android Studio build.gradle时出错 - Error when adding Facebook SDK to Android Studio build.gradle
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM