简体   繁体   English

模拟器的新 Flutter 应用程序构建失败,权限被拒绝

[英]New Flutter app build fails for simulator, permission denied

When I try to flutter run a newly created flutter app the build fails with the error below.当我尝试flutter run新创建的 flutter 应用程序时,构建失败并显示以下错误。 The computer was used a year ago for Flutter development and I suspect there is some irregular config somewhere causing this error.该计算机一年前用于 Flutter 开发,我怀疑某处有一些不规则的配置导致此错误。 I've been struggling with this for a few days now and any help would be much appreciated.我已经为此苦苦挣扎了几天,任何帮助将不胜感激。

Steps to reproduce重现步骤

  1. flutter create my_app
  2. cd my_app
  3. flutter run

Terminal output:终端输出:

app/Frameworks/App.framework/App: signed bundle with Mach-O universal
    (x86_64 arm64) [io.flutter.flutter.app]
    /Users/user/Desktop/projects/myApp/build/ios/Debug-iphonesimulator/Runner.
    app/Frameworks/Flutter.framework/Flutter: replacing existing signature
    /Users/user/Desktop/projects/myApp/build/ios/Debug-iphonesimulator/Runner.
    app/Frameworks/Flutter.framework/Flutter: Permission denied
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Could not build the application for the simulator.
Error launching application on iPhone 11.

I have tried:我试过了:

  • Uninstalling and re-installing Xcode卸载并重新安装 Xcode
  • Uninstalling and re-installing Flutter卸载和重新安装 Flutter
  • Running from Xcode从 Xcode 运行
  • Removing pods/podfiles and re-installing删除 pods/podfiles 并重新安装
  • Restarting computer重启电脑
  • flutter clean
  • Creating a new app创建新应用
  • Checking compliance with all required Flutter " Get started " instructions检查是否符合所有必需的 Flutter“入门”说明
  • Running from Xcode从 Xcode 运行
  • Switching workspace to Legacy Build System将工作区切换到旧版构建系统
  • Locking & unlocking login in Keychain Access 在钥匙串访问中锁定和解锁登录
  • Giving read/write permissions to the project folder and all enclosed items using Finder, and running chmod +x on files使用 Finder 授予对项目文件夹和所有封闭项目的读/写权限,并对文件运行chmod +x

flutter doctor -v output: flutter doctor -v输出:

[✓] Flutter (Channel stable, 1.20.3, on Mac OS X 10.15.6 19G2021, locale en-GB)
    • Flutter version 1.20.3 at /usr/local/Cellar/flutter/sdk
    • Framework revision 216dee60c0 (6 days ago), 2020-09-01 12:24:47 -0700
    • Engine revision d1bc06f032
    • Dart version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/user/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.7)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.7, Build version 11E801a
    • CocoaPods version 1.9.3

[!] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.48.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.14.0

[✓] Connected device (1 available)
    • iPhone 11 (mobile) • 034B59B3-8929-4997-B7A1-53E32D065347 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-7 (simulator)

! Doctor found issues in 1 category.

UPDATE : I have opened an issue in the Flutter Github repo .更新我在 Flutter Github 存储库中打开了一个问题

基于这个问题,它似乎与xcode_backend.sh文件有关,使一些 Flutter 文件只读,检查问题和这个问题,可能会帮助你解决它,祝你好运。

I was finally able to resolve this issue and run the Flutter demo app on the iOS Simulator by taking the following steps:通过执行以下步骤,我终于能够解决这个问题并在 iOS 模拟器上运行 Flutter 演示应用程序:

  1. flutter version v1.11.0 (to downgrade to an earlier version of Flutter) flutter version v1.11.0 (降级到早期版本的 Flutter)
  2. flutter channel stable
  3. flutter upgrade
  4. flutter doctor
  5. flutter create test_app
  6. cd test_app
  7. flutter run

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

相关问题 Flutter 应用程序无法在 iOS 模拟器上构建 - Flutter app fails to build on iOS simulator Flutter 在 iOS 模拟器上显示随机错误,或者在 iOS 模拟器上构建失败 - Flutter shows random error on iOS simulator, or build fails on iOS simulator ios模拟器构建有效,但真实设备构建失败 - ios simulator build works but real device build fails in flutter Swift Realm Simulator权限被拒绝 - Swift Realm Simulator Permission Denied Flutter.io (dart) 应用程序无法在 iOS 模拟器上启动 - Flutter.io (dart) app fails to launch on iOS simulator 针对Facebook应用的模拟器构建 - Simulator build for facebook app 为什么在使用 flutter 模块构建 iOS 本机应用程序时修复“Frameworks/Flutter.framework: Permission denied”? - Why to fix “Frameworks/Flutter.framework: Permission denied” while building iOS native app with flutter module? 无法为 flutter 的模拟器构建应用程序 - Could not build application for the simulator for flutter 无法使用 `Pods-Runner/Pods-Runner-frameworks.sh: Permission denied` 错误构建 Flutter - Failed to build Flutter with `Pods-Runner/Pods-Runner-frameworks.sh: Permission denied` error Xcode 无法为 ios 13.3.1 设备构建 flutter 代码,但在 13.3 ios 模拟器上运行代码 - Xcode fails to build flutter code for ios 13.3.1 device but runs code on 13.3 ios simulator
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM