Error building for iOS simulator in hybrid app - ios

I've been struggling with an error building my app with ionic and cordova.
Everything started when I tried a "ionic cordova build ios --prod --release". It retrieved an error regarding FirebaseAnalytics for architecture arm64
"clang: error: linker command failed with exit code 1"
Reinstalling the pods and removing and adding the ios platform again I got this error even without the --release flag.
error: Building for iOS Simulator, but the embedded framework 'WebRTC.framework' was built for iOS. (in target 'Qvadis' from project 'Qvadis')
and I'm stuck here and I don't know if something changed with the latest XCode version (12.0) or the latest iOS version (14) or I have a dependencies problem.
Before that, it compiled just fine.
Thank you in advance,
Borja.

I found a solution:
In Build Settings, selecting your app as Target, you have to type "arm64" in "Excluded architectures".
However, this doesn't allow you to archive and publish it so you have to remove the "arm64" excluded architecture to perform those actions.
I don't know if this is a good approach, but this is the one that works for me.

Related

Xcode fails to build flutter code for ios 13.3.1 device but runs code on 13.3 ios simulator

below is what I am getting on Xcode 11.3.1 and ios 13.3.1. what shall I do?
the code works on the ios simulator and builds for it is always successful. so where is the issue? what's wrong here, or am I missing some thing here?
I did try the clear / install pods method but nothing has been working for me.
iMac:x me$ flutter build ios
The plugin `device_id` is built using an older version of the Android plugin API which assumes that it's running in a full-Flutter environment. It may have undefined
behaviors when Flutter is integrated into an existing app as a module.
The plugin can be updated to the v2 Android Plugin APIs by following https://flutter.dev/go/android-plugin-migration.
Building com.x.demo for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: MHUCCU5SX2
Running pod install... 5.9s
Running Xcode build...
├─Building Dart code... 61.5s
├─Generating dSYM file... 1.0s
├─Stripping debug symbols... 0.9s
├─Assembling Flutter resources... 1.9s
└─Compiling, linking and signing... 20.5s
Xcode build done. 239.8s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
The plugin `device_id` is built using an older version of the Android plugin API which assumes that it's running in a full-Flutter environment. It may have
undefined behaviors when Flutter is integrated into an existing app as a module.
The plugin can be updated to the v2 Android Plugin APIs by following https://flutter.dev/go/android-plugin-migration.
Building AOT snapshot in release mode (ios-release)...
Building App.framework for arm64...
Building App.framework for armv7...
Building AOT snapshot in release mode (ios-release)... 60.1s
Built to build/aot/.
warning: parsing line table prologue at offset 0x6f697463 found unsupported version 0x00
warning: line table parameters mismatch. Cannot emit.
note: while processing /Users/me/AndroidStudioProjects/x/build/aot/armv7/snapshot_assembly.o
The plugin `device_id` is built using an older version of the Android plugin API which assumes that it's running in a full-Flutter environment. It may have
undefined behaviors when Flutter is integrated into an existing app as a module.
The plugin can be updated to the v2 Android Plugin APIs by following https://flutter.dev/go/android-plugin-migration.
Project /Users/me/AndroidStudioProjects/x built and packaged successfully.
ld: warning: ignoring file /Users/me/AndroidStudioProjects/x/ios/Flutter/App.framework/App, building for iOS-armv7 but
attempting to link with file built for iOS Simulator-x86_64
ld: warning: ignoring file /Users/me/AndroidStudioProjects/x/ios/Flutter/App.framework/App, building for iOS-arm64 but
attempting to link with file built for iOS Simulator-x86_64
error: the following command failed with exit code 0 but produced no further output
Ld
/Users/me/Library/Developer/Xcode/DerivedData/Runner-axlithrrzxajtgfxqkefalkhujgj/Build/Intermediates.noindex/Runner.build/Release-iphoneos/Runner.build/Objec
ts-normal/arm64/Binary/Runner normal arm64
/* com.apple.actool.document.warnings */
/Users/me/AndroidStudioProjects/x/ios/Runner/Assets.xcassets:./AppIcon.appiconset/(null)[2d][Icon-App-50x50#1x.png]: warning:
The app icon set "AppIcon" has 6 unassigned children.
/Users/me/AndroidStudioProjects/x/ios/Runner/Assets.xcassets:./AppIcon.appiconset/(null)[2d][Icon-App-50x50#1x.png]: warning:
The app icon set "AppIcon" has 6 unassigned children.
/* com.apple.actool.compilation-results */
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon20x20#2x.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon20x20#3x.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon29x29.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon29x29#2x.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon29x29#3x.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon40x40#2x.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon40x40#3x.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon60x60#2x.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon60x60#3x.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon20x20~ipad.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon20x20#2x~ipad.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon29x29~ipad.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon29x29#2x~ipad.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon40x40~ipad.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon40x40#2x~ipad.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon76x76~ipad.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon76x76#2x~ipad.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/AppIcon83.5x83.5#2x~ipad.png
/Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/Assets.car
/Users/me/Library/Developer/Xcode/DerivedData/Runner-axlithrrzxajtgfxqkefalkhujgj/Build/Intermediates.noindex/Runner.build/Release-iphoneos/Runner.build/asset
catalog_generated_info.plist
Non-fat binary /Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/Frameworks/App.framework/App is not
armv7. Running lipo -info:
Non-fat file: /Users/me/AndroidStudioProjects/x/build/ios/Release-iphoneos/Runner.app/Frameworks/App.framework/App is
architecture: x86_64
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning build
note: Constructing build description
This is a known issue with iOS 13.3.1 signing. It has no solution at this point in time. Current options include:
Use simulated device (rather than physical iPhone)
Use device with older iOS version
Use paid developer account (not personal team)
See this discussion that has up to date info:
https://github.com/flutter/flutter/issues/49504
For me the solution was to move to legacy mode buildfromNew Build` and everything worked properly !
It has been confirmed that the issue is fixed in iOS 13.4 beta 3 (17E5241d) release.

Unable to build Xcode Project: clang error: linker command failed

I have a Unity project which I have successfully built for Android without issue. When trying to build for iOS I am encountering an issue once the project is in Xcode.
Unity compiles without any errors and creates an Xcode project.
Upon opening the Xcode project I have NO simulators available. I can get these simulators by selecting ios in the Supported Platforms section, at which point simulators become available - originally Supported Platforms is set to iphoneos. This seems extremely odd behaviour to me, and suggests something larger going wrong.
After getting a simulator to select I get the following error when trying to compile/run/build:
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The full error is available on Pastebin (too large to post directly on here):
https://pastebin.com/3fYR8fE3
I'm really at a loss on what I can do. I have tried a number of things, including:
Building from Unity as Debug and Release
Building from Unity with 'Symlink Unity Libraries' on and off
Building from Unity with .Net 3.5 and .Net 4.* flavours
Manually adding the libiconv.2.dylib file in the linked frameworks tab as the .tbd equivalent
Setting the target minimum version of iOS to 9.0 (negates the need for libiconv.2.dylib entirely)
I am using latest versions of everything:
Unity 2018.2.17f1
Xcode 10.1
It seems like you have the library il2cpp built for another architecture, have you tried to change your target's "Build Settings > Build Active Architectures Only" to "No"?
However I made some researches and it seems that Unity for iPhone doesn't deploy on simulator. It only works on device or in the Unity editor. Check this link out

Can't build app for iOS devices with Ionic 3

I'm developing an app for android and iOS.
I'm using firebase to receive push notifications. When I build for Android, it works fine, but no luck with iOS.
I followed a tutorial for firebase, put the GoogleService.plist on resources folder. I've created the authentication key on Apple Developer Website. I have a paid Apple developer account.
I used cocoapods to install dependencies of the project.
But, when I run, using the Xcode 10, I got this error:
Plugins/cordova-plugin-firebase/Protobuf.framework/Protobuf(Wrappers.pbobjc.o)
ld: 585 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Anyone have the same issue?
Thanks
Make sure you're using the following command to build:
Development
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
Production
ionic cordova build ios --prod --release -- --buildFlag="-UseModernBuildSystem=0"
as discussed by the ionic dev team, the new build system of xcode is not supported yet, then you should use the older one.
When opening the project in Xcode, if you're using a plugin that use cocoa pods as dependence manager, Google Maps is a example, you should open the ProjectName.xcworkspace file instead of ProjectName.xcodeproj as the xcworkpace knows how to compile a cocoa pods plugin dependece based.
ionic cordova build ios --prod --buildFlag='-UseModernBuildSystem=0'
Just as a side note that you will stumble upon, XCODE exposes a Signing bug, so untick the “Automatically manage signing” and tick again in XCODE.

Firebase react-native iOS build fails with "-fobjc-weak is not supported on the current deployment target"

If I try to run my react-native app from XCode, xcode fails with the message:
-fobjc-weak is not supported on the current deployment target
If I run from a shell react-native run-ios, then I get also an error message:
** BUILD FAILED **
The following build commands failed:
CompileC /Users/michel/Development/Androdev/Firebase/Sample/FlightLogIos/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/nanopb.build/Objects-normal/x86_64/nanopb-dummy.o Target\ Support\ Files/nanopb/nanopb-dummy.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
However, the app still runs. It is annoying though as I think I will have at some point to do some Objective C code for my project. Does anybody know how to resolve this issue?
I'm using Firebase in a regular, non-react-native Xcode project. I had the same error when building nanopb target. When I checked settings, deployment target for nanopb was set to 4.3. Just updating it to something more recent, like 9.0 fixed this error for me.
i just ran into the same problem. i fixed it for me by increasing the ios deployment target of the nanopb target to iOS 8.0 (its 4.3 per default). Pods Project -> target: nanopb -> iOS Deployment Target: iOS 8.0
I had the same problem with my ionic app, and I did this steps:
Close xcode
Command line remove ios platform
Command line add ios platform
Open xcode and open PROJECT.xcworkspaces
Xcode give me some recommendations in project and apply
Clean and build and it's works
I hope this helps

Ionic Xcode build, Apple Mach-O Linker Error

I know this has been posted about a million times but I still can't figure out what's going on.
This is an Ionic 3 project that already works and builds fine on Android. I am now trying to build it for iOS and I'm getting this error when building in Xcode. I already checked my Link Binary With Libraries build phase and there are no pod files in there. Also I am in the .xcworkspace file, not the .xcodeproj.
Apple Mach-O Linker Error
Linker command failed with exit code 1
When I build using ionic cordova build ios I get an error code 65 for build command xcodebuild.
Edit: After some more digging I think I found a more specific error, Framework not found FileProvider for architecture x86_64.
I would like to give an alternative here. That is you can use Ionic Package service.
Ionic Packages makes it easy to build a native binary of your app in
the cloud. Perfect for developers using Windows that want to build iOS
apps.
This lets you:
Send your packaged app to others
Build your app for platforms not supported by your computer (e.g. iOS
builds on Windows)
Build .ipa and .apk files that you can submit to app stores

Resources