Platform Migration: Error when compiling project - macos

A few weeks ago I started a Firebase course with flutter, and I was programming on a Windows computer, and now I've been using a Mac for a few days, to learn how to make firebase with iOS too. However, I have received these errors, and I do not know if I am missing a file, lines of code or if I have obsolete code. I tried some solutions I found on the internet, like deleting the files pubspec.lock, podfile, podfile.lock, reinstalling using pod init and pod install, but none of these solutions managed to solve the problem. I know very little about Swift / Objective-C, and this project is connected (android) on firebase.
/Users/mobileteam/Desktop/pasta_mary/aikoBot/aiko_bot/ios/Pods/FirebaseCrashlytics/Crashlytics/Shared/FIRCLSFABHost.m100:11: warning: 'UI_USER_INTERFACE_IDIOM' is deprecated: first deprecated in iOS 13.0 - Use -[UIDevice userInterfaceIdiom] directly. [-Wdeprecated-declarations]
switch (UI_USER_INTERFACE_IDIOM()) {
^
In module 'UIKit' imported from /Users/mobileteam/Desktop/pasta_mary/aikoBot/aiko_bot/ios/Pods/FirebaseCrashlytics/Crashlytics/Shared/FIRCLSFABHost.m:20:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDevice.h:97:36: note: 'UI_USER_INTERFACE_IDIOM' has been explicitly marked deprecated here
static inline UIUserInterfaceIdiom UI_USER_INTERFACE_IDIOM() API_DEPRECATED("Use -[UIDevice userInterfaceIdiom] directly.", ios(2.0, 13.0), tvos(9.0, 11.0)) {
^
1 warning generated.
/Users/mobileteam/Desktop/pasta_mary/aikoBot/aiko_bot/ios/Runner/AppDelegate.swift:14:18: error: cannot override with a stored property 'window'
override var window: UIWindow?
^
Flutter.FlutterAppDelegate:2:14: note: attempt to override property here
open var window: UIWindow! { get set }
^
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description

Related

Xamarin iOS GoogleMobileAds package No matching framework found inside

After updating to VS 17.3.6 (Xamarin.iOS Version: 16.0.0.72) I'm getting the following error when trying to build the app for the Simulator. It does work on a physical device.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.Shared.targets(3,3): Error: No matching framework found inside '/Users/xxx/Library/Caches/XamarinBuildDownload/FAdM-8.13.0/Frameworks/GoogleMobileAdsFramework-Current/GoogleMobileAds.xcframework'.
SupportedPlatform: 'ios', SupportedPlatformVariant: 'simulator', SupportedArchitectures: 'i386, x86_64'.
I've tried deleting the obj and bin folders.
How can I solve this issue?

SkiaSharp SKSvg.Load throws MissingMethodException

I use SkiaSharp libraries on my Xamarin.Core/Xamarin.iOS project.
I try to load an SVG file from the Core library like the following;
var svg = new SKSvg();
Assembly assembly = type.GetTypeInfo().Assembly;
using (Stream stream = assembly.GetManifestResourceStream($"{assembly.GetName().Name}.Images.watermark_light.svg"))
{
svg.Load(stream);
}
The code throws on the "Load" step saying "System.MissingMethodException: Method not found: SkiaSharp.SKTextBlob SkiaSharp.SKTextBlob.CreatePositioned(string,SkiaSharp.SKFont,System.ReadOnlySpan`1<SkiaSharp.SKPoint>)"
My configuration:
Device: Debug|Simulator
Linker Behaviour: Don't link
Xamarin.iOS 15.4.0.0
xcode13.2: 8fc41ae82
Rider IDE: RD-221.5591.20
OS: MacOS Monterey 12.4 (21F79)
Libraries
SkiaSharp v2.88.1-preview.79
SkiaSharp.Views v2.88.1-preview.79
Svg.Skia v0.5.14
SkiaSharp.Svg v1.60.0
CoreLibrary/Images/watermark_light.svg(svg path)
I tried to add SKTextBlob reference to LinkerPleaseInclude.cs as well. But, it should not be the case when the linker behaviour is set to "Don't link". Also a added --linkskip argument for the relevant namespace. None of them worked. Any ideas about the issue?
Thanks!
Try updating to version 0.5.16 https://www.nuget.org/packages/Svg.Skia/0.5.16

What is causing this problem in flutter? Class AMSupportURLConnectionDelegate?

Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
lib/main.dart:1
Xcode build done. 8.9s
Failed to build iOS app
Error output from Xcode build:
objc[19485]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x20ffb8188) and ?? (0x13047c2b8). One of the two will be used. Which one is undefined.
objc[19485]: Class AMSupportURLSession is implemented in both ?? (0x20ffb81d8) and ?? (0x13047c308). One of the two will be used. Which one is undefined.
** BUILD FAILED **
Xcode's output:
error: the following command failed with exit code 0 but produced no further output
CompileC /Users/RuideWang/Library/Developer/Xcode/DerivedData/Runner-fxrieyfdpcpzjtcjlryrysiwwmvu/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/geolocator.build/Objects-normal/x86_64/GeolocatorPlugin.o /Users/RuideWang/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator-7.0.3/ios/Classes/GeolocatorPlugin.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
/Users/RuideWang/Desktop/Programmieren/rift-1/ios/Runner/AppDelegate.swift:28:1: error: expected '}' in class
^
/Users/RuideWang/Desktop/Programmieren/rift-1/ios/Runner/AppDelegate.swift:6:45: note: to match this opening '{'
#objc class AppDelegate: FlutterAppDelegate {
^
/Users/RuideWang/Desktop/Programmieren/rift-1/ios/Runner/AppDelegate.swift:5:1: error: 'UIApplicationMain' attribute can only apply to one class in a module
#UIApplicationMain
^
/Users/RuideWang/Desktop/Programmieren/rift-1/ios/Runner/AppDelegate.swift:17:1: error: 'UIApplicationMain' attribute can only apply to one class in a module
#UIApplicationMain
^
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
note: Removed stale file '/Users/RuideWang/Library/Developer/Xcode/DerivedData/Runner-fxrieyfdpcpzjtcjlryrysiwwmvu/Build/Products/Debug-iphonesimulator/geolocator/geolocator.framework'
note: Removed stale file '/Users/RuideWang/Library/Developer/Xcode/DerivedData/Runner-fxrieyfdpcpzjtcjlryrysiwwmvu/Build/Products/Debug-iphonesimulator/google_maps_flutter/google_maps_flutter.framework'
note: Removed stale file '/Users/RuideWang/Library/Developer/Xcode/DerivedData/Runner-fxrieyfdpcpzjtcjlryrysiwwmvu/Build/Products/Debug-iphonesimulator/hexcolor/hexcolor.framework'
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.
Exited (sigterm)

Why im getting this error Could not build the application for the simulator. Error launching application on iPhone 11 Pro Max?

When im trying to run my application on iOS emulator im getting this error
Does anyone know why im getting this ?
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/name/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.7.3/ios/Classes/FLTImagePickerPlugin.m:149:20: warning: 'UIAlertView' is deprecated: first deprecated in iOS 9.0 - UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead [-Wdeprecated-declarations]
[[[UIAlertView alloc] initWithTitle:NSLocalizedString(#"Error", nil)
^
In module 'UIKit' imported from /Users/name/project/project/ios/Pods/Target Support Files/image_picker/image_picker-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAlertView.h:27:12: note: 'UIAlertView' has been explicitly marked deprecated here
#interface UIAlertView : UIView
^
1 warning generated.
/Users/name/projectname/projectname/ios/Pods/Regift/Regift/AVAssetImageGeneratorTimePoints.swift:12:5: warning: 'public' modifier is redundant for instance method declared in a public extension
public func generateCGImagesAsynchronouslyForTimePoints(timePoints: [TimePoint], completionHandler: #escaping AVAssetImageGeneratorCompletionHandler) {
^~~~~~~
/Users/name/project/project/ios/Pods/Regift/Regift/Regift.swift:251:45: error: missing argument label 'preferredTimescale:' in call
let time = CMTimeMakeWithSeconds(seconds, Constants.TimeInterval)
^
preferredTimescale:
/Users/name/project/project/ios/Pods/Regift/Regift/Regift.swift:303:46: error: missing argument label 'preferredTimescale:' in call
let tolerance = CMTimeMakeWithSeconds(Constants.Tolerance, Constants.TimeInterval)
^
preferredTimescale:
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.
The app was running perfectly on the last week but I dont know why it dont built now ?
After taking some changes from user #Huthaifa Muayyad This is the error now
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
lib/main.dart:1
Xcode build done. 25,2s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/name/projectname/projetcname/ios/Pods/Regift/Regift/AVAssetImageGeneratorTimePoints.swift:12:5: warning: 'public' modifier is redundant for instance method declared in a public extension
public func generateCGImagesAsynchronouslyForTimePoints(timePoints: [TimePoint], completionHandler: #escaping AVAssetImageGeneratorCompletionHandler) {
^~~~~~~
/Users/name/projectname/projectname/ios/Pods/Regift/Regift/Regift.swift:251:45: error: missing argument label 'preferredTimescale:' in call
let time = CMTimeMakeWithSeconds(seconds, Constants.TimeInterval)
^
preferredTimescale:
/Users/name/projectname/projectname/ios/Pods/Regift/Regift/Regift.swift:303:46: error: missing argument label 'preferredTimescale:' in call
let tolerance = CMTimeMakeWithSeconds(Constants.Tolerance, Constants.TimeInterval)
^
preferredTimescale:
gRPC-C++-gRPCCertificates-Cpp-cxhudvivvbfckkebvhcbvchzlxji
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.
Exited (sigterm)
Try uncommenting the first line ios/Podfile and update it to 10.0,
Your error also says UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead Try updating imagepicker if you are using it.

Xcode 7 command failed due to signal: illegal instruction 4

I just used Xcode 7's migration tool to migrate a project from Swift 1.2 to 2. After fixing up errors missed and such, all is well except for an error which prevents me from even building: Command failed due to signal: illegal instruction 4.
I have tried the help in these articles (Xcode 7 and Swift 2.0 : Command failed due to signal: Abort trap: 6, and Command failed due to signal: Abort trap: 6) which are not identical issues to mine, but nevertheless they were not able to fix the issue.
I have cleaned the build and removed the derived data folder. I have up to date CocoaPods installation, Xcode tools are at 7.0, and I Swift compile optimization is at None. Is there anything else I'm missing?
Thanks!
So an answer was found thanks to the help of a coworker. We found the offending file in the build error, but there was no line provided. Through process of elimination, we found it to be a line that was declaring a new constant to the result of getting a JSON dictionary ([String : AnyObject], typealiased to JSONDictionary), from inside an optional dictionary. Here is the line:
let objectsDictionary = maybeJSON?[key] as? JSONDictionary
Changed this to two guard statements:
guard let goodJSON = maybeJSON as? JSONDictionary else { return ... }
guard let objectsDictionary = goodJSON[key] as? JSONDictionary else { return ... }
This line worked in Xcode 6.3.2 as it would just provide an optional value, but for some reason, some change in Xcode 7 didn't like this. I hope this can help anyone else who runs across this.
'Illegal instruction' simply means that your binary contains instructions that are invalid for the type of architecture you are trying to run the code with. Start looking at the minimum version in your project build settings.

Resources