[英]Error in running flutter project which no permission
Launching lib/main.dart on Android SDK built for x86 in debug mode...在 Android SDK 上启动 lib/main.dart 在D调试模式...
[.] Gradle does not have execution permission, You should change the ownership of the project directory to your user.
[.] Gradle 没有执行权限,您应该将项目目录的所有权更改为您的用户。 or move the project to a directory with execute permissions.
或将项目移动到具有执行权限的目录。 Gradle task assembleDebug failed with exit code 1 Exited (sigterm)
Gradle 任务 assembleDebug 失败,退出代码 1 退出 (sigterm)
I got the same error trying to execute flutter run
on a mac.尝试在 Mac 上
flutter run
了同样的错误。 Apparently, in your flutter project, there is a file android/gradlew
that is expected to be executable (and it wasn't).显然,在您的 flutter 项目中,有一个文件
android/gradlew
预计是可执行的(但它不是)。 So in my case, I ran...所以在我的情况下,我跑了......
chmod a+rx android/gradlew
...afterwards the flutter
command worked. ...之后
flutter
命令起作用了。
Try to set the execution flag on your gradlew file:尝试在您的 gradlew 文件上设置执行标志:
chmod +x gradlew
FOR FLUTTER I have tried mostly everything mentioned here and on my own.对于 FLUTTER ,我已经尝试了这里提到的所有内容,并且我自己也尝试了。 The solution, actually, it is a series of solutions and worked for me, I am mentioning them try as you wish.
解决方案,实际上,它是一系列解决方案并且对我有用,我提到他们可以随心所欲地尝试。
Make sure no antivirus *firewall is blocking, gradle.bat, gradlew.bat, git, flutter, android studio确保没有防病毒软件*防火墙被阻止,gradle.bat, gradlew.bat, git, flutter, ZC31B3236417CE19CA8Z studio15CE5DA
Get the latest Gradle and install it to lower privilege directory, not in Program Files or Program Files (X86);获取最新的 Gradle 并将其安装到较低权限的目录,而不是在 Program Files 或 Program Files (X86) 中; I did it in D drive.
我是在D盘做的。 Don't forget to update the path in Environment Variables.
不要忘记更新环境变量中的路径。
I also installed JAVA Runtime (JRE).我还安装了 JAVA 运行时(JRE)。
Install git as it is necessary for flutter.根据 flutter 的需要,安装 git。
You can Check-in windows command line after installing each (Git, Gradle and flutter doctor).您可以在安装每个(Git、Gradle 和 flutter 博士)后签入 windows 命令行。 if nothing seems to work Restart the pc after each.
如果似乎没有任何效果,请在每次之后重新启动电脑。
After this when you will compile /run the app it will take a long time please bear with that(at least 15 min just to be sure).在此之后,当您编译/运行应用程序时,将需要很长时间,请耐心等待(至少 15 分钟以确保)。
I had the app directory with Read, Write & Modifying permissions still, it was giving that error- Error code 1 "gradle does not have execution permission. you should change the ownership of the project directory to your user, or move the project to a directory with execute permissions."我仍然拥有具有读取,写入和修改权限的应用程序目录,它给出了错误- 错误代码 1“gradle 没有执行权限。您应该将项目目录的所有权更改为您的用户,或将项目移动到具有执行权限的目录。”
so I think it is related to the connection with the plugin.所以我认为这与与插件的连接有关。
Hope it helped:-)希望它有所帮助:-)
chmod a+rx android/gradlew
This works but for windows you need to install "Git for Windows"这有效,但对于 windows,您需要安装“Git for Windows”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.