library not found for -lswiftCoreFoundation for architecture x86_64 - swift

I have workspace contains subprojects and one of the subproject generates static lib which is linked to main project. I have created a swift in static lib subproject and I get below build error.
library not found for -lswiftCoreFoundation for architecture x86_64

Solution: Add one .swift file to application target and it works

Related

Bundle all local transient Swift Packages into a single xcframework

I am developing a SDK and use SPM to modularise my code. All code is written in Swift.
My project structure is like this:
SampleApp (Workspace) -> SDK (SPM) -> ModuleA (SPM)
I can build and run the sample app locally successfully.
Now I want to archive/build the SDK package into a dynamic xcframework that my other clients can just drag and drop into their Xcode to consume.
I'm using xcodebuild -create-xcframework for that purpose and can successfully build a sdk.xcframework file.
But in a separated sample app where I embed the sdk.xcframework there, when import SDK module, I get this error
No such module 'ModuleA'
Failed to build module 'SDK' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug
I assume here, this is because the compiler can't find ModuleA
Is there anyway that I can bundle the ModuleA into sdk.xcframework statically, so that my clients can just drag only sdk.xcframework into their projects to consume the SDK module?
The question is pretty much: How can I bundle ModuleA and SDK into a single .xcframework for distribution

File '*.swift' is part of module 'Module'; ignoring import

I am faced with warning that actually does nothing for me in this case, but is a bit anoying.
The project is combined with several subprojects via Cocoapods, so the structure is
Root folder
Main project (that combines all the others and is used to deliver the build to the end-users. Imports Subproject 1, Subproject
2, Core)
Subproject 1 (dependent on Core, imports it via Podfile)
Subproject 2 (dependent on Core, imports it via Podfile)
Core project (independent)
Module.podspec (describes subspecs, let's assume it declares the name of the framework - Module)
The development happens in Subproject 1/2, and to use some Core classes I need to import Module to the swift file. And it works fine. Because the development happens in the project directly and Cocoapods assembles Module.framework based on Podfile imports and Module.podspec
But when I am building the project from Main project - the Subproject 1/2 and Core are all in the Module.framework. Thus, the xCode displays warning:
⚠️ File 'FileFromOtherSubModule.swift' is part of module
'Module'; ignoring import
Is there any way to handle it? I haven't found such a warning in clang flags

Error when building Scala Maven project: Could not find or load main class scala_maven_executions.MainWithArgsInFile

Error when building a Maven project using maven-scala-plugin:
[ERROR] Error: Could not find or load main class scala_maven_executions.MainWithArgsInFile
Then reason is that settings.xml file was copied from Windows to OS X without modification, however it contained Windows-specific local repository path:
<localRepository>C:\Users\<username>\.m2\repository</localRepository>
Should be changed to:
<localRepository>/Users/<username>/.m2/repository</localRepository>

How to include generated source files when Play compiles?

How can I include generated source files when my Play routes and views are compiled?
My Play 2.3 application uses a plugin that generates source files under a sourceManaged subdir (target/scala-2.11/src_managed/main/subdir). These source files include controllers and models that are referenced in my routes files and views. But when I compile my application, I get errors like this:
[error] myapp/conf/routes:14: object Contacts is not a member of package controllers
[error] GET /contacts controllers.Contacts.blank()
and this:
[error] myapp/app/views/contact/form.scala.html:1: not found: type Contact
[error] #(contactForm: Form[Contact])
[error] ^
Because controllers/Contacts.java and models/Contact.java reside under sourceManaged.
I've tried manually adding the appropriate managed sources subdir to sourceDirectory in Compile and javaSource in Compile in my build.sbt but it did not improve things.
I have considered making the managed source subdir a subproject and then using aggreate(), but it does not have the necessary build.sbt or project files -- it only has Java sources. And it seemed that making a managed source directory into a subproject from might be inappropriate. Should I reconsider this?
First make sure the plugin has a way to be added to sourceGenerators in Compile by your Play project. You can find how to do this here in the sbt documentation. I also have an example in a plugin I wrote, but note that it uses 0.12.x syntax.
Once you've done that, be sure one of your Play project build files adds the settings. This will be as simple as adding the name you used for the settings in the plugin to the build file, like this example of my plugin shows.

Getting "Unable to execute dex: Multiple dex files define" error when trying to run main project which is using other library project

I am trying use androidVNC open source project as a Library Project in my MainProject. androidVNC has also used ZoomerWithKeys library project. I want start a activity of androidVNC library project in my MainProject by clicking on a Button.
I have done all the basic things like to define all the activity of library project in Manifest of main Project.
The problem is that i am getting following error when trying to running my MainProject -
Dex Loader] Unable to execute dex: Multiple dex files define Lcom/antlersoft/android/zoomer/R$drawable;
[2013-05-16 15:44:03 - OtherProj] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/antlersoft/android/zoomer/R$drawable;
Thanks in advance.
I resolve this by doing following steps:
Go to bin folder of you app and see which libraries are duplicated(in mine I had 2 supportv4****)
Hold your mouse on them and see where they compile from, keep in mind that you should keep the most important one, so if you are using appcompat and facebookSDK, you should keep that library which comes from appcompat
Go to the properties of the project of the other library (e.g facebookSDK) -> Java build path -> Libraries and delete the dependency in which the buggy lib come from(in mine, supportV4 nested in Android Private Libraries, so I delete it),
Also do it from a file manager, go to our project folder/libs and delete that buggy library if it's not cleaned by default
In that window, after deleting, choose Add Jars... and select the library of the other project(in mine, I choose SupportV4 from appcompat)
Clean you workspace, restart Eclipse
The problem should have gone, these steps work more than fine for me
1).did you added your lib project to the main project?? Make sure..
2).also add the project to your lib project by doing this process--
In the lib project-->>right click on project-->>java build path-->>on the project tab-->>add your main project.
Now build your project..hopefully it will help you.
EDITED::
3). Go to the project properties..edit this(can give some space) and then save..clean project...then build..
I tackled with this kind error in Android Studio.
In my case my main project was using two my own lib. But beside this those two libs were using the same library as external included
compile files('lib/external-lib.jar')
I solved it by doing following in my both own libs.
1)Removing old compile files('lib/external-lib.jar' ) from build.gradle and deleting old external_lib.jar from lib folder.
2)Adding library from jcenter() two my own libs
compile 'external.lib:1.9.2'
3)Rebuild.
Then rebuild and run main project
Then problem has disappeared.