Getting Issue in Jenkins Continues Integration to HockeyApp in Xcode 8.3.2 - jenkins

All,
We are using Jenkins Continuous integration for App Uploads Below is the Script in Execute Shell in the Job.
rm -fr ~/Library/Caches/CocoaPods/
rm -fr Pods/
rm -rf ~/Library/Developer/Xcode/DerivedData/*
pod install
xcodebuild -configuration Release -scheme MyApp_Test -workspace MyApp.xcworkspace SYMROOT="${WORKSPACE}/MyApp/Build/"
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${WORKSPACE}/MyApp/Build/Release-iphoneos/MyApp_Test.app" -o "${WORKSPACE}/MyApp/Build/Release-iphoneos/MyApp.ipa"
Earlier it is working perfectly and able to the integration, Recently we updated he Xcode to 8.3.2, From then we are getting errors below are the Errors we are getting
xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH
Build step 'Execute shell' marked build as failure
Build step 'Upload to HockeyApp' marked build as failure
Can any one help in solving the issue seems PackageApplication is deprecated and exportArchive is added, how can we change to that syntax

Before: xcrun with PackageApplication
# Build the application
xcodebuild \
-scheme "${SCHEME_NAME}" \
-sdk "${TARGET_SDK}" \
-configuration Release build
# Package the application
/usr/bin/xcrun \
-sdk "${TARGET_SDK}" \
PackageApplication \
-v "${PROJECT_BUILDDIR}/${SCHEME_NAME}.app" \
-o "${BUILD_OUTPUT_DIR}/${APP_NAME}.ipa" \
--sign "${DEVELOPER_NAME}" \
--embed "${PROVISIONING_PROFILE}"
After: xcodebuild with -exportArchive
# Archive the application
xcodebuild \
-scheme "${SCHEME_NAME}" \
-sdk "${TARGET_SDK}" \
-archivePath "${PROJECT_BUILDDIR}/${SCHEME_NAME}.xcarchive" \
-configuration Release \
PROVISIONING_PROFILE="${PROVISIONING_PROFILE}" \
archive
# Export the archive to an ipa
xcodebuild \
-exportArchive \
-archivePath "${PROJECT_BUILDDIR}/${SCHEME_NAME}.xcarchive" \
-exportOptionsPlist "${EXPORT_PLIST}" \
-exportPath "${BUILD_OUTPUT_DIR}"

Related

Xcode 14.2 Unable to close provisioning ledger entry because not all of its subentries are closed

Xcode 14.2 command line tools archive failed.
xcodebuild -allowProvisioningUpdates \
-workspace $WORKSPACE \
-scheme $SCHEME \
archive \
-configuration Release \
-archivePath $ARCHIVEPATH \
ONLY_ACTIVE_ARCH=NO \
EXCLUDED_ARCHS="" | xcpretty;
** ARCHIVE FAILED **
For whom might facing the problem:
This might be the update that required the "-sdk" flag to avoid the error.
i.e.
-sdk iphoneos

xcodebuild refuses to export archive without signing

I'm trying to export a debug IPA of my IOS App from my CI (Github Actions) and I don't figure out why it fails. The following commands work on my computer:
xcodebuild clean archive \
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED="NO" CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO" \
-configuration Debug \
-allowProvisioningUpdates \
-workspace dist/ios-app/App/App.xcworkspace \
-scheme App \
-sdk iphoneos \
-archivePath dist/ios-assets/dist/myapp.xcarchive \
-destination 'generic/platform=iOS'
xcodebuild clean \
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED="NO" CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO" \
-configuration Debug \
-exportArchive \
-archivePath dist/ios-assets/dist/myapp.xcarchive \
-exportOptionsPlist dist/ios-app/App/exportOptions.plist \
-exportPath dist/myapp-preview
I end up with a debug App.ipa into the expected folder.
However, on my CI, only the 1st command succeeds, but the second yells
error: exportArchive: No signing certificate "iOS Development" found
How can it complain although I enforced an unsigned build?

Got an Archive failed when trying "xcodebuild archive" in terminal

I have created a framework with few cocoapod dependencies
.The archive for the framework is failing when i do 'xcodebuild archive' after adding the pod files (Did pod install).
In the normal build, it is working fine. There is no error and the build is successful but when I do 'xcodebuild archive' on my terminal got this below issue.
error: no such module 'Lottie'
import Lottie
^
** ARCHIVE FAILED **
The following build commands failed:
CompileSwift normal arm64 /Users/surya/Documents/Projects/Sampe\ lottie\ test/TestFramework/TestFramework/ViewController.swift
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)
Below is my xcode build archive command
xcodebuild archive \
-scheme TestFramework \
-destination "generic/platform=iOS" \
-archivePath ../Output/TestFramework.framework-iphoneos.xcarchive \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
Found the answer - we need to add - workspace ProjectName.xcworkspace, if our framework uses pods. Check the below command
xcodebuild archive -workspace projectName.xcworkspace \
-scheme projectName \
-sdk iphonesimulator \
-archivePath "./archives/ios_Simulators.xcarchive" \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
SKIP_INSTALL=NO

dyld: Symbol not found after importing .xcframework

I've created an .xcframework using this script:
FRAMEWORK_NAME=${PROJECT_NAME}
SCHEME=${PROJECT_NAME}
DISPLAY_NAME=${PROJECT_NAME}
echo "Archiving ${FRAMEWORK_NAME} for iOS simulator..." >> framework.log
xcodebuild archive \
-workspace "${PROJECT_DIR}/${FRAMEWORK_NAME}.xcworkspace" \
-scheme "${SCHEME}" \
-destination "generic/platform=iOS Simulator" \
-sdk iphonesimulator \
-archivePath "${PROJECT_DIR}/Archives/${FRAMEWORK_NAME}-iOS-Simulator" \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
echo "Archiving ${FRAMEWORK_NAME} for iOS..." >> framework.log
xcodebuild archive \
-workspace "${PROJECT_DIR}/${FRAMEWORK_NAME}.xcworkspace" \
-scheme "${SCHEME}" \
-destination "generic/platform=iOS" \
-sdk iphoneos \
-archivePath "${PROJECT_DIR}/Archives/${FRAMEWORK_NAME}-iOS" \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
echo "Creating the ${FRAMEWORK_NAME} XC Framework..." >> framework.log
xcodebuild -create-xcframework \
-framework "${PROJECT_DIR}/Archives/${FRAMEWORK_NAME}-iOS-Simulator.xcarchive/Products/Library/Frameworks/${DISPLAY_NAME}.framework" \
-framework "${PROJECT_DIR}/Archives/${FRAMEWORK_NAME}-iOS.xcarchive/Products/Library/Frameworks/${DISPLAY_NAME}.framework" \
-output "${PROJECT_DIR}/${DISPLAY_NAME}.xcframework"
However, when I import the .xcframework in another project I get this error:
dyld: Symbol not found: _$s12ReachabilityAAC10ConnectionO11unavailableyA2DmFWC
Referenced from: /private/var/containers/Bundle/Application/A5315543-8323-4270-8D40-8BB1C940801C/App.app/Frameworks/Framework.framework/Framework
Expected in: /private/var/containers/Bundle/Application/A5315543-8323-4270-8D40-8BB1C940801C/App.app/Frameworks/Reachability.framework/Reachability
in /private/var/containers/Bundle/Application/A5315543-8323-4270-8D40-8BB1C940801C/App.app/Frameworks/Framework.framework/Framework
dyld: launch, loading dependent libraries
DYLD_LIBRARY_PATH=/usr/lib/system/introspection
DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/GPUTools.framework/libglInterpose.dylib:/usr/lib/libMTLCapture.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
Every example I've seen on creating an .xcframework doesn't archive using an .xcworkspace, so I'm thinking my issue must be related to that. I need to archive the .xcworkspace because the framework has its own Cocoapod dependencies (Reachability being one of them), but the project I'm integrating with includes those dependencies.
Has anyone successfully created an .xcframework from source code that has Pod dependencies?

How to specify output dir name for ios simulator when using xcodebuild cli in combination with a xcworkspace?

I build a xcode (6.3.1) project that uses workspace because I'm using Pods.
When I do:
xcodebuild \
build \
-workspace MyProject.xcworkspace \
-scheme MyProject \
-configuration Debug \
-sdk iphonesimulator \
-ARCHS=i386 \
VALID_ARCHS=i386 \
SYMROOT="/tmp/build/emulator" \
SHARED_PRECOMPS_DIR="/tmp/build/sharedpch"
It outputs the app to:
/tmp/build/emulator/Debug-iphonesimulator/MyProject.app
Is there a way with the xcodebuild command to get it build to
/tmp/build/emulator/MyProject.app
I have tried to replace SYMROOT with
CONFIGURATION_BUILD_DIR="/tmp/build/emulator"
Now it builds to
/tmp/build/emulator/Monsenso.app
but that do not work smoothly with CocoaPods frameworks (e.g. Typhoon for DI) ~ build fails with:
The following build commands failed:
GenerateDSYMFile /tmp/build/emulator/Typhoon.framework.dSYM /run/emulator/Typhoon.framework/Typhoon

Resources