我不完全清楚如何重现这一问题,因为我不知道是什么原因造成了这一问题。我目前有一个在调试模式和配置文件模式下工作的应用程序,但是我无法为发布模式构建它。我将通过电缆直接安装到运行iPhone 14.8的物理iOS (而不是模拟器)。我没有Android设备,所以我不确定这个问题是否也发生在Android系统上。我已经尝试删除我的Pods文件夹、Podfile、Podfile.lock更新Cocoapods,并运行flutter clean,但问题仍然存在。我从一个提供的模板创建了一个新的颤振项目,并遇到了同样的问题:我可以在调试模式和配置文件模式下构建,但不能构建发布模式。下面的日志文件用于最基本的项目,因为它的杂乱较少。
颤振医生输出:
[✓] Flutter (Channel stable, 3.0.2, on macOS 11.4 20F71 darwin-x64, locale en-US)
• Flutter version 3.0.2 at /Users/aaron/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision cd41fdd495 (8 days ago), 2022-06-08 09:52:13 -0700
• Engine revision f15f824b57
• Dart version 2.17.3
• DevTools version 2.12.2
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at /Users/aaron/Library/Android/sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: /Library/Java/JavaVirtualMachines/jdk-18.0.1.1.jdk/Contents/Home/bin/java
• Java version Java(TM) SE Runtime Environment (build 18.0.1.1+2-6)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Users/aaron/Downloads/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
[✓] Connected device (3 available)
• אהרן iPhone (mobile) • 00008020-001A74AA01F9002E • ios • iOS 14.8 18H17
• iPhone 13 (mobile) • DBEAE20E-D3D1-43B5-BC15-CC8D20753EEB • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
• macOS (desktop) • macos • darwin-x64 • macOS 11.4 20F71 darwin-x64
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 2 categories.这是我的构建日志(flutter run --release --verbose)
如果您导航到最后,您可以看到它成功地部署到我的设备。日志中没有反映的是,在启动时,有一个简短的白屏幕,应用程序崩溃。此时,我按“Q”键结束终端会话,并记录“应用程序完成”。当应用程序崩溃时,没有错误或异常记录,这使我对如何精确定位问题一无所知。重申一下,该应用程序可以在调试模式和配置文件模式下安装和使用,而不会出现问题。只有在发布模式下才会发生这种情况。
我希望我能提供更多的信息,但我不知道从哪里开始修复这个问题。
编辑:
我在Xcode中注意到了这一点,这一点我以前没有注意到。
2022-06-16 15:32:44.889467-0500 Runner[68916:5583414] Metal API Validation Enabled
2022-06-16 15:32:45.053915-0500 Runner[68916:5583414] [VERBOSE-3:dart_vm_initializer.cc(22)] Error while initializing the Dart VM: Flag dedup_instructions is false in snapshot, but dedup_instructions is always true in product mode在Xcode中运行配置文件或调试版本可以避免此错误。也许这是发布模式的根本原因。仍然在寻找如何解决这个问题的答案。
发布于 2022-06-16 18:00:10
如果您使用的是防火墙,且配置不正确,则可能会发生这种情况。或者在信息列表中没有Id的广告
https://stackoverflow.com/questions/72649814
复制相似问题