Facing issue integrating the ACSUICalling library to my project - ios

i am trying to integrate ACS to my app and facing this issue
Failed to build module 'AzureCommunicationCalling'; this SDK is not
supported by the compiler (the SDK is built with 'Apple Swift version
5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8)', while this compiler is 'Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3
clang-1400.0.29.51)'). Please select a toolchain which matches the
SDK.
it is working fine with another project
i tried adding 'AzureCommunicationUICalling', '1.1.0' to my xcode project with minimum deployment target 14.0 and expected to use it

Please try to install both compilers (5.6 and 5.7) on the build machine and then check.
Users with a similar issue were able to fix the issue by following the steps outlined in this SO thread. Quoting here for your convenience.
“You need to set the Build Settings > Build Options > Build Libraries
for Distribution option to Yes in your framework's build settings,
otherwise the swift compiler doesn't generate the necessary
.swiftinterface files which are the key to future compilers being
able to load your old library.
This ends up in your project.pbxproj file as:
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
Please try the above steps and let us know how it goes.

Related

Failed to build module from its module interface

I have added a third party pod to my project. While i can build the app just fine in Debug target. As soon as i try to build my project with release target i get this build error.
Failed to build module 'XXXX' from its module interface; the compiler that produced it, 'Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55)'
I am not sure why it is only giving this problem with Release target and not with Debug target.
Any kind of help here would be really helpful. I am using Xcode 12.5

Module compiled with Swift 4.2.1 cannot be imported by the Swift 5.0 compiler

I am trying to implement integration of third party app into project as per instruciton https://github.com/Paytm-Payments/Paytm_iOS_App_Kit/tree/master/Swift/BitCodeDisabled/PaytmNativeSDK
I see the following error in build
Module compiled with Swift 4.2.1 cannot be imported by the Swift 5.0
compiler
I have tried toolchains https://medium.com/xcblog/switching-swift-versions-inside-xcode-using-toolchains-755b28831c43
The error changes to Reason: Incompatible library version: PaytmNativeSDK requires version 1.0.0 or later, but libswiftCore.dylib provides version 0.0.0
How do i setup XCode or the Library to make it work . There is no chance of the vendor updating the library for Swift 5.0 and make it available on POD.
For Carthage users: After upgrading to Xcode 10.2, I ran into this same issue with a framework that I had been importing using Carthage.
I resolved it by rebuilding the framework:
carthage update --no-use-binaries --platform iOS
The correct solution is download Xcode 10.1, and wait for Apple patch the bug fix.
Don't waste time on fix third-party bug.
The problem of my project is we are using Alamofire which is failed to update by Carthage.
The provider of this library should rebuild it with BUILD_LIBRARY_FOR_DISTRIBUTION = YES; (available in Xcode 11.3 in Build Settings -> Build Options). Already asked to do it in the corresponding GitHub issue. After that PaytmNativeSDK will be compatible with every next Swift version.
It looks like the issue has been fixed in 804152caae76245d96548eb74ea87a6150239407.
I wanted to use Swift 4.2 (which Xcode 10.2 should still support, I've set it in Swift Language Version), but it still gave me an error about the Swift 5.0 compiler. So after trying to clear everything like build folder, derived data and stuff, I came to the conclusion that it does not work on Xcode 10.2.
I reverted back to Xcode 10.1 which you can download here. This works. So until Apple fixes this bug I am forced to stay on Xcode 10.1.
The developers of the framework need to provide an update, which is built in Xcode 10.2.
Explanation for framework developers:
Even if you created the framework in Xcode 10.2 or with the default version used by CI, your users may still encounter such an error. You should make sure that Xcode 10.2 is your default command line tool. You can check it in terminal with the command xcodebuild -version.
Default version can be adjusted in Xcode -> Preferences -> Locations -> Command Line Tools.
This will happen if you have external libraries in your project thats still built using 4.2 compiler, whereas the new Xcode tries building your project in 5.0 compiler.
In my case, I had few libraries imported using Carthage. Luckily the libraries that I have used have released an updates in the past few days making it compatible with Swift 5.0 compilers. If those external libraries haven't updated it to support Swift 5.0 you may be out of luck for now.
On the way you might still face few issues and here are some best practices to avoid further issues.
Remove the cartfile.resolved and Carthage folder completely
Ensure you remove any copy of the libraries added to your project earlier.
Remove the embedded libraries and Linked frameworks and libraries from your Targets> Yourapp > General .
Product > Clean build folder
Update the Cart file and fetch the new sources using the Carthage update command
Now import the libraries back to your project.
Hopefully it works.
My problem with Carthage was related to the xcode phase that copys binaries in
"carthage copy-frameworks" phase.
I've a slightly different solution to the one commented in https://stackoverflow.com/a/55362536/721929, because that solution also updates dependencies versions in some cases.
So, I just executed "carthage build". I also include a cache clean for Carthage, to fix possible errors in subtasks (in my case, failing in git clone with "exit code 1")
rm -rf ~/Library/Caches/org.carthage.CarthageKit
carthage build --no-use-binaries --platform iOS --verbose
Just remove all the *.framework folders, fetch and generate then just Import the new framework folders to your project.
That's what helped me.
For Instance:

PLCrashReporter frameworks integration produce "Could not inspect the application package." error

I am actually trying to integrate PLCrashReport using either a Framework (the one given on the official website) or Carthage.
Carthage won't compile the framework, and the manual drag & drop with the one downloaded from the website would produce the following error when installing the app on the device (Run build)
App installation failed
Could not inspect the application package.
I use a build target of iOS8, I linked the framework as an embedded binary to ship it with the app ; and this error is very annoying.
Xcode is in 7.3
Right now, I tried manual build for the framework, clean of the project. None would work.
By curiosity, I tried Cocoapod integration for this library, it worked, but Cocoapod is NOT an option on my project so I can't go with it.
Does anyone have had the same issue, any ideas for correcting it ?
Finally found a way to make it work :
PLCrashReporter should NOT be in embedded frameworks, just in linked frameworks. Works like a charm now, debug and release builds !

SoundCloud iOS SDK architectures

Im working on a music streaming iOS project and want to leverage the SoundCloud SDK.
I followed this guide to the tee:
https://developers.soundcloud.com/docs/api/ios-quickstart
The five SoundCloud dependencies are:
CocoaSoundCloudAPI
OAuth2Client
JSONKit
OHAttributedLabel
CocoaSoundCloudUI
All five of these projects are available as submodules that you simply add to your current git repository. According to the guide linked above, you are supposed to be able to add them and move on with your project. However, their architectures are all different! CocoaSOundCloudAPI, JSONKit, OHAttributedLabel and CocoaSoundCloudUI are all 32bit architecture projects, while OAuth2Client is a 64bit architecture project.
No matter what I build my project as, 32 or 64bit, I get a Mach-O linker error. I've added both 32bit and 64bit as Valid Architectures in my main Xcode Project, but the issue persists.
I have also not been able to find other versions of these submodules. I can't be the only one with this problem, as I have literally followed the guide word by word, yet I can't find any solution anywhere.
Please help me out!
I am using Xcode 6 and building for the iOS8 SDK.
Thanks!
Edit:
Here are screenshots of my architectures and the error...
I HIGHLY suggest using CocoaPods to manage this dependency. I once integrated SoundCloud into a project without using CocoaPods and it was a pain in the rear. Look at this link and do a search for CocoaPods to see how to install it: https://github.com/soundcloud/CocoaSoundCloudAPI
Here's something that helped me:
Go to the SmartSpeakers target (or whichever is the target for your app)
Build Settings -> Other Linker Flags
Add $(inherited)
Build it!
CocoaPods was the way to go for me. My Podfile looks like this:
pod 'CocoaSoundCloudAPI', '1.0.1'
pod 'CocoaSoundCloudUI', '1.0.5'
pod 'JSONKit', :podspec => 'https://gist.github.com/marcdown/5282955/raw/2a52cfd92f112f2a52669420c82c1bb1efd15d2a/JSONKit.podspec'
As of the time of this post, the podspec fetches version 1.6.0. I experienced problems with some deprecation issues in earlier versions of JSONKit. If one leaves out the pod for JSONKit, an earlier version that contains these issues is installed by Cocoapods.
I also had to disable ARC for the JSONKit pod in its Build Settings to silence ARC errors:
Pods-JSONKit -> Build Settings -> Apple LLVM 6.0 - Language - Objective C
This did it for me.
Are you trying to deploy to a 64-bit device? Try setting Build Active Architecture Only to NO under Targets -> Your App -> Build Settings -> Architectures.
EDIT: I followed the instructions and created a sample project that builds. I couldn't figure out exactly why you were getting that linker error, but maybe you can compare my project to yours.
http://lieberman.nyc/sample_soundcloud_project_for_relatively_slow_on_stackoverflow.zip

Xcode 5 "Missing compiler spec LLVM 4.2" error

I am currently trying to build my project in Xcode 5. Build fails with error:
Dependency Analysis Error:
missing compiler specification <XCCompilerSpecification: Some memory address here :'com.apple.compilers.llvmgcc42':MISSING:Default> for file
for all code files in project.
The project used to be built in Xcode 4.6 with LLVM 4.2 and now Xcode 5 only supports LLVM 5. So there is obviously something related to that here.
I have set the build settings in Xcode 5 to use LLVM 5 and the build still fails for the same reason. Has anyone encountered this before and know how to stop Xcode 5 from looking for LLVM 4.2 which it no longer supports?
This question is as a result of iOS 6 vs 7 appearance build settings
I had a same problem and I found that under Project-> Build Rules, gcc compiler was being used which no longer exist with Xcode 5.
I found something similar in an old project I have today. What happened is that there was a subproject in my project and that one wasn't set to llvm5.
You may want to do a search in your directory to find a file specifying llvm 4.2, like such:
MyMac:~/path/to/my/project $ grep -rHin llvm *
MyProject.xcodeproj/project.pbxproj:334: GCC_VERSION = com.apple.compilers.llvmgcc42;
MyProject.xcodeproj/project.pbxproj:348: GCC_VERSION = com.apple.compilers.llvmgcc42;
If that's the case, try updating that subproject or removing it altogether, see if you can at least clean your build.
Hope this helps.
first, if you use virtual machine, maybe it's the problem when it doesn't have grant to access into your project
if not check your file Maybe you miss any file?

Resources