Flutter错误结束:ProcessException:权限被拒绝

时间:2019-01-30 04:41:08

标签: android-studio visual-studio-code flutter

我想让我的第一款应用运行得扑朔迷离,但出现以下错误:

在为调试模式下为x86 64构建的Android SDK上启动lib / main.dart。 初始化gradle。 解决依赖关系。 完成并显示以下错误:

  

ProcessException:权限被拒绝命令:   /home/abdoul-razak/Android/SDK/build-tools/28.0.3/aapt dump xmltree   /home/abdoul-razak/Projects/akoybiz/build/app/outputs/apk/app.apk   AndroidManifest.xml

这是flutter doctor的结果:

abdoul-razak@Komche:~/Projects/akoybiz$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.0.0, on Linux, locale fr_FR.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    ✗ Android license status unknown.
[✓] Android Studio (version 3.0)
[✓] VS Code (version 1.30.2)
[✓] Connected device (1 available)

! Doctor found issues in 1 category.

更新sdk android之后,这里是flutter doctor -v

的结果
 abdoul-razak@Komche:~/Projects/akoybiz$ flutter doctor -v
[✓] Flutter (Channel stable, v1.0.0, on Linux, locale fr_FR.UTF-8)
    • Flutter version 1.0.0 at /home/abdoul-razak/flutter
    • Framework revision 5391447fae (il y a 9 semaines), 2018-11-29 19:41:26
      -0800
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at /home/abdoul-razak/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /home/abdoul-razak/Android/Sdk
    • Java binary at: /opt/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)
    • All Android licenses accepted.

[✓] Android Studio (version 3.0)
    • Android Studio at /opt/android-studio
    • Flutter plugin version 23.2.1
    • Dart plugin version 171.4424
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[✓] VS Code (version 1.30.2)
    • VS Code at /usr/share/code
    • Flutter extension version 2.22.2

[✓] Connected device (1 available)
    • itel P31 • 45YP8LSO4T7HWCLZ • android-arm • Android 7.0 (API 24)

• No issues found!

3 个答案:

答案 0 :(得分:1)

xattr -d com.apple.quarantine ./gradlew

使用此命令可以解决此问题。我不知道确切的原因,但这对我有用。

答案 1 :(得分:0)

问题与您的Android SDK许可证有关。运行命令

flutter doctor --android-licenses

然后按y,直到获得所有权限。

答案 2 :(得分:0)

我偶然发现了相同的异常。并修复了某些问题,但我不知道确切是什么。

该异常说明了一些不同之处,但我认为它与安装颤振有关。我按照他们的website上的建议重新安装了它,并且效果很好...

 cd ~/development
 tar xf ~/Downloads/flutter_linux_v1.7.8+hotfix.4-stable.tar.xz

编辑:确保您的flutter项目也使用本地文件夹。