无法为模拟器构建应用程序。在 iPhone 13 Pro Max 上启动应用程序时出错

问题描述 投票:0回答:1

出于某种原因,我无法在 iOS 模拟器上开始调试。我已经尝试了几种解决方案,我猜这对他们有帮助,但问题并没有消失,我现在很绝望。我不知道这个网站究竟是如何运作的,或者是否有任何现有的解决方案,但我找不到,我需要你的帮助。

错误在这里:

Launching lib/main.dart on iPhone 13 Pro Max in debug mode...
main.dart:1
Xcode build done.                                            9.7s
Failed to build iOS app
Error output from Xcode build:
↳
    objc[9036]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1ee17d160) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x110d142c8). One of the two will be used. Which one is undefined.
    objc[9036]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x1ee17d1b0) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x110d14318). One of the two will be used. Which one is undefined.
    ** BUILD FAILED **
Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/c2/_5qtd3yx59gdmf0t6qtwzskh0000gn/T/flutter_tools.pF1OXi/flutter_ios_build_temp_dirCJgdwG/temporary_xcresult_bundle
4
Invalid depfile: /Users/arnaudp/Desktop/tester/my_app/.dart_tool/flutter_build/0a3c503f4b90e814926533c60d069d61/kernel_snapshot.d
: Error: Not found: 'dart:html'
HomePage.dart:3
    import 'dart:html';
           ^

我在这里尝试,但这对我有用:

rm ios/Podfile

flutter pub upgrade

flutter pub get

cd ios && pod update

flutter clean && flutter run
flutter ios-simulator
1个回答
0
投票

在你的

HomePage.dart
里面删除
import 'dart:html'
。您无法在 ios 构建中访问它。

© www.soinside.com 2019 - 2024. All rights reserved.