简体   繁体   English

Flutter - Xcode 在为模拟器构建时看不到应用程序包

[英]Flutter - Xcode can't see app packages while building for Simulator

Whenever I try running my app Xcode gives me this:每当我尝试运行我的应用程序 Xcode 时,都会给我这个:

Launching lib/main.dart on iPhone 14 Pro Max in debug mode...
lib/main.dart:1
Xcode build done.                                            9.9s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/4m/6ntf71vx17qfqdg9kr88s2s80000gn/T/flutter_tools.V6z5EC/flutter_ios_build_temp_dirX4Qj6c/temporary_xcresult_bundle
: Error: The getter 'payload' isn't defined for the class 'NotificationAppLaunchDetails'.
lib/main.dart:57
- 'NotificationAppLaunchDetails' is from 'package:flutter_local_notifications_platform_interface/src/types.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications_platform_interface-6.0.0/lib/src/types.dart').
package:flutter_local_notifications_platform_interface/src/types.dart:1
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'payload'.
        _orderID = (notificationAppLaunchDetails.payload != null &&
                                                 ^^^^^^^
: Error: The getter 'payload' isn't defined for the class 'NotificationAppLaunchDetails'.
lib/main.dart:58
- 'NotificationAppLaunchDetails' is from 'package:flutter_local_notifications_platform_interface/src/types.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications_platform_interface-6.0.0/lib/src/types.dart').
package:flutter_local_notifications_platform_interface/src/types.dart:1
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'payload'.
                notificationAppLaunchDetails.payload.isNotEmpty)
                                             ^^^^^^^
: Error: The getter 'payload' isn't defined for the class 'NotificationAppLaunchDetails'.
lib/main.dart:59
- 'NotificationAppLaunchDetails' is from 'package:flutter_local_notifications_platform_interface/src/types.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications_platform_interface-6.0.0/lib/src/types.dart').
package:flutter_local_notifications_platform_interface/src/types.dart:1
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'payload'.
            ? int.parse(notificationAppLaunchDetails.payload)
                                                     ^^^^^^^
: Error: The getter 'WebView' isn't defined for the class '_PaymentScreenState'.
package:flutter_sixvalley_ecommerce/…/payment/payment_screen.dart:46
- '_PaymentScreenState' is from 'package:flutter_sixvalley_ecommerce/view/screen/payment/payment_screen.dart' ('lib/view/screen/payment/payment_screen.dart').
package:flutter_sixvalley_ecommerce/…/payment/payment_screen.dart:1

.
. (goes on like this for the rest of the packages)
.

    Failed to package /Users/abdelrahmanmohamed/development/FlutterProjects/valley_userapp.
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Building targets in dependency order
    warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
    warning: Run script build phase 'Thin Binary' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
    Result bundle written to path:
        /var/folders/4m/6ntf71vx17qfqdg9kr88s2s80000gn/T/flutter_tools.V6z5EC/flutter_ios_build_temp_dirX4Qj6c/temporary_xcresult_bundle
Could not build the application for the simulator.
Error launching application on iPhone 14 Pro Max.
Exited

No matter how much I do flutter clean and arch -x86_64 pod install .无论我做了多少flutter cleanarch -x86_64 pod install It keeps doing this.它一直这样做。

I am using a mac silicon machine.我正在使用 mac 硅机。 And this is a project I didn't run before on it.这是一个我之前没有运行过的项目。 So its new.所以它是新的。

I am using Flutter 3.3.10.我正在使用 Flutter 3.3.10。 And I am able to build and run other Flutter apps.而且我能够构建和运行其他 Flutter 应用程序。

So running dat analyze as @Alaindeseine suggested revealed in the code editor that these were actually errors in code.因此,按照@Alaindeseine 的建议运行dat analyze在代码编辑器中显示这些实际上是代码中的错误。 The assets were old and when I updated them it didn't reflect in the code editor.资产是旧的,当我更新它们时,它没有反映在代码编辑器中。

You can use dart anayze command to display info, warnings, errors and deprecateds.您可以使用dart anayze命令显示信息、警告、错误和弃用。 It may help finding what is going wrong with you code.它可能有助于找出您的代码出了什么问题。

You can alos use dart fix --dry-run command to list and dart fix --apply to fix problems.您也可以使用dart fix --dry-run命令列出并使用dart fix --apply修复问题。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM