我不知道为什么,但我无法在我的新 Macbook 中构建或运行该应用程序,我在另一台 Mac 或我的 Windows 计算机上运行相同的文件夹并完美运行。在这里,当我运行 flutter clean 时,我必须运行 pub get 来解决问题,这正常吗?
如果我新建一个项目,我可以正常运行flutter run,所以我想可能那里我认为可能与插件有关。
你知道我该如何解决这个问题吗?谢谢
Flutter Doctor
[?] Flutter (Channel master, 1.24.0-8.0.pre.343, on macOS 11.0.1 20B29 darwin-x64, locale es-419)
• Flutter version 1.24.0-8.0.pre.343 at /Users/leo/tools/flutter
• Framework revision cf6c33e58a (2 days ago), 2020-11-21 14:04:01 -0800
• Engine revision 23a8e027db
• Dart version 2.12.0 (build 2.12.0-62.0.dev)
[?] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/leo/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• Java …Run Code Online (Sandbox Code Playgroud) 我正在使用 iPhone 12 Pro Max 模拟器、macOS Catalina。
\n当我尝试运行该应用程序时,出现此错误:
\n[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: [core/not-initialized] Firebase has not been correctly initialized.\nRun Code Online (Sandbox Code Playgroud)\n控制台中还有一个提示: \n通常这意味着您在调用 之前已尝试使用 Firebase 服务Firebase.initializeApp。
我在使用 Firebase 之前对其进行初始化。像这样:
\nvoid main() async {\n print(\'-- main\');\n\n WidgetsFlutterBinding.ensureInitialized();\n print(\'-- WidgetsFlutterBinding.ensureInitialized\');\n\n await Firebase.initializeApp();\n print(\'-- main: Firebase.initializeApp\');\n\n runApp(const MyApp());\n}\nRun Code Online (Sandbox Code Playgroud)\n这是我在控制台输出中看到的内容:
\nXcode build done. 132.9s\nflutter: -- main\nflutter: -- WidgetsFlutterBinding.ensureInitialized\n[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: [core/not-initialized] Firebase has not been correctly initialized.\n\nUsually this means you\'ve attempted to use a Firebase service before calling …Run Code Online (Sandbox Code Playgroud) 我正在尝试创建一个 Flutter 插件来使用本机库。我尝试使用的这个库存储在私有存储库中,可以与 Swift 依赖管理器一起使用。
这让我很头痛,因为我无法在我的插件中添加私有存储库依赖项(我找不到在 .podspec 文件中执行此操作的方法),所以我做了什么:
MyDependency.xcframework文件夹到MyPlugin/ios文件夹s.preserve_paths = 'MyDependency.xcframework'
s.xcconfig = { 'OTHER_LDFLAGS' => '-framework MyDependency' }
s.vendored_frameworks = 'MyDependency.xcframework'
Run Code Online (Sandbox Code Playgroud)
这样做我可以在插件的源代码中使用 MyDependency 。
我当前的问题是:这仅适用于 Simulator。
在此之前,该项目在真实设备上运行没有任何问题。
另外,我直接使用 Swift 依赖管理器中的依赖项进行了测试,并且运行良好。我认为问题在于我将框架添加到插件的方式。
我开发电子商务应用程序已经大约 3 个月了,最近我切换到 MacO。\n当我在 iOS 模拟器中运行代码时遇到问题\每次运行它时都会收到此消息。
\n\nCocoaPods' output:\n\xe2\x86\xb3\n Preparing\n Analyzing dependencies\n Inspecting targets to integrate\n Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)\n Fetching external sources\n -> Fetching podspec for `Flutter` from `Flutter`\n -> Fetching podspec for `image_picker` from `.symlinks/plugins/image_picker/ios`\n -> Fetching podspec for `path_provider` from `.symlinks/plugins/path_provider/ios`\n -> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`\n -> Fetching podspec for `sqflite` from `.symlinks/plugins/sqflite/ios`\n Resolving dependencies of `Podfile`\nError output from CocoaPods:\n\xe2\x86\xb3\n Ignoring ffi-1.15.4 because its extensions are not built. Try: …Run Code Online (Sandbox Code Playgroud) 我有一个用 Flutter 编写的 Android 应用程序。\n现在我正在尝试它的 ios 版本,但出现错误。我尝试运行空的 flutter 项目,并且运行成功。
\n没有错误 pod install
在尝试 flutter run 后,我收到这些错误。\n我的 pod 文件位于下面。
\n我怎么解决这个问题?
\n颤振运行输出:
\n Xcode's output:\n\xe2\x86\xb3\n /usr/local/Caskroom/flutter/2.2.3/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-2.0.9/ios/Classes/FlutterWebView.m:395:23:\n warning: 'requiresUserActionForMediaPlayback' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]\n configuration.requiresUserActionForMediaPlayback = true;\n ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n mediaTypesRequiringUserActionForPlayback\n In module 'WebKit' imported from\n /usr/local/Caskroom/flutter/2.2.3/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-2.0.9/ios/Classes/FlutterWebView.h:6:\n /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Framew\n orks/WebKit.framework/Headers/WKWebViewConfiguration.h:213:28: note: 'requiresUserActionForMediaPlayback' has been explicitly marked\n deprecated here\n @property (nonatomic) BOOL requiresUserActionForMediaPlayback API_DEPRECATED_WITH_REPLACEMENT("mediaTypesRequiringUserActionForPlayback",\n ios(9.0, 10.0));\n ^\n /usr/local/Caskroom/flutter/2.2.3/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-2.0.9/ios/Classes/FlutterWebView.m:407:23:\n warning: 'requiresUserActionForMediaPlayback' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]\n configuration.requiresUserActionForMediaPlayback = …Run Code Online (Sandbox Code Playgroud) 重要提示 - 我希望此功能仅适用于移动应用程序,而不适用于 flutter web。
我在保存 flutter 应用程序中的网站时遇到一些问题。我尝试过对 inappwebview 使用缓存方法和 savewebarchive 方法。该方法的问题在于它没有保存网站的完整内容。它仅保存 HTML 和 CSS 文件。
我想保存整个网站的所有内容,如 HTML、CSS、js、字体文件、图像,并将其存储在 flutter 应用程序中。我已经使用了一些插件,但没有一个有帮助。
我正在寻找与 httrack 相同的功能。
任何正确的方向都会受到重视。
当我尝试将Flutter 项目构建到IOS 时,它向我显示此错误,我尝试清理并尝试更改项目目录。
Launching lib/main.dart on iPhone 12 Pro Max in debug mode... Running pod install... CocoaPods' output: ?
[!] Invalid `Podfile` file: [!] Specifying multiple `post_install` hooks is unsupported..
# from /Users/eapple/Downloads/codecanyon-IRJuYEQd-delivery-boy-for-multirestaurants-flutter-app/flutter_application/ios/Podfile:43
# -------------------------------------------
#
> post_install do |installer|
# installer.pods_project.targets.each do |target|
# -------------------------------------------
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.1/lib/cocoapods-core/podfile.rb:301:in `rescue in block in from_ruby'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.1/lib/cocoapods-core/podfile.rb:295:in `block in from_ruby'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.1/lib/cocoapods-core/podfile.rb:50:in `instance_eval'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.1/lib/cocoapods-core/podfile.rb:50:in `initialize'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.1/lib/cocoapods-core/podfile.rb:293:in `new'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.1/lib/cocoapods-core/podfile.rb:293:in `from_ruby'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.1/lib/cocoapods-core/podfile.rb:259:in `from_file'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/config.rb:200:in `podfile'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command.rb:150:in `verify_podfile_exists!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command/install.rb:46:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command.rb:52:in `run' …Run Code Online (Sandbox Code Playgroud) 我已经看到这个问题被问了很多次,但我找到的解决方案都不适合我。从本周开始,我开始收到如下错误:
url_launcher-5.7.10/ios/Classes/FLTURLLauncherPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
Run Code Online (Sandbox Code Playgroud)
它并不总是来自 url_launcher 包。它似乎只是循环遍历将从哪个包中抛出该错误。我尝试过以下操作:
似乎什么都不起作用,所以我在这里有点不知所措。Android 应用程序仍然构建良好。
我的 pubspec 的依赖项部分:
environment:
sdk: ">=2.2.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
admob_flutter: ^1.0.1
after_layout: ^1.0.7+2
ant_icons: ^1.0.0
app_review: ^2.0.1
apple_sign_in: ^0.1.0
auto_size_text: ^2.1.0
barcode_scan: ^2.0.2
basic_utils: ^2.6.3
bubble_tab_indicator: ^0.1.4
built_value: ^7.1.0
built_collection: ^4.3.2
chips_choice: ^2.0.1
cloud_firestore: ^0.14.1+2
dio: 3.0.10
equatable: ^1.2.5
file_picker: ^2.1.5
firebase_core: ^0.5.2+1 …Run Code Online (Sandbox Code Playgroud) 我的应用程序存档完美保存了两周(是我所做的最新更新)。
\n在对颤振代码进行一些细微更改(我没有添加任何包或其他东西)之后,我尝试再次存档,但遇到了一些奇怪的错误,我不知道它们来自哪里(这些错误来自库,所以没有真正的错误)对其进行更改)。我可以在模拟器上运行它,并且可以毫无问题地进行构建。我只是无法存档。
\n这是错误:
\nRunning Xcode build... \nXcode archive done. 80.5s\nFailed to build iOS app\nError output from Xcode build:\n\xe2\x86\xb3\n 2022-03-20 00:27:32.265 xcodebuild[22543:393081] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension\n Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore\n 2022-03-20 00:27:32.266 xcodebuild[22543:393081] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension\n Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore\n ** ARCHIVE FAILED **\n\n\nXcode's output:\n\xe2\x86\xb3\n Writing result bundle at path:\n /var/folders/lp/myd6ssb57_jg81p9920h5_sr0000gn/T/flutter_tools.AJZJFr/flutter_ios_build_temp_dir4zPWKc/temporary_xcresult_bundle\n\n LLVM ERROR: out of memory\n Allocation failed\n Please submit a …Run Code Online (Sandbox Code Playgroud) Flutter iOS 中视频无法播放,出现错误未处理异常:PlatformException(VideoError,无法加载视频:操作已停止,null,null)。在安卓上运行良好。如果您对此有任何想法,请告诉我。
=>使用video_player插件
=>代码链接= https://drive.google.com/file/d/1amGVhtz0CrnG5ocbjWImW79-XYRlXguN/view?usp=sharing
视频=http://143.244.137.15:8000/media/event/org_event_video/None/event_video_4pnqGxk.mp4
=>信息.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Evento Package</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>evento_package</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>FirebaseAppDelegateProxyEnabled</key>
<string>0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIBackgroundModes</key>
<array>
<string>fetch</string>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoadsForMedia</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>143.244.137.15:8000</key>
<dict> …Run Code Online (Sandbox Code Playgroud)