Xcode watchOS project not building from commandline - xcode

I have an 'Independent watchOS' project created in Xcode. To this project, I have linked few static libraries (as xcframework). The architecture is set to 'x86_64'. I am able to successfully build this project and deploy it on the watch simulator. The code inside the static libraries also get called and things work fine. However, when I try to build the same project from command-line, it doesnt work and fails with multiple errors.
Command used :
xcodebuild -target "TWWatchOSTemplateProj WatchKit App" -configuration Debug -destination 'platform=watchOS Simulator,arch=x86_64' build
Error :
/(Path to Libs)/TWLibs/TWBrahmaClient.xcframework:1:1: error: While
building for watchOS, no library for this platform was found in
'/(Path to Libs)/TWLibs/TWBrahmaClient.xcframework'. (in target
'TWWatchOSTemplateProj WatchKit Extension' from project
'TWWatchOSTemplateProj') warning: None of the architectures in ARCHS
(x86_64) are valid. Consider setting ARCHS to $(ARCHS_STANDARD) or
updating it to include at least one value from VALID_ARCHS (arm64_32,
armv7k). (in target 'TWWatchOSTemplateProj WatchKit Extension' from
project 'TWWatchOSTemplateProj') error: No profiles for
'com.xyz.TWWatchOSTemplateProj.watchkitapp' were found: Xcode couldn't
find any iOS App Development provisioning profiles matching
'com.xyz.TWWatchOSTemplateProj.watchkitapp'. Automatic signing is
disabled and unable to generate a profile. To enable automatic
signing, pass -allowProvisioningUpdates to xcodebuild. (in target
'TWWatchOSTemplateProj WatchKit App' from project
'TWWatchOSTemplateProj') warning: ONLY_ACTIVE_ARCH=YES requested with
multiple ARCHS and no active architecture could be computed; building
for all applicable architectures (in target 'TWWatchOSTemplateProj
WatchKit App' from project 'TWWatchOSTemplateProj')
** BUILD FAILED **
When built from command-line, why is the error related to architecture comes while the same works from xcode ? Also, is there anything to be added to the command for signing as the details are already present in the xcodeproj.

Related

Flutter Xcode build is missing expected TARGET_BUILD_DIR build setting

Xcode build done. 958.3s
Xcode build is missing expected TARGET_BUILD_DIR build setting.
Could not build the precompiled application for the device.
Error launching application on xyz’s iPhone.
I have tried many ways but could not find proper solutions
https://stackoverflow.com/a/69931437/18627732

How to get an external package to compile output for all architectures

Setup and problem
I have a React Native project that imports a simple external package, HSLuvSwift.
I am running an M1 mac and in order to get the project to compile I had to set the "Excluded Architectures" - "Any iOS Simulator SDK" to "arm64" for both "Release" and "Debug" schemas.
However when building with "Debug" schema it only builds for arm64, see screenshot below.
Building with "Release" schema builds all architectures properly, see screenshot below.
I've tried tweaking the "Architectures" and "Build active Architecture Only" settings to no avail.
How do I force Xcode to build for all architectures even while using the "Debug" schema?
External Package
Build with "Debug" schema
Build with "Release" schema

Macosx Deployment target firestore/firebase_core

Hello I get this error when I Run Flutter Code that contains firestore/firebase_core
i tried more than one deployment target but still, i get an error
Launching lib/main.dart on macOS in debug mode...
Building macOS application...
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:
- package:firebase_core
- package:firebase_core_platform_interface
- package:quiver
- package:plugin_platform_interface
- package:cloud_firestore
- package:cloud_firestore_platform_interface
For solutions, see https://dart.dev/go/unsound-null-safety
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.7, but the range of supported deployment target versions is 10.9 to 11.0.99. (in target 'BoringSSL-GRPC' from project 'Pods')
warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.6, but the range of supported deployment target versions is 10.9 to 11.0.99. (in target 'nanopb' from project 'Pods')
warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.7, but the range of supported deployment target versions is 10.9 to 11.0.99. (in target 'leveldb-library' from project 'Pods')
** BUILD FAILED **
Exception: Build process failed
This error happens because you’re trying to run your application with libraries that don’t support null safety. You can fix that by running your application with this command:
flutter run --no-sound-null-safety
In case that you’re using an IDE, you need to change the running configurations, for example in VSCode will be:
Code => Preferences => Settings => Search setting, type in "flutter test" => Dart: Flutter Test Additional Args, Add item => Add "--no-sound-null-safety
I suggest that you check this link in order to understand how to understand this error better.

XCode tests. Clang: error: linker command failed with exit code 1 for FBSDKCoreKit

I added new Tests target to my project, but I have this error even I don't use any FBSDKCoreKit dependencies in the tests. Generally I use CocoaPods, but not for FBSDKCoreKit framework. Tried everything — no results.
ld: framework not found FBSDKCoreKit
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Normal Run builds are working perfectly, just tests are not running.
In the test target settings:
My mistake. I just didn't follow all steps from FB doc:
Drag the FBSDKCoreKit.framework, FBSDKLoginKit.framework, and FBSDKShareKit.framework files into the Frameworks group of Xcode's Project Navigator. In the displayed dialog, choose Create groups for any added folders and deselect Copy items into destination group's folder. This references the SDK where you installed it rather than copying the SDK into your app.
Open Xcode's Build Settings tab in your project.
Add ~/Documents/FacebookSDK to the project's Framework Search Paths setting.
https://developers.facebook.com/docs/ios/getting-started/

Xcodebuild- Travis CI can't archive a project that uses cocoapods due to code signing error?

Trying to use Travis CI to build, archive and distribute my Ad Hoc app builds through Crashlytics (Fabric).
Having an issue with the code signing process though, as it attempts to code sign the cocoapods I am using.
Here is the output:
=== ARCHIVE ===
xcodebuild archive My Cool App - AdHoc
Pods / Bolts (AdHoc)
✗ Check dependencies (16 ms)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Check dependencies
Code Sign error: Provisioning profile does not match bundle identifier: The provisioning profile specified in your build settings (“My Cool App (AdHoc)”) has an AppID of “com.nitwitstudios.mycoolapp” which does not match your bundle identifier “org.cocoapods.Bolts”.
I was having this issue with a project that has use_frameworks! enabled.
The temporary workaround I found for this was changing the code signing identity for any iOS SDK for all of my Cocoapod frameworks to default so that it was iOS Distribution:
This doesn't really seem like a permanent solution though - this gets overwritten anytime I pod update.

Resources