Build Libraries for Distribution” into ”Yes” Swift - ios

In my project I have enabled the Build Libraries for Distribution” into ”Yes” into my SDK build setting, to prevent swift upgrades from causing a problem for third party libraries. In this case, When I Build with the project for SDK, I have set legacy mode but I am facing issue like below:


The legacy does not support Build Libraries for Distribution” into ”Yes”.
How to fix this? I can able to build the project new build system instead of legacy mode
The reason for setting legacy mode is When I set a new build system and prepare to build I am getting this below error. To fix this I am using legacy mode
Multiple commands produce '/Path/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework':
1) Target 'GoogleUtilities-00567490' has create directory command with output '/Path//IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework'
2) Target 'GoogleUtilities-54e75ca4' has create directory command with output '/Path//IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework'

The workaround for this build system issue is to explicitly add all the needed GoogleUtilities subspecs to the Podfile. See the Podfile.lock file to get the list. Full details at https://github.com/firebase/firebase-ios-sdk/issues/4087

Related

No such module 'RxBlocking' in test target

I'm using Carthage for setting up my project's RxSwift dependency. And recently, I tried to use XCFrameworks instead with the command carthage update --platform ios --use-xcframeworks. I've set up all that is needed to be set (eg. changing the .frameworks to .xcframeworks in the Link Binary With Libraries in the targets' Build Phase, etc). It worked and I can run or test in the simulator, until today that is. When I was trying to do the tests this morning, all of a sudden it failed (although it worked fine before) with the error No such module 'RxBlocking'. I've double-checked it and the xcframework has already been built in the Carthage/Build folder, and the xcframework has already been added to the test target's settings.
I've tried all of these but it all failed:
Setting the $(PROJECT_DIR)/Carthage/Build to the Framework Search Paths for the target
Deleting DerivedData/ and/or Carthage/ folders
Resetting the Mac
Can anybody help me to fix this? BTW, I'm on XCode 12.4 and Swift 5. Thanks.
This is actually because of the Apple tools that can't search for the correct Frameworks Search Path. The fix is in this link: https://github.com/ReactiveX/RxSwift/issues/2292#issuecomment-804045119

Build phase script is running before needed files are created in Xcode 10

https://github.com/realm/realm-cocoa/blob/master/scripts/strip-frameworks.sh
We are always using this script to remove architectures for dynamic frameworks. It has worked with Xcode 9.
In Xcode 10, it didn't remove the architectures.
Anything in Xcode 10 that could break this?
We have a theory that it is related to the new build system
Solution
The new build system is now running scripts in parallel if its dependency is already available or if it doesn't have any dependency.
The solution is to provide input files to tell "run scripts" not to run yet without those dependencies.
This is more elaborated in this post
Alternative Solution:
We used the legacy build system as a work around.
File > Workspace Settings

how add manually a cordova plugin to ios existing project

i've a cordova project created via cordova cli command.
i build the project for Android and iOS platform but... i copied the build project into respective workspace (eclipse/xcode) and i updated that single project.
Now i need to add a plugin.
The project into cordova project folder is now so outdate so i would add the plugin via cli and copy the plugin to the respective project.
I copied successfully the generated plugin into the android project, but i'm not able to do the same thing with iOS.
For example i added the console plugin for iOS
cordova plugin add org.apache.cordova.console
if i open and run the build project it work and i see my message in console, but if i try to copy the generated plugin into my existing project it doesn't work.
nobody could help me to understand how add manually a plugin into my existing project?
update
yes i know, i'll try to explain better
i have my cordova project under folder /Document/cordova
when i made an ios build via command line cordova put the built project under /Document/cordova/platforms/ios
well i copied the folder ios under /workspace/my-project-name
after some work under workspace i see that i need to add a cordova plugin.
i added the plugin via command line and it was added to /Document/cordova/platforms/ios
at this poin i have a project under /Document with plugin but asset outdated and one project updated without plugin under /workspace
i'm trying to copy from built project to /workspace project.
i copied
/workspace/my-project-name/my-project-name/Plugins
/workspace/my-project-name/my-project-name/config.xml
/workspace/my-project-name/www/plugins
/workspace/my-project-name/www/cordova.js
/workspace/my-project-name/www/cordova_plugins.js
but it doesn't work... i missed somethings?
After reading it several times I think I get more less the idea...
Well, I am not sure why do you want to copy the ios project outside the current location. I suppose you have a good reason to do it, however you can always tweak that project instead of going back and forward, cordova will not impact non cordova related files each time you run "cordova build".
Are you familiar with control versioning? Git, SVN, mercurial? If so it is simple just we which files were impacted once you add the plugin and copy those... If no, I suggest using control versioning anyways to help keep track of your code changes.
NOTE: Be aware if you build the cordova projet and then you just want to update the files noted above it is highly likely that it won't work, that is why you run "build" is not a simple file sync. I recommend taking the new cordova project with the plugin added and then just add you personal tweaks on the ios in the other folder. Or just tweak the ios folder inside platforms folder...
I hope you are doing for good reason. Anyway you are missing to copy below file to work
/workspace/my-project-name/my-project-name/platforms/ios/my-project-name/config.xml
Copying the cordova iOS platform folder is not a good idea. The reason is, cordova builds an Xcode project in the platform folder, and there is some sort of caching/built in references to absolute location of the original Xcode project. Therefore it would be unclear to you and to Xcode which file is being referenced from within Xcode. This may have caused some other unnoticed errors in the project as well. So therefore, instead of keeping original project path available along with the new path, I would recommend renaming the original project folder in order to remove the ambiguity. This way, you will assure that the right file versions are referenced.

Xcode, Git, Jenkins, PhoneGap 1.5.0 Build Error

I have developed an application with phonegap 1.5.0 previously and now we just pushed into git repository. The app was build successfully in xCode and I was able to install the app and run it on the iPad but when we tried to build it from Jenkins, we got this error
/Users/...../Classes/AppDelegate.m:28:
/Users/......./Classes/AppDelegate.h:31:13: fatal error: 'Cordova/CDVViewController.h' file not found
#import <Cordova/CDVViewController.h>
I really don't know why is this happening. Did I not include any file into gitt that causes this problem? or is there any extra steps that I need to take to put the codes into git? Any advice on this is deeply appreciated.
My PhoneGap project is able to build and generates .ipa.
Here's what I have done for my CI integration using Jenkins:
Install Xcode integration plugin for Jenkins (manage Jenkins --> Manage Plugins --> Available --> Xcode integration).
In your Job configuration, click the Add build Step button and choose Xcode.
In Xcode configuration:
3.1. Add Clean before build.
3.2. Add Target of your project (e.g.: SamplePhonegap).
3.3. Add SDK (e.g.: iphoneos6.1).
3.4. Add Configuration as Debug or Release.
3.5. Add Xcode Project Directory which contain .xcodeproj (e.g.: ${WORKSPACE}).
3.6. Build output directory (e.g.: ${WORKSPACE}/build) [Mandatory Step for PhoneGap App].
3.7. Add Build IPA.
3.8. Add Code Signing Identity (e.g.: iPhone Developer: S*** ** (6**)).
3.9. Add Unlock KeyChain.
3.10. Add keyChain Path (e.g.: ${HOME}/Library/Keychains/login.keychain).
3.11. Add Keychain password.
Finally build your app - it will build and generate the .ipa file.
Note:
3.6 step is mandatory because a PhoneGap project has two build paths: one is our project build path and another one is cordova build path. Jenkins tough to find the path default (In native not need to specify, because it has only one build path Jenkins can easily find). So it's mandatory to provide Build output directory path.
What you can do is to try to clone the git repo to your local machine and build from there. If it's ok, it means that you need to check Jenkins setting/configuration.
This by far the best solution i found.Original Answer
Xcode 6.x
add $(OBJROOT)/UninstalledProducts/include to BuildSettings->Header Search Paths
Xcode 7.x
add $(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include to BuildSettings->Header Search Paths
1.Double click the and you can add this in.
2.Change $(OBJROOT)/UninstalledProducts/include to $(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include

How do you determine the build options that XCode uses so you can use them with xcodebuild?

I want to build my iOS projects with xcodebuild, but to do so I need to figure out all the flags and options that XCode is using to build my project when I build and run in XCode.
How can I find out what compilation flags and such XCode is using during the build process, so that I can figure out the equivalent xcodebuild command? I'm especially interested in getting this to work when I'm including external libraries like RestKit in my project.
All you need to do is tell xcodebuild the target and the configuration; everything else is contained in the project relating to the configuration.
See the manpage.

Resources