I am trying to create iOS archive from jenkins. Whereas the Build PC the Build Command is working fine but when I run from jenkins the same command I get this issue. This is a React Native Project
COMMAND:
sh 'xcrun xcodebuild archive -workspace AppName.xcworkspace -scheme Test -sdk iphoneos -configuration release -allowProvisioningUpdates -destination "generic/platform=iOS" arch=x86_64 -archivePath "/Users/ali/Desktop/Test_bulds"'
ERROR:
/Users/ali/jenkins/workspace/Mobile/MobileAppBuild/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target 'react-native-blur' from project 'Pods')
** ARCHIVE FAILED **
The following build commands failed:
PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/ali/Library/Developer/Xcode/DerivedData/Appname-hamnkyelypjutaefdzwfxmvlwith/Build/Intermediates.noindex/ArchiveIntermediates/Test/IntermediateBuildFilesPath/Appname.build/Release-iphoneos/Appname.build/Script-CF1348D5D60844C3DD63C481.sh (in target 'AppName' from project 'AppNAme')
You mostly need to change this line in your podfile to a higher version:
#Change this to something like '12'
platform :ios, '12'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
Related
This is React Native app that contains android and ios. I can run android simulator just fine, but the problem is when trying to run and build ios simulator. I installed all the necessary packages by running this command pod install at /ios directory. This Macbook chip is M1. I have been trying many different ways to fix it for hours, but couldn't find a solution. Thank you.
Then the error is below:
yarn run v1.22.19
warning package.json: "dependencies" has dependency "react-dom" with range "17.0.1" that collides with a dependency in "devDependencies" of the same name with version "^17.0.2"
warning package.json: "dependencies" has dependency "react-native-web" with range "0.17.1" that collides with a dependency in "devDependencies" of the same name with version "^0.16.3"
$ react-native run-ios
info Launching iPhone 12 (iOS 16.0)
info Building (using "xcodebuild -workspace PolicyholderApp.xcworkspace -configuration Debug -scheme PolicyholderApp -destination id=C35CD837-FCAB-4B39-BA3C-B52F65AF113D")
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening PolicyholderApp.xcworkspace.
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace PolicyholderApp.xcworkspace -configuration Debug -scheme PolicyholderApp -destination id=C35CD837-FCAB-4B39-BA3C-B52F65AF113D
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
Prepare packages
Run pre-actions
SchemeAction Run\ Script /var/folders/6n/7yp6ql7s72j_l_47mk1r9sg80000gn/T/SchemeScriptAction-0nKoVj.sh
cd /var/folders/6n/7yp6ql7s72j_l_47mk1r9sg80000gn/T/
export ACTION=build
export ADDITIONAL_SDKS=
export AD_HOC_CODE_SIGNING_ALLOWED=YES
export ALLOW_TARGET_PLATFORM_SPECIALIZATION=NO
...
continue... and at the end
** BUILD FAILED **
The following build commands failed:
SwiftEmitModule normal x86_64 Emitting\ module\ for\ KakaoSDKAuth (in target 'KakaoSDKAuth' from project 'Pods')
(1 failure)
Podfile
...
post_install do |installer|
react_native_post_install(installer)
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
# Workaround `Cycle inside FBReactNativeSpec` error for react-native 0.64
# Reference: https://github.com/software-mansion/react-native-screens/issues/842#issuecomment-812543933
installer.pods_project.targets.each do |target|
if (target.name&.eql?('FBReactNativeSpec'))
target.build_phases.each do |build_phase|
if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
target.build_phases.move(build_phase, 0)
end
end
end
end
end
end
In Xcode, I tried to change its Build System to be Legacy Build System. Cleared all the files in /Library/Developer/Xcode/DerivedData directory. Cleared node_modules, /ios/Pods, /ios/Podfile.lock and re-installed them. None of them worked.
Using Xcode 13, I generated a framework to distribute via pod for integration, and it was successfully compiling for both device and simulator at the application side.
However, when I used the same xcodebuild command with xcode 14 to generate and distribute the framework, it threw a 'unsupported Swift architecture error' when tried to integrate the framework via pod to application.
The framework is generated using the xcodebuild command.
Command line invocation:/Applications/Xcode_14.0.1.app/Contents/Developer/usr/bin/xcodebuild build -workspace <workSpacePath> -configuration Release -sdk iphonesimulator -scheme <Scheme_name> -derivedDataPath <Derived_path> CODE_SIGNING_ALLOWED=NO ENABLE_BITCODE=YES BITCODE_GENERATION_MODE=bitcode SKIP_INSTALL=NO
Build settings from command line:
BITCODE_GENERATION_MODE = bitcode
CODE_SIGNING_ALLOWED = NO
ENABLE_BITCODE = YES
SDKROOT = iphonesimulator16.0
SKIP_INSTALL = NO`
I'm trying to build in build-flavors in my app. Android no problem but iOS gives an error when I try to export the ipa.
terminal:
➜ roger git:(ios-flavors) flutter build ios --flavor development
Building be.modero.rogerapp.development for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: **********
Running pod install... 7.8s
Running Xcode build...
└─Compiling, linking and signing... 24.1s
Xcode build done. 179.1s
Built /.../build/ios/iphoneos/Runner.app.
➜ roger git:(ios-flavors) xcodebuild -sdk iphoneos -configuration Alpha -workspace ios/Runner.xcworkspace -scheme development build -verbose | xcpretty
error:
▸ Compiling GeneratedPluginRegistrant.m
❌ /.../ios/Runner/GeneratedPluginRegistrant.m:12:9: module 'camera' not found
#import camera;
^
▸ Compiling Runner_vers.c
** BUILD FAILED **
The following build commands failed:
CompileC /Users/wim/Library/Developer/Xcode/DerivedData/Runner-dhynqmoqlyqjqtaxqfpznxnuxyab/Build/Intermediates.noindex/Runner.build/Debug-integration-iphoneos/Runner.build/Objects-normal/arm64/GeneratedPluginRegistrant.o /.../ios/Runner/GeneratedPluginRegistrant.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'Runner' from project 'Runner')
(1 failure)
I'd like to use an Azure devops pipeline for building ios bundle that contains both an iphone app and a watchos app.
There is a workspace that contains the 3 apps (one for the phone and two for the watch)
MyWorkspace:
MyPhoneApp
MyWatchApp
MyWatchApp Extension
I use the following XCode task
- task: Xcode#5
inputs:
actions: 'build'
scheme: 'MyApp'
sdk: 'iphoneos'
configuration: 'Release'
xcWorkspacePath: '$(system.defaultworkingdirectory)/MyWorkspace.xcworkspace'
xcodeVersion: '12'
This task launches xcodebuild
xcodebuild -sdk iphoneos -configuration Release -workspace
/Users/runner/work/1/s/MyApp/MyWorkspace.xcworkspace -scheme MyApp build
and it fails with the following errors:
error: unable to resolve product type
'com.apple.product-type.application.watchapp2' for platform 'iphoneos'
(in target 'MyWatchApp' from project 'MyApp')
error: unable to resolve product type
'com.apple.product-type.watchkit2-extension' for platform 'iphoneos'
(in target 'MyWatchApp Extension' from project 'MyApp')
What kind of SDK do I need to specify to build it?
The command that I'd like to run using azure pipeline xcode task is the following:
xcodebuild -configuration Release -workspace /Users/runner/work/1/s/MyApp/MyWorkspace.xcworkspace -scheme MyApp build
Without the sdk specification
-sdk iphoneos
In this way the build of each component will follow the project default and the phone app will be built using iphoneos SDK and watch app will be built using watchos SDK.
Unfortunately if I remove the sdk specification from the xcode task
- task: Xcode#5
inputs:
actions: 'build'
scheme: 'MyApp'
configuration: 'Release'
xcWorkspacePath: '$(system.defaultworkingdirectory)/MyWorkspace.xcworkspace'
xcodeVersion: '12'
then it uses its own default
-sdk $(SDK)
and it causes an error because the $(SDK) is not defined.
The right (but pretty odd) syntax for this use case is
- task: Xcode#5
inputs:
actions: 'build'
scheme: 'MyApp'
sdk:
configuration: 'Release'
xcWorkspacePath: '$(system.defaultworkingdirectory)/MyWorkspace.xcworkspace'
xcodeVersion: '12'
leaving the sdk specification empty without any value.
I have opened project after 5 months.
Setup it in new macbook. Cloned porject.
Now when i go to set dependencies using Carthage. Cartfile is same is before and code was working 5 months ago.
now i am able to get all my dependencies. But EZLoadingActivity giving error on carthage update.
Pasting terminal console here:
*** Building scheme "EZLoadingActivity_iOS" in EZLoadingActivity.xcodeproj
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -project /Users/mac/Git/project-ios/Carthage/Checkouts/EZLoadingActivity/EZLoadingActivity.xcodeproj -scheme EZLoadingActivity_iOS -configuration Release -derivedDataPath /Users/mac/Library/Caches/org.carthage.CarthageKit/DerivedData/10.3_10G8/EZLoadingActivity/2.1 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/gb/tm7hcwvs05s3zkqdp1lndwgm0000gn/T/EZLoadingActivity SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/mac/Git/project-ios/Carthage/Checkouts/EZLoadingActivity)
This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/gb/tm7hcwvs05s3zkqdp1lndwgm0000gn/T/carthage-xcodebuild.hbqgmp.log
Also pasting logs as mentioned here /var/folders/gb/tm7hcwvs05s3zkqdp1lndwgm0000gn/T/carthage-xcodebuild.hbqgmp.log
/usr/bin/xcrun xcodebuild -project /Users/mac/Git/arteciate-ios/Carthage/Checkouts/EZLoadingActivity/EZLoadingActivity.xcodeproj -scheme EZLoadingActivity_iOS -configuration Release -derivedDataPath /Users/mac/Library/Caches/org.carthage.CarthageKit/DerivedData/10.3_10G8/EZLoadingActivity/2.1 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/gb/tm7hcwvs05s3zkqdp1lndwgm0000gn/T/EZLoadingActivity SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/mac/Git/arteciate-ios/Carthage/Checkouts/EZLoadingActivity)User defaults from command line:
IDEArchivePathOverride = /var/folders/gb/tm7hcwvs05s3zkqdp1lndwgm0000gn/T/EZLoadingActivity
IDEDerivedDataPathOverride = /Users/mac/Library/Caches/org.carthage.CarthageKit/DerivedData/10.3_10G8/EZLoadingActivity/2.1
Build settings from command line:
CARTHAGE = YES
CLANG_ENABLE_CODE_COVERAGE = NO
CODE_SIGN_IDENTITY =
CODE_SIGNING_REQUIRED = NO
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO
ONLY_ACTIVE_ARCH = NO
SDKROOT = iphoneos12.4
SKIP_INSTALL = YES
STRIP_INSTALLED_PRODUCT = NO
note: Using new build system
note: Planning build
note: Constructing build description
Build system information
error: SWIFT_VERSION '3.0' is unsupported, supported versions are: 4.0, 4.2, 5.0. (in target 'EZLoadingActivity_iOS')
Build system information
error: SWIFT_VERSION '3.0' is unsupported, supported versions are: 4.0, 4.2, 5.0. (in target 'EZLoadingActivity_iOS')
Please guide me how to resolve it so i can use EZLoadingActivity libraray in my project and can able to run my project.