当前位置: 首页 > 知识库问答 >
问题:

Flutter:iphone应用程序未在模拟器中运行

长孙阳焱
2023-03-14

我被这个错误困住了,当我在android上做构建时,它工作得很好,但是当我在IOS模拟器上运行我的应用程序时,它却显示我这个错误。我无法找出我的代码中的实际问题是什么。请帮我弄清楚这个情况。

我的flutter sdk版本是1.22.4

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UIUserNotificationSettings.h:44:12: note: 'UIUserNotificationSettings' has been explicitly marked deprecated here
@interface UIUserNotificationSettings : NSObject  
           ^  
/Users/gajendrabhati/Library/Android/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-3.0.1+5/ios/Classes/FlutterLocalNotificationsPlugi
n.m:285:76: warning: 'UIUserNotificationSettings' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationSettings
[-Wdeprecated-declarations]
        UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:notificationTypes categories:nil];  
                                                                           ^  
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support
Files/flutter_local_notifications/flutter_local_notifications-prefix.pch:2:  
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UIUserNotificationSettings.h:44:12: note: 'UIUserNotificationSettings' has been explicitly marked deprecated here
@interface UIUserNotificationSettings : NSObject  
           ^  
/Users/gajendrabhati/Library/Android/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-3.0.1+5/ios/Classes/FlutterLocalNotificationsPlugi
n.m:286:44: warning: 'registerUserNotificationSettings:' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's
-[UNUserNotificationCenter requestAuthorizationWithOptions:completionHandler:] and -[UNUserNotificationCenter setNotificationCategories:]
[-Wdeprecated-declarations]
        [[UIApplication sharedApplication] registerUserNotificationSettings:settings];  
                                           ^  
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support
Files/flutter_local_notifications/flutter_local_notifications-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UIApplication.h:250:1: note: 'registerUserNotificationSettings:' has been explicitly marked deprecated here
- (void)registerUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings API_DEPRECATED("Use UserNotifications Framework's
-[UNUserNotificationCenter requestAuthorizationWithOptions:completionHandler:] and -[UNUserNotificationCenter setNotificationCategories:]", ios(8.0, 10.0))
API_UNAVAILABLE(tvos);  
^  
/Users/gajendrabhati/Library/Android/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-3.0.1+5/ios/Classes/FlutterLocalNotificationsPlugi
n.m:296:5: warning: 'UILocalNotification' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationRequest
[-Wdeprecated-declarations]
    UILocalNotification *notification = [[UILocalNotification alloc] init];  
    ^  
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support
Files/flutter_local_notifications/flutter_local_notifications-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UILocalNotification.h:18:12: note: 'UILocalNotification' has been explicitly marked deprecated here
@interface UILocalNotification : NSObject<NSCopying, NSCoding>  
           ^  
/Users/gajendrabhati/Library/Android/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-3.0.1+5/ios/Classes/FlutterLocalNotificationsPlugi
n.m:296:63: warning: 'UILocalNotification' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationRequest
[-Wdeprecated-declarations]
    UILocalNotification *notification = [[UILocalNotification alloc] init];  
                                                              ^
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support
Files/flutter_local_notifications/flutter_local_notifications-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UILocalNotification.h:18:12: note: 'UILocalNotification' has been explicitly marked deprecated here
@interface UILocalNotification : NSObject<NSCopying, NSCoding>  
           ^  
/Users/gajendrabhati/Library/Android/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-3.0.1+5/ios/Classes/FlutterLocalNotificationsPlugi
n.m:335:34: warning: 'UILocalNotificationDefaultSoundName' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's +[UNNotificationSound
defaultSound] [-Wdeprecated-declarations]
        notification.soundName = UILocalNotificationDefaultSoundName;  
                                 ^  
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support
Files/flutter_local_notifications/flutter_local_notifications-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UILocalNotification.h:62:30: note: 'UILocalNotificationDefaultSoundName' has been explicitly marked deprecated here
UIKIT_EXTERN NSString *const UILocalNotificationDefaultSoundName API_DEPRECATED("Use UserNotifications Framework's +[UNNotificationSound defaultSound]", ios(4.0,
10.0)) API_UNAVAILABLE(tvos);  
                             ^  
/Users/gajendrabhati/Library/Android/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-3.0.1+5/ios/Classes/FlutterLocalNotificationsPlugi
n.m:351:9: warning: 'UILocalNotification' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationRequest
[-Wdeprecated-declarations]
        UILocalNotification * notification = [self buildStandardUILocalNotification:arguments];  
        ^  
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support
Files/flutter_local_notifications/flutter_local_notifications-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UIViewController.h:480:58: note: 'topLayoutGuide' has been explicitly marked deprecated here
@property(nonatomic,readonly,strong) id<UILayoutSupport> topLayoutGuide API_DEPRECATED("Use view.safeAreaLayoutGuide.topAnchor instead of
topLayoutGuide.bottomAnchor", ios(7.0,11.0), tvos(7.0,11.0));  
                                                         ^  
2 warnings generated.  
2 warnings generated.  
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/AppAuth/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m:168:58: warning: 'openURL:' is deprecated: first
deprecated in iOS 10.0 [-Wdeprecated-declarations]
    openedUserAgent = [[UIApplication sharedApplication] openURL:requestURL];  
                                                         ^~~~~~~  
                                                         openURL:options:completionHandler:  
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support Files/AppAuth/AppAuth-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UIApplication.h:123:1: note: 'openURL:' has been explicitly marked deprecated here
- (BOOL)openURL:(NSURL*)url API_DEPRECATED_WITH_REPLACEMENT("openURL:options:completionHandler:", ios(2.0, 10.0)) NS_EXTENSION_UNAVAILABLE_IOS("");  
^  
1 warning generated.  
Command CompileSwift failed with a nonzero exit code  
Command CompileSwift failed with a nonzero exit code  
Command CompileSwift failed with a nonzero exit code  
Command CompileSwift failed with a nonzero exit code  
Command CompileSwift failed with a nonzero exit code   
Command CompileSwift failed with a nonzero exit code  
Command CompileSwift failed with a nonzero exit code  
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/BraintreeDropIn/BraintreeDropIn/BTDropInController.m:418:67: error: 'topLayoutGuide' is deprecated: first
deprecated in iOS 11.0 - Use view.safeAreaLayoutGuide.topAnchor instead of topLayoutGuide.bottomAnchor [-Werror,-Wdeprecated-declarations]
        return CGRectGetHeight(UIScreen.mainScreen.bounds) - self.topLayoutGuide.length - self.bottomLayoutGuide.length;  
                                                                  ^  
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support Files/BraintreeDropIn/BraintreeDropIn-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UIViewController.h:480:58: note: 'topLayoutGuide' has been explicitly marked deprecated here
@property(nonatomic,readonly,strong) id<UILayoutSupport> topLayoutGuide API_DEPRECATED("Use view.safeAreaLayoutGuide.topAnchor instead of
topLayoutGuide.bottomAnchor", ios(7.0,11.0), tvos(7.0,11.0));
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UIViewController.h:480:58: note: 'topLayoutGuide' has been explicitly marked deprecated here
@property(nonatomic,readonly,strong) id<UILayoutSupport> topLayoutGuide API_DEPRECATED("Use view.safeAreaLayoutGuide.topAnchor instead of
topLayoutGuide.bottomAnchor", ios(7.0,11.0), tvos(7.0,11.0));  
                                                         ^  
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/BraintreeDropIn/BraintreeDropIn/BTDropInController.m:444:21: error: 'bottomLayoutGuide' is deprecated:
first deprecated in iOS 11.0 - Use view.safeAreaLayoutGuide.bottomAnchor instead of bottomLayoutGuide.topAnchor [-Werror,-Wdeprecated-declarations]
        return self.bottomLayoutGuide.topAnchor;  
                    ^  
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support Files/BraintreeDropIn/BraintreeDropIn-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UIViewController.h:481:58: note: 'bottomLayoutGuide' has been explicitly marked deprecated here
@property(nonatomic,readonly,strong) id<UILayoutSupport> bottomLayoutGuide API_DEPRECATED("Use view.safeAreaLayoutGuide.bottomAnchor instead of
bottomLayoutGuide.topAnchor", ios(7.0,11.0), tvos(7.0,11.0));  
                                                         ^  
4 errors generated.  
note: Using new build system  
note: Building targets in parallel  
note: Planning build  
note: Constructing build description  
warning: Skipping duplicate build file in Copy Headers build phase:
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Models/TOActivityCroppedImageProvider.h (in target
'TOCropViewController' from project 'Pods')  
warning: Skipping duplicate build file in Copy Headers build phase:
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropOverlayView.h (in target
'TOCropViewController' from project 'Pods')  
warning: Skipping duplicate build file in Copy Headers build phase:
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Models/TOCroppedImageAttributes.h (in target
'TOCropViewController' from project 'Pods')  
warning: Skipping duplicate build file in Copy Headers build phase:
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropScrollView.h (in target
'TOCropViewController' from project 'Pods')  
warning: Skipping duplicate build file in Copy Headers build phase:
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropToolbar.h (in target
'TOCropViewController' from project 'Pods')  
warning: Skipping duplicate build file in Copy Headers build phase:
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropView.h (in target
'TOCropViewController' from project 'Pods')  
warning: Skipping duplicate build file in Copy Headers build phase:
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/TOCropViewController.h (in target
'TOCropViewController' from project 'Pods')  
warning: Skipping duplicate build file in Copy Headers build phase:
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Models/TOCropViewControllerTransitioning.h (in
target 'TOCropViewController' from project 'Pods')  
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99.
(in target 'Runner' from project 'Runner')  

无法为模拟器生成应用程序。
在iPhone 11 Pro Max上启动应用程序时出错。

共有1个答案

经佐
2023-03-14

我认为这与您的podfile有关,请尝试删除podfile&podfile.lock(将其移到其他地方,以便在需要时将其移回),它将重新构建自己。我也不会因为你而无视所有被否决的警告。

 类似资料:
  • 是否有方法运行Android模拟器上提供的示例Geofence应用程序:http://developer.Android.com/training/location/geofencing.html 应用程序在启动时关闭,我在Logcat上得到以下错误消息:

  • 应用程序不能在MAC上的模拟器和设备上运行,我只得到一个错误,说客户端还没有准备好。 我试图使Android studio失效并重新启动,试图关闭应用程序,卸载,重新运行,禁用即时运行,清理项目,重建,删除Gradle,但这些都不起作用。 下面是我得到的运行日志。 $adb推送 /Users/username/app/App/build/generalDebug-1.6.1-530966e6.ap

  • 安装失败,因为设备可能有与当前版本不匹配的陈旧dexed JAR(dexopt错误)。为了继续,您必须卸载现有的应用程序。 DEVICE SHELL命令:pm install-r“/data/local/tmp/com.example.tell_it_dell.myapplication1”pkg://data/local/tmp/com.example.tell_it_dell.myapplic

  • 问题内容: 我正在使用Eclipse管理我的Android项目,该项目使用Amazon的适用于AWS的Android库。我已将库jar文件添加到./libs文件夹,从中我将库添加到了Java构建路径(项目属性-> Java构建路径->库->添加JARS …)。我的应用程序可以正确编译,但是当我在模拟器或电话上运行它时,会出现NoClassDefFoundError。我了解到,正确编译应用程序后通常

  • 无法解析com.android.tools.build:gradle:2.3.0。 无法获取资源“https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.0/gradle-2.3.0.pom”。无法领导“https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.

  • 我的离子2应用程序不能在GenymoveAndroid模拟器中运行。错误消息是: 运行一个或多个平台时出错:错误:adb:命令失败,退出代码为1错误输出:错误:无法安装smartsocket侦听器:地址已在使用adb服务器未确认*启动守护程序失败*错误:无法连接到守护程序您可能没有运行此项目所需的环境或操作系统 端口号似乎已经被占用了。但当我停止Genymotion模拟器时,它对普通的AVD模拟器