Can't build app for iOS devices with Ionic 3 - ios

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.

Related

Error building for iOS simulator in hybrid app

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.

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.

Build commands failed: CompileAssetCatalog - Cordova for iOS

After setting up a fresh Cordova for iOS project trough the CLI this error comes up.
Build commands failed: CompileAssetCatalog
/Users/a/example/example/platforms/ios/build/emulator/Example.app
/Users/a/example/example/platforms/ios/Example/Images.xcassets
(1 failure) xcodebuild: Command failed with exit code 65
Cordova Version: 9.0.0 (cordova-lib#9.0.1)
Xcode Version: 11.2.1
macOS Version: 10.15
CLI:
cordova create example com.example.app Example
(cd example)
cordova platform add ios
cordova emulate ios --target="iPhone-6-Plus, 9.3"
What I tried:
- Clean up build folder
- Update Node/NPM
- Update Xcode
P.S.: Does it make a difference if the .ipa gets build trough the Cordova CLI or from within Xcode?
Two things here:
If you are using cordova 9.0.0, I'm assuming you're also using cordova-ios 5+. In that case, the "-UseModernBuildSystem=0" in your build.json is no longer necessary. cordova-ios#5 supports the modern build system.
You should also remove the target: --target="iPhone-6-Plus, 9.3". XCode 11 no longer, by default, ships with iOS9 simulators. In fact, you should not specify a target at all, unless necessary.
If you're still facing problems after fixing these two issues, try opening and running your project via XCode, it is likely to provide an improved error log and possible hints to fixes.
there is meny approach that getting resolve exit code 67
1) method 1
cordova platform remove ios
cordova platform add ios
2) in xcode give your provision profile check
You need a development provisioning profile on your build machine.
Apps can run on the simulator without a profile, but they are required
to run on an actual device
https://cordova.apache.org/docs/en/latest/guide/platforms/ios/
3) cordova platform update ios
further informations cordova run with ios error .. Error code 65 for command: xcodebuild with args:
I have solved this issue in Xcode, by creating new
"iOS App Icon". Name it whatever you want, but you must choose it from dropdown in project's settings ie target settings, parameter is "App icons source". Then copy all images via Finder into that folder, and in Xcode
connect(drag&drop) those uncategorised images into placeholders.

Error code 65 for command: xcodebuild with args deploying ionic app to IOS

I can’t deploy my Ionic App to iOS devices even after performing all of the tasks mentioned in this forum. I followed all of the steps required for code signing so I’m no longer getting that error. Now I’m getting the following:
The following build commands failed:
Ld
/Users/laroca/Library/Developer/Xcode/DerivedData/-bfqgfiilftgpjvcfjxixwpxvluxh/Build/Intermediates.noindex/ArchiveIntermediates/apname/IntermediateBuildFilesPath/appname.build/Debug-iphoneos/appname.build/Objects-normal/arm64/appname
normal arm64 (1 failure) Error: Error code 65 for command: xcodebuild
with args:
-xcconfig,/Users/laroca/Documents/Mundo/platforms/ios/cordova/build-debug.xcconfig,-workspace,appname.xcworkspace,-scheme,Mundo,-configuration,Debug,-destination,generic/platform=iOS,-archivePath,appname.xcarchive,archive,CONFIGURATION_BUILD_DIR=/Users/laroca/Documents/appname/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/laroca/Documents/appname/platforms/ios/build/sharedpch
I tried the following to no avail:
ionic remove platform ios
ionic platforms rm ios
ionic platforms add ios
ionic run
The code signing issue appears to be resolved but I can’t get past this current issue. Please help. I’ve never been able to deploy to IOS.
For build or run iOS app you need to use below command :
ionic cordova build ios
or for release version
ionic cordova build ios --release
or for Prod build
ionic cordova build ios --prod -- release
and for code sign reference please check below answer link :
stack answer
Ionic Official Link
Hope this will 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