Flutter iOS error "ld: framework not found installDir" - ios

I am a flutter newbie and I get this error when trying to run/build for iOS. I tried to clean Xcode, clean flutter, remove flutter, remove iOS folder, remove and re-download Xcode, but still.
No difference when trying to build from Xcode or vscode terminal.
what gets logged :
Launching lib/main.dart on iPhone 11 in debug mode...
Running Xcode build...
Xcode build done. 7.3s
Failed to build iOS app
Error output from Xcode build:
↳
2022-07-28 17:04:40.105 xcodebuild[34247:421486] Requested but did not find extension point with identifier
Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in
com.apple.dt.IDEWatchSupportCore
2022-07-28 17:04:40.105 xcodebuild[34247:421486] Requested but did not find extension point with identifier
Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension
Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/sy/mftlbsd5489gl3102v5z7fwm0000gp/T/flutter_tools.RmfxI1/flutter_ios_build_temp_dirho9O3B/temporary_xcresult_bundle
Command CompileSwiftSources failed with a nonzero exit code
Command CompileSwiftSources failed with a nonzero exit code
ld: framework not found installDir
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
Result bundle written to path:
/var/folders/sy/mftlbsd5489gl3102v5z7fwm0000gp/T/flutter_tools.RmfxI1/flutter_ios_build_temp_dirho9O3B/temporary_xcresult_bundle
Uncategorized (Xcode): Command CompileSwiftSources failed with a nonzero exit code
Error (Xcode): Framework not found installDir
Could not build the application for the simulator.
Error launching application on iPhone 11.

Try to do this:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
I checked my notes and found similar case in my experience.
Try to run these commands twice:
xcrun -sdk iphoneos --show-sdk-path
xcrun -sdk iphoneos --show-sdk-version
xcrun -sdk iphoneos --show-sdk-build-version
xcrun -sdk iphoneos --show-sdk-platform-path
xcrun -sdk iphoneos --show-sdk-platform-version
First run I got error, next time it works.

Related

How can i solve react native PhaseScriptExecution error

Currently, I'm trying to run the iOS simulator with React Native, but the following error continues to occur.
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 ***.xcworkspace.
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace ***.xcworkspace -configuration DebugDev -scheme ***Dev -destination id=***
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
...
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [CP]\ Copy\ XCFrameworks /Users/***/Library/Developer/Xcode/DerivedData/***-anoalvrwljcacmebrbezdhvomyhd/Build/Intermediates.noindex/Pods.build/DebugDev-iphonesimulator/AirBridge.build/Script-46EB2E00015FD0.sh (in target 'AirBridge' from project 'Pods')
(1 failure)
I think (in target 'AirBridge' from project 'Pods') is the main cause of the error, so how can I solve this?

Flutter export fails with multiple build flavors

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)

Errors in creating XCFramework using Cocoapods

I am trying to generate a iOS XCFramework from an Xcode framework Project(Project name XCFramework). Project consists of some of the cocoa-pods libraries like Socket IO, SwiftKeyChainWrapper etc. If I generate XCFramework without cocoa-pods, xcodebuild commands are generating the XCFramework successfully for both iOS and iOS Simulator destinations, but when I install pods in the framework project I am getting many errors. It will be really helpful if any one has come across this scenario and succeeded kindly help in generating XCFramework sample project using cocoa-pods.
Note: a) I used a small package called xcframework which generates xcfremwork in command (1)
b) If I archive the project directly from Xcode the archive gets successful.
1) Buid command:- xcframework build --project XCFramework.xcodeproj --name XCFramework --iOS EcallXCFramework
......
......
** ARCHIVE FAILED **
The following build commands failed:
Ld /Users/*******/Library/Developer/Xcode/DerivedData/XCFramework-gccrcnyzlsezmugkrqqlnpusjfci/Build/Intermediates.noindex/ArchiveIntermediates/XCFramework/InstallationBuildProductsLocation/Library/Frameworks/XCFramework.framework/XCFramework normal arm64
(1 failure)
2) Build Command:- xcodebuild archive -scheme XCFramework -destination="generic/platform=iOS" -destination="generic/platform=iOS Simulator" SKIP_INSTALL=NO
......
.......
User defaults from command line:
destination = generic/platform=iOS Simulator
Build settings from command line:
SKIP_INSTALL = NO
xcodebuild: error: Failed to build project EcallXCFramework with scheme XCFramework.
Reason: The run destination My Mac is not valid for Archiving the scheme 'XCFramework'.
3) Build Command:- xcodebuild archive
.....
.....
ld: framework not found SwiftKeychainWrapper
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** ARCHIVE FAILED **
The following build commands failed:
Ld /tmp/EcallXCFramework.dst/Library/Frameworks/EcallXCFramework.framework/EcallXCFramework normal arm64
(1 failure)

How to install AEXML module in my iOS 10 and Xcode 8 application using carthage?

I am trying to add AEXML module (https://github.com/tadija/AEXML) for XML parsing in my iOS 10 application with Xcode 8. However, I am getting this error while building dependencies with the command carthage update --platform iOS.
Swift Version: 3.0
Xcode Version: 8
Carthage Version: 0.17.2
cartfile
github "tadija/AEXML"
Error after running carthage update --platform iOS command
gsirn-021308:ApplePaySwag-Final chandeln$ swift -version
Apple Swift version 3.0 (swiftlang-800.0.46.2 clang-800.0.38)
Target: x86_64-apple-macosx10.9
gsirn-021308:ApplePaySwag-Final chandeln$ carthage update --platform iOS
*** Fetching AEXML
*** Checking out AEXML at "4.0.0"
*** xcodebuild output can be found in /var/folders/q7/bltc5kls62n2mzlvwhctctzr0000gn/T/carthage-xcodebuild.3NnOoT.log
*** Building scheme "AEXML iOS" in AEXML.xcodeproj
** BUILD FAILED **
The following build commands failed:
CompileSwift normal arm64 /Users/chandeln/Documents/ApplePaySwag-Final/Carthage/Checkouts/AEXML/Tests/AEXMLTests.swift
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)
A shell task (/usr/bin/xcrun xcodebuild -project /Users/chandeln/Documents/ApplePaySwag-Final/Carthage/Checkouts/AEXML/AEXML.xcodeproj -scheme AEXML iOS -configuration Release -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build) failed with exit code 65:
** BUILD FAILED **
The following build commands failed:
CompileSwift normal arm64 /Users/chandeln/Documents/ApplePaySwag-Final/Carthage/Checkouts/AEXML/Tests/AEXMLTests.swift
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)

xcodebuild build failed with Xcode 7.1 and iOS 9.1 for iOS project with Cordova

I am trying to build iOS projects from the command line as part of a CI system. I intend to use the xcodebuild command to get an app file, then the app file will be provided to the xcrun command to get a signed ipa file for distribution.
My projects use Cordova, which is located in the folder <project-folder>/CordovaLib.
In the project folder, I executed the following command from within an Ant script:
xcodebuild -target "<project-name>" -configuration Release clean build
The CordovaLib target was built succesfully, and it was produced the file:
<project-folder>/CordovaLib/build/Release-iphoneos/libCordova.a
This is visible by the following snippet of log:
[exec] CreateUniversalBinary build/Release-iphoneos/libCordova.a
normal armv7\ armv7s\ arm64 [exec] cd <project-folder>/CordovaLib
[exec] export
PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/quake/bin:Applications/tools/apache-ant-1.8.4/bin:/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin"
[exec]/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool
-static <project-folder>/CordovaLib/build/CordovaLib.build/Release-iphoneos/CordovaLib.build/Objects-normal/armv7/libCordova.a
<project-folder>/CordovaLib/build/CordovaLib.build/Release-iphoneos/CordovaLib.build/Objects-normal/armv7s/libCordova.a
<project-folder>/CordovaLib/build/CordovaLib.build/Release-iphoneos/CordovaLib.build/Objects-normal/arm64/libCordova.a
-o <project-folder>/CordovaLib/build/Release-iphoneos/libCordova.a
During the build of the target <project-name> I got the following error for three times:
ld: file not found:
/build/Release-iphoneos/libCordova.a clang: error:
linker command failed with exit code 1 (use -v to see invocation)
And finally:
The following build commands failed: Ld
build/HelloWorldProjectHelloWorldIpad.build/Release-iphoneos/HelloWorldProjectHelloWorldIpad.build/Objects-normal/armv7/HelloWorld
normal armv7 Ld
build/HelloWorldProjectHelloWorldIpad.build/Release-iphoneos/HelloWorldProjectHelloWorldIpad.build/Objects-normal/armv7s/HelloWorld
normal armv7s Ld
build/HelloWorldProjectHelloWorldIpad.build/Release-iphoneos/HelloWorldProjectHelloWorldIpad.build/Objects-normal/arm64/HelloWorld
normal arm64 (3 failures)
So the file libCordova.a was produced in the folder:
<project-folder>/CordovaLib/build/Release-iphoneos
and it was searched instead in:
<project-folder>/build/Release-iphoneos
I'm using Xcode Version 7.1 (7B91b) with iOS 9.1.
Should I set something on Xcode in addition to the parameters I have used in the xcodebuild command from the command line?
Thanks in advance, Simone.
My project comes from a MEAP IDE. I discovered that the auto-generated project file project.pbxproj had this setting for the linker:
OTHER_LDFLAGS=-force_load "$(BUILT_PRODUCTS_DIR)/libCordova.a" -Obj-C
Hence I modified this way the xcodebuild command invocation:
xcodebuild -target "<project-name>" -configuration Release clean build 'OTHER_LDFLAGS=-force_load "$SRCROOT/CordovaLib/build/Release-iphoneos/libCordova.a" -Obj-C'
That resolved my problem.

Resources