xcodebuild command fails due to syncfusion_flutter_pdfviewer library - flutter

Xcode build fails when executing:
xcodebuild -scheme "Runner" BUILD_DIR=".../_appcircle_temp/appcircle_build_ios_simulator/SimulatorBuildDir" -derivedDataPath ".../_appcircle_temp/appcircle_build_ios_simulator/SimulatorDerivedData" -configuration "Debug" COMPILER_INDEX_STORE_ENABLE=NO ONLY_ACTIVE_ARCH=NO -arch x86_64 -quiet -workspace ".../_appcircle_temp/Repository/ios/Runner.xcworkspace"
Error:
error: Build input file cannot be found: '....syncfusion_flutter_pdfviewer/syncfusion_flutter_pdfviewer.framework/syncfusion_flutter_pdfviewer'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it? (in target 'syncfusion_flutter_pdfviewer' from project 'Pods')
I have tried adding syncfusion_flutter_pdfviewer to my POD file, but it stills failing (And documentation doesn't require to adding to pod file)
Any ideas how to solve this?

Related

Error While creating Custom Framework and xcframework

I am creating a Framework where i am adding multiple Third Party Libraries manually. and creating a Fat framework SomeFrameworkName.framework using the script below
#!/bin/sh
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
# Step 1. Build Device and Simulator versions
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
# Step 2. Copy the framework structure (from iphoneos build) to the universal folder
cp -R "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework" "${UNIVERSAL_OUTPUTFOLDER}/"
# Step 3. Copy Swift modules from iphonesimulator build (if it exists) to the copied framework directory
SIMULATOR_SWIFT_MODULES_DIR="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule/."
if [ -d "${SIMULATOR_SWIFT_MODULES_DIR}" ]; then
cp -R "${SIMULATOR_SWIFT_MODULES_DIR}" "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule"
fi
# Step 4. Create universal binary file using lipo and place the combined executable in the copied framework directory
lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework/${PROJECT_NAME}"
# Step 5. Convenience step to copy the framework to the project's directory
cp -R "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework" "${PROJECT_DIR}"
# Step 6. Convenience step to open the project's directory in Finder
open "${PROJECT_DIR}"
After Archiving i am able to get the framework file but when i try to add that framework into the demo project it gives me multiple errors as follows:
dyld: Library not loaded: #rpath/TestIOS.framework/TestIOS
Referenced from: /private/var/containers/Bundle/Application/E76B5EA8-2E7C-44A4-BDCC-A8AB0B37E500/TestAshishDemo.app/TestDemo
Reason: image not found
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/DTDDISupport.framework/libViewDebuggerSupport.dylib
or else any library names comes in the picture.
and whenever i try to create the xcframework file i get the following error
Failed to build module from its module interface; it may have been damaged or it may have triggered a bug in the Swift compiler when it was produced
i am on a crucial stage to solve this error. Anyone if facing the same issue or faced the same along the way they created framework Please Help me out
XCode Version - 12.5.1
In your target project, did you try to embed the Framework ?
(Old XCode screenshot of mine here)

Build Failed Task failed with exit code 65

I am working on a project that uses Carthage, it’s been a couple of months since the last time the project was opened. Now I am trying to move dependencies to .xcframeworks because with the old .framework, it wasn’t working. I encountered various errors and fixed them but there’s one dependency that I can’t fix, 

SwinjectStoryboard
.

I tried using this workaround and setting command line tools
I have also tried creating an empty project with only Swinject and SwinjectStoryboard dependency
but still, my build is failing with the following message
Build Failed Task failed with exit code 65: /usr/bin/xcrun
xcodebuild -project
/Users/abu/Developer/xcframework_2/Carthage/Checkouts/SwinjectStoryboard/SwinjectStoryboard.xcodeproj
-scheme SwinjectStoryboard-iOS -configuration Release -derivedDataPath /Users/abu/Library/Caches/org.carthage.CarthageKit/DerivedData/12.5_12E262/SwinjectStoryboard/2.2.0
-sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive VALIDATE_WORKSPACE=NO
-archivePath /var/folders/g9/rjxzfx7d2s51_sr6stdkpc5c0000gn/T/SwinjectStoryboard
SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO
CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO
FRAMEWORK_SEARCH_PATHS=$(inherited)
/var/folders/g9/rjxzfx7d2s51_sr6stdkpc5c0000gn/T/carthage-xcframework-HTlC
(launched in
/Users/abu/Developer/xcframework_2/Carthage/Checkouts/SwinjectStoryboard)
This usually indicates that project itself failed to compile. Please
check the xcodebuild log for more details:
/var/folders/g9/rjxzfx7d2s51_sr6stdkpc5c0000gn/T/carthage-xcodebuild.Tafjce.log
I am running the following command to build the dependencies
carthage.sh update --use-xcframeworks --platform iOS
here's my contents of my Cartfile
github "Swinject/Swinject"
github "Swinject/SwinjectStoryboard"
I am stuck on this problem for a couple of days now and would appreciate any help

`swift build` on Terminal throw `error: root manifest not found`

I wanna run my swift programing on Terminal, so I cd the root folder of my project, and run $ swift build, but there is a error occurred.
$ error: root manifest not found
Any help?
In case anyone else stumble upon the same problem, the solution for me was to cd to the Sources folder of my scripts, not the root folder.
I had this error happen to me when I was building a CLI tool on Xcode. First off, when Xcode talks about root manifest, it means package.swift. You don't have one in your directory or parent directories. I discovered 2 options:
Instead of swift build, use Xcode's UI or xcodebuild CLI and get the build files in finder/ terminal
For debug, build the build normally, and you can right click the file generated in the Project Navigator like below:
For release build, run Archive in Xcode instead and you can get the build files: Project Name 25-03-2021, 11.30.xcarchive/Products/usr/local/bin/executable in my case the executable is called Image Labeling
or, add a package.swift
Instead of creating the project through Xcode (CLI tool template) use the swift cli tool instead: swift package init --type executable . In this case, swift build works everywhere in the project, not just in Sources because package.swift was added to the root of the project.
When you call the
-Swift build
command you must use it from Swift Package Manager and you should have 2 folders in the directory:
Source
Test
you should use the following command for project:
- name: Build
run: |
xcodebuild clean test -project "yourproject.xcproject" -scheme "yourproject" -destination "platform=iOS Simulator,name=iPhone 12 Pro,OS=latest" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO
and you should use the following commands for workspace:
- name: Build
run: |
xcodebuild clean build -workspace "yourproject.xcworkspace" -scheme "yourtarget" -destination "platform=iOS Simulator,name=iPhone 12 Pro,OS=latest" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO
- name: Test
run: |
xcodebuild clean test -workspace "yourproject.xcworkspace" -scheme "yourtargetTests" -destination "platform=iOS Simulator,name=iPhone 12 Pro,OS=latest" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO

Uber SDK installed but can't be import in project using COCOAPOD

I want to use uber SDK in my project .i am using Xcode 8.3.3
I have installed it with cocoa pod method. it includes user scripts in the project but doesn't import its library in the project. I have also tried cartage method but it shows
"* Fetching rides-ios-sdk
Fetching ObjectMapper
Downloading rides-ios-sdk.framework binary at "v0.6.0"
Checking out rides-ios-sdk at "v0.6.0"
Checking out ObjectMapper at "1.5.0"
* xcodebuild output can be found in /var/folders/hc/bcjcqz9x2hb84g5_2786z85w0000gn/T/carthage-xcodebuild.vE5KMz.log
*** Building scheme "ObjectMapper-iOS" in ObjectMapper.xcworkspace
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -workspace /Moghees/Driver_APP/Carthage/Checkouts/ObjectMapper/ObjectMapper.xcworkspace -scheme ObjectMapper-iOS -configuration Release -derivedDataPath /Users/mac/Library/Caches/org.carthage.CarthageKit/DerivedData/ObjectMapper/1.5.0 -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build (launched in /Moghees/Driver_APP/Carthage/Checkouts/ObjectMapper)
This usually indicates that project itself failed to compile. Please check the Xcode build log for more details: /var/folders/hc/bcjcqz9x2hb84g5_2786z85w0000gn/T/carthage-xcodebuild.vE5KMz.log"
Help me out.

xcodebuild fails to create Archive due to SymLink error with Alamofire

This is really winding me up now, all I am trying to do is an Xcode CLI build using the Xcode command line tools.
The flow is as follows:
App Code is cloned from Git
Info Plist and my own custom plist are generated and copied to project folder
A new app icon set copied over into the assets directory
Xcode Archive build is executed
Xcode generate IPA build is executed
The issue is the Archive part keeps failing, and I cannot get it working. Annoyingly it works fine if I open the project in Xcode and Archive it through there, but that defeats the point of this automated process.
This is the command xcodebuild -verbose -scheme EpicHRV1.1.0 -archivePath ios/app.xcarchive archive
And here is the constant resultant error. I really can't figure out what its complaining about, I mean, it says something to do with Alamofire and missing modules, but why would this work in Xcode but not the command line?
Command failed: xcodebuild -verbose -scheme EpicHRV1.1.0 -archivePath ios/app.xcarchive archive
2017-01-07 20:24:04.255 xcodebuild[43780:2460638] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTFrameworks/DVTFrameworks-11754/DVTFoundation/Utilities/DVTFileSystemUtilities.mm:142
Details: lstat('/Users/Justin/Library/Developer/Xcode/DerivedData/EpicHR-dgdtmzwowkyxgkfzmizhuhiaxkrt/Build/Intermediates/ArchiveIntermediates/EpicHRV1.1.0/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Alamofire.framework/Modules') failed with errno 2 (No such file or directory)
Function: DVTRecursiveMkdirResult dvt_recursiveMkdir_returningErrorString(NSString *__strong, NSString *__autoreleasing *)
Thread: <NSThread: 0x7f90e8ae7cf0>{number = 7, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
** ARCHIVE FAILED **
Here is another lovely error which also randomly appears, but not every time...
The following build commands failed:
SymLink /Users/Justin/Library/Developer/Xcode/DerivedData/EpicHR-dgdtmzwowkyxgkfzmizhuhiaxkrt/Build/Intermediates/ArchiveIntermediates/EpicHRV1.1.0/BuildProductsPath/Release-iphoneos/Alamofire.framework /Users/Justin/Library/Developer/Xcode/DerivedData/EpicHR-dgdtmzwowkyxgkfzmizhuhiaxkrt/Build/Intermediates/ArchiveIntermediates/EpicHRV1.1.0/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Alamofire.framework
And another error that sometimes appears. With all of the above the only consistent thing is Alamofire is mentioned in the error..
The following build commands failed:
Strip /Users/Justin/Library/Developer/Xcode/DerivedData/EpicHR-dgdtmzwowkyxgkfzmizhuhiaxkrt/Build/Intermediates/ArchiveIntermediates/EpicHRV1.1.0/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Alamofire.framework/Alamofire
So I solved it with the following commands:
xcodebuild -scheme EpicHRV1.1.0 -archivePath ../ios/app.xcarchive archive
xcrun xcodebuild -exportArchive -exportOptionsPlist exportPlist.plist -archivePath ../ios/app.xcarchive -exportPath ../ios/ipa/