我想在iOS上测试我的Flutter应用程序。我没有Mac,所以我在Virtual Box上安装了 Catalina ,并在VS Code上运行我的项目,但当我运行flutter run
时,我得到了下面的错误
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor.
字符串
我不知道是什么导致了这个错误。Google解决错误的方法我得到了下面的解决方案,这是为Xcode。由于某些原因,我无法在Xcode中打开我的项目。如何使用VS Code https://stackoverflow.com/a/56616260/7290043实现相同的功能
完全错误
Launching lib/main.dart on iPhone 11 Pro in debug mode...
/Users/danish/Documents/storeifie/ios/Runner/Info.plist: Property List error: Found non-key inside <dict> at line 35 / JSON error: JSON text did not start with array or object and option to allow fragments not set.
/Users/danish/Documents/storeifie/ios/Runner/Info.plist: Property List error: Found non-key inside <dict> at line 35 / JSON error: JSON text did not start with array or object and option to allow fragments not set.
Running Xcode build...
Xcode build done. 79.4s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
In file included from /Users/danish/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.5/ios/Classes/FLTSharedPreferencesPlugin.m:5:
/Users/danish/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.5/ios/Classes/FLTSharedPreferencesPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in target 'Runner'
from project 'Runner')
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro.
型
1条答案
按热度按时间mrphzbgm1#
'Flutter/Flutter.h' file not found
通常发生在应用程序在Android中启动并运行,而您尝试在iOS上运行它时。一些开发人员在升级Flutter版本时也可能会遇到它。在更新的iOS模拟器上运行项目时发生此致命错误。您可以尝试一些解决方案来解决此问题。
方案一:
有一种可能性是你的PodFile没有选择配置,你需要改变它,请参阅下面的例子:
在
PodFile
中更改以下代码可以解决此问题post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['ENABLE_BITCODE'] = 'NO' config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0' end end end
个至
post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) end end
个方案二:
有些人在将通道从master/dev更改为beta/stable时可能会遇到此错误。
如果是这种情况,您可能需要考虑以下解决方案:
1.使用命令
rm ios/Flutter/Flutter.podspec
删除ios/Flutter/Flutter.podspec
1.删除
Flutter.podspec
后,您的Flutter将被清理。1.运行应用程序。
方案三:
如果上述解决方案不起作用,请尝试以下操作:
1.现在通过pod decintegrate分解pod
rm Flutter/Flutter.podspec
个rm podfile.lock
flutter clean
flutter run
个方案四:
如果您的问题仍未解决,请将应用的频道从master更改为stable。在终端运行以下命令以更改频道:
flutter channel stable
个flutter clean
flutter run
个