unable to create new static Library out of existing source code - iphone

I'v done quite a bit of R&D on creating static libraries in iOS and came across some well written blogs. I followed this link and also this to create a static library. I have follwed the steps specified in those blogs i.e, i added all the implementation files(.m) to the static library and deleted them from the main target etc... But, i am getting around 700 erros (which is quite bizarre) when i try to build the code. i am posting a screenshot of my errors here..
Is there anything that i am missing here or doing wrong?

Please check the imported Header files.
The .m files, which have these errors, may have the same imported files.
Maybe a semi-comma or parentheses is missing or used incorrectly.

Related

Xcode 14: Custom templates don't appear in Swift Package file creation

I'm in a bit of a pickle. I created custom files templates for my Xcode projects.
In a normal project environment my custom templates appear when I access the New file creation popover as you can see in the following screenshoot
These templates are located at the common path of: /Users/XXXX/Library/Developer/Xcode/Templates
The problem appear when I'm working on a swift package.
When I try to create a new file the popover interface is very different and does not contain my custom templates as seen with in the following image:
My suspicion is that I should set my templates in an other specific location for swift packages but I don't know where. I have looked around and I don't seems to find any reference to where I should set custom content for Swift Packages.
I'm looking for any tips on that matter. Or any information that could give me a some clues on how to fix my issue.
Thank you in advance.

Import third party C library into swift causes error "Include of non-modular header inside framework module"

This question is a continuation of a previous one I'm currently migrating this (https://github.com/emilwojtaszek/leveldb-swift) library from swift 2 to swift 3/4. Here is the link to my fork https://github.com/lu4/leveldb-swift/tree/MigrationFromSwift2ToSwift3 (please note that the target branch is MigrationFromSwift2ToSwift3)
I was able to resolve (with many thanks to #Ruslan Serebriakov) all of the issues with initial code base and check that the code is running.
However after trying to update LevelDB C code to latest master I got new type of error which I don't understand how to resolve:
Include of non-modular header inside framework module 'LevelDB.c': '/Path/to/Project/leveldb-swift-migration/vendor/leveldb/include/leveldb/export.h'
I've did some research on the internet but the issues described there seem non-related with one I've stumbled on. Here is an image of the issue
Any help is appreciated, thank you in advance!
I'm never 100% certain with mixed language frameworks. But an error like this happens in Swift projects when:
since you cannot use a Bridging Header in frameworks,
you #import a C header in the Foo-Framework.h to expose it so the Swift code, and
the header is not itself marked "Public" to the target.
"Non-modular" seems to indicate "not part of the published module interface". At least with Swift--C mixes, you can only combine both through making the C headers public; no way to import private header files there, which is weird.
Give it a shot: Since you are obviously importing the file in non-Swift code, try to locate the export.h header file in your Xcode project, open the File inspector (⌘⌥1), and ensure public visibility in the framework target:
This issue is because the SDK u are importing is not modular or u can say modulemap file is missing. So make sure modulemap file should be available inside the framework folder. Also make sure that all public headers are listed explicitly in the modulemap. This issue will be resolve 100% if module map file will be include in the third party framework.

Google App Engine (GAE) WEB-INF/lib order

Hey guys i'm working on a project with Google App Engine. To get Data from my devices we're using MQTT. The org.eclipse.paho.client.mqttv3.* library starts a Thread with "client.connect()".
After some researches i found that you cant just simply create Threads when working with GAE. Following error is shown:
java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThreadGroup")
So i continued searching and someone told to use following code instead of a "normal" Thread:
Thread monitoringThread = ThreadManager.createThreadForCurrentRequest( new Runnable() {..}
So i decompiled the paho library, looked up where the Thread is created and changed it.
I created a new class exported it as mymqttclient.jar
In eclipse i changed the order of my build at Properties -> Java Build Path -> Order and Export so mymqttclient.jar is loaded before the mqtt-client-0.4.0.jar So that it will use my created function with the monitoringThread.
But how can i change the order of the .jar's in the web-inf/lib ?
Thank you very much for your answers, i couldnt find something useful until now.
Firstly there is no need to decompile any of the Paho code it is all available from here.
Since you can now get the clean source, why not just modify the original class and rebuild the jar file, then you don't need to worry about messing with the Classpath to get your class to load first?

Ember CLI project crashes when I change CSS file. Am I missing something?

I'm pretty new to Ember but have used Ember CLI to create a project and am on my way. Lots to learn but I'm very impressed so far.
Anyway, my understanding is that Ember CLI projects use broccoli's file-watching features to create a "continuous development" environment. I've seen it in action: as I change templates or javascript files, my changes are immediately apparent when I switch back to the browser.
But when I make changes to css files, my app crashes. Console output is below. Note that when I restart the app with ember server, everything works as exepected. So this isn't some CSS syntax error or the like.
So ... this sure seems like a bug to me, but I'm so new around here that I'm wondering if I'm just missing something very basic.
We're not talking SASS files, either. I'm getting this error if I change a single character in a very small /app/styles/app.css - the one generated by ember new. I've also tried moving the style rule to a file called my.css and leaving app.css empty except for this one line: #import 'my.css'; No love.
Can anyone help? Thanks in advance,
-Billy B
D:\BitBucket\dispatch-alert\node_modules\ember-cli\node_modules\broccoli-sane-watcher\node_modules\sane\index.js:246
Object.keys(this.dirRegistery[dir]).forEach(function(file, i, arr) {
^
TypeError: Object.keys called on non-object
at Function.keys (native)
at Watcher.detectChangedFile (D:\BitBucket\dispatch-alert\node_modules\ember
-cli\node_modules\broccoli-sane-watcher\node_modules\sane\index.js:246:10)
at Watcher.normalizeChange (D:\BitBucket\dispatch-alert\node_modules\ember-c
li\node_modules\broccoli-sane-watcher\node_modules\sane\index.js:280:10)
at FSWatcher.EventEmitter.emit (events.js:98:17)
at FSEvent.FSWatcher._handle.onchange (fs.js:1039:12)
Update:
Based on the help I've gotten so far (thank you guys) and poking around a bit, I have a theory: because I can edit files in other directories and other editors just fine, I conclude that app/styles is just plain not in the list of "watched" directories. This could be a simple error of omission, but I"m wondering if it isn't deliberate. Wouldn't this directory be one that is processed by Compass and other CSS preprocessors, which might have their own file watching systems or otherwise have problems with watched files? Perhaps the makers of ember-cli have deliberately omitted this directory?
How do I find this out? And what should I do? Head over to the ember-cli project and ask for assistance there? I tried to find where a list of watched directories might be kept, but have so far been unsuccessful.
A workaround for the moment is to alter the index.js in line 246 (according in your error and my error messages) in the sane module and add something like this:
if (!this.dirRegistery[dir]){
console.log('error',' empty/unkown dir',dir);
callback();
return;
}
No idea if this is is valid fix. Somehow this is related to sublime. (Caching, File-lock?)..

Using GWT + Twitter4j

I am trying to build a simple gwt project that fetches tweets and displays them.The server passes back the tweets of type twitter4j.Tweet to the client.
Both modules import twitter4j.Tweet.
But when I run I get the following error:
--- ERROR: Line 37: No source code is available for type twitter4j.Tweet; did you forget to inherit a required module?.
I seem to have problems in inheriting twitter4j. All the posts I have seen about inheriting a jar file are not clear about how to do so. I understand I must write an inheritance instruction into gwt.xml file, something like
---
but if I try
---
it does not work. Can anyone please explain?
In a post I found on the Web one person suggested not to inherit it but:
-- Don't put twitter4j to your gwt.xml. Just add it your project class path. and make all functionalities like status updating and all in your serviceImpl. Try
This confuses me even more. I have added the jar file to my project libraries. But it does not work
I suspect I am missing something quite elementary here, but I am totally stuck. Is there something like a GWT path?
Many thanks for any help
Keep in mind that everything in your client package is compiled to JavaScript and executed in the user's browser. Thus, you'll only be able to use twitter4j's classes on the server-side of your application; you'll have to create some sort of light-weight GWT-serializable "proxy object" to pass data back and forth between your client and server tiers.
Since you can't use twitter4j on the client side of your app, you will not need anything in your .gwt.xml file referencing it. Instead, you'll add twitter4j to your classpath and do all your updating on the server side (as mentioned toward the bottom of your question). You do mention that it "does not work," but there's not enough information in your question to try to figure out why.