Project size increased to 716 MB after adding Realm DB - xcode

The project is just a simple notepad but the size increased to 716 MB after adding Realm DB. What could be the problem ? There is a warning in Xcode as well: "/:1:1: Umbrella header for module 'Realm' does not include header '/core/realm.h'"

If you refer to the github for Realm releases you can see the RealmSwift SDK comes in at 871 Mb zipped (2Gb unzipped!).
If the examples and so forth are removed, it's still about 525Mb so what you're seeing in your question is about right.
EDIT
There are a lot of additional files and 'stuff' that may exist within a project development folder that may not be part of the final project because the SDK may need to support multiple devices.
For example, in the Realm/core/realm-monorepo.xcframework folder, there are supporting files for macOS/tVOS/iOS/watchOS etc, so a lot of extraneous stuff that has nothing to do with the project on your device. If you are not using that part of the SDK, those can be removed to make the project file smaller.
Additionally, the 10.7.2 SDK that's downloaded from github has a bunch of example projects and code that can also be removed.

Related

Xcode does not remove files from application

I am currently working on a game (Mac, Objective-C) that uses prerecorded cutscenes. All the mp4-videofiles are really big. In total I have 86 video files that are 3.77 GB all together. Whenever I build the app it takes well over 15 minutes. Way too long if you are working on just one line of code and you need to test it.
For testing purposes I always deleted the files from the 'Copy Bundle Resources' so that the files would still be in my Xcode project but not in my app. I only included the files that I needed at that moment (so from 3.77 GB to ±100 MB of files). When I built the app then, it was only 40 seconds or so. This has always worked out fine.
However, this week Xcode started acting strange. Even if I removed all of the files in the Copy Bundle Resources all the video files would still be in my application. This means that every time I have to correct a mistake I made, I have to wait 15+ minutes.
After being frustrated for a while I started to remove the files manually (I clicked on Delete -> Move To Trash). So now all the files are removed from the Copy Bundle Resources and out of my Xcode project. But still Xcode includes them in my application if I build it. How?!
So, a long story short, Xcode does not remove files out of my application. The files aren't even in my project anymore but still Xcode finds a way to include them in my application. Does anyone know why/how Xcode does this? Any suggestions/solutions?
I gave up trying to look for answers and I just deleted the build and made a clean one. Right click on the YourApplication.app > Show In Finder > and delete it from there. Then build the app again and it will only contain the files you selected.

XCode, frameworks, app submission and SwiftFolder

I have built a Swift app. I added all libraries in Project -> Target -> Link binary with Libraries. I added external frameworks such as Parse to the project too.
I then selected all frameworks under the project and created a group folder called Frameworks.
I have observed/recorded three issues:
When I run ls -l in shell, the Frameworks folder is not actually there
Only frameworks such as Parse & Bolts are actually listed under the project. Other frameworks (e.g. QuartsCore, CoreGraphics etc.) are not listed anywhere with the ls -l command
If I try to archive the project, because the Frameworks folder is not 'there' as far as xcode is concerned, the SwiftFolder is not created (which would result in the app being rejected)
Surely it should be a straight forward process. What am I missing?
Apologies in advance for the fact that my code works yet I cannot solve such a simple problem!
1: A group in Xcode is not a file system folder, it's an in-app Xcode-specific construct. You can add file system folders to Xcode, but they are different and distinct from groups.
2: iOS frameworks will not be visible in your project folder as their location is managed by Xcode. They are added/linked to your app bundle at compile time.
3: Is your app failing validation/being rejected? Sounds like it could be a separate issue, everything else you're seeing sounds normal.
Only one thing worked - Shenzhen (failed on first attempt due to space issue). Here is what you need to do:
Go to Shenzhen on github, download, run and send apple the bill ;)
In case you are wondering, before I tried Shenzhen again, I actually tried the following:
Created a "Hello World" Single View Swift application in xcode. Added all the libraries and used the xcode archive facility to see if it generates the Payload and SwiftFolder. It failed on both.
I downloaded xcode 7.1 (beta) and tried again. This time I got the Payload folder but still no luck with SwiftFolder. So don't waste time on xcode 7.1 for this.
Called apple dev support (and yes, you are likely to be billed for this) - was transferred between three call centres (English spelling - sorry) and finally submitted the issue.

Why does XCTest save a ton of data to my /private/vars/folders/rx/ folder?

I'm using XCtest with XCode 6.3 to test an app of mine. I've noticed that it seems to be saving a ton of data to my /private/vars/folders/rx/ folder. If I delete my app's Derived Data these XCTest folders don't get deleted, and if I restart my computer it's still there too. Is this data safe to delete or do I need it?
I used DaisyDisk (awesome program by the way!) to take a look at my computer's memory and I see this:
So I thought I'd take a look at what was in each of these folders. When I looked, it seemed like XCTest was the culprit.
When running my tests I include a large bundle of jpgs that is around 1.7 GB. I'm working on streamlining my app testing so that I don't need the large bundle, but I'm still curious if I can safely delete some of these older folders.
Yes, they are safe to delete. This is where Xcode stores built copies of your applications when built in "Unit Test" mode. Just as Xcode has a Derived Data folder for building OS X apps, it has another location for storing XCTest data (storing this data in the Derived Data folder wouldn't be appropriate, since that is used to store built copies of the application intended to be run by the user).
You should note, though, that Xcode will probably put the data back there again the next time you try to run your app's unit tests, and it may take longer to build/run since some of the cached data is gone. It's up to you whether the trade-off is worth it.
And by the way, Xcode builds your entire project to run XCTest, because your tests might depend on certain resources being there in your app bundle. So that's why the folder is so large.

Why does my worklight project build/deploy much slower than coworkers?

I just recently installed worklight in Eclipse in order to work on developing an iPad app, but I noticed it takes me significantly longer to build and deploy compared to the other developers. The others take rougly 5-7minutes each build while mine takes about 25-30 minutes. I am not sure what could be the reason and was hoping for some suggestions on what it may be?
I was told that in the build process worklight copies the contents of your projects to another directory on your machine, and I think the location of that directory might be the issue, but I am not sure how to check to see where this is happening.
Edit: To give more details as requested:
Both my machine and my coworkers machine are running Windows 7 Enterprise, with Intel dual core and 8G of RAM.
The workspace containing the project is located locally in the base of the C: drive but user profile files/folders such as My Documents are stored on a shared network drive. The project itself is 143mb.
To the best of my knowledge there are few factors that influence build time:
Size of the Project (eg. 100MB)
Number of Files in the Project (eg. 1200 files)
Your environment got into a strange state.
Some one reported performance issues with adding new Java code.
Hardware
You can try:
Lower the size of your project by removing unnecessary files, compressing images using lossy compression, etc.
Concatenate resources like JS and CSS files.
Try to use resources hosted on other servers, at least for development, for example:
< script data-dojo-config="async: 1"
src="http//ajax.googleapis.com/ajax/libs/dojo/1.8.1/dojo/dojo.js">
< script src="http://code.jquery.com/jquery-1.9.1.min.js">
Try creating a new Workspace and importing your project or removing (back up first!) the project's metadata directories and files (Workspace/WorklightServerHome, bin/). You may have a some success removing and re-creating the native environment folders. There's also a -clean flag you can pass to eclipse.
I was able to fix my own problem, worklight was using a .wlapp which was stored on my shared network drive. By changing the TEMP and TMP environment variables to a folder which is for sure local, such as C:\TEMP, worklight then accesses only local files great speeding up the build proccess.

Why is Xcode's Search Navigator searching the wrong project's files?

I have a large Xcode project for a game I'm building. I recently switched versions of the animation framework I'm using (cocos2d), and to keep things clean, I went ahead and created a brand new Xcode project from scratch.
Afer creating the new project file, I made copies of all my source files in the filesystem, then symlinked them into the new project by dragging them into the Xcode Project Navigator. Everything worked fine.
But here's where it gets weird. Whenever I use the Xcode Search Navigator to do global text searches on my project, it searches files from the old project! And only files from the old project!
The only conceivable explanation I can come up with is that Xcode is somehow recognizing my filenames as being the same as were used in the old project, and has decided to ignore the newer versions in favor of the old ones. Is there any such cache or preference within Xcode that can do such a thing? Keep in mind the paths are different, since the new project's files all exist in a brand new directory. But the class names are the same.
In case this is relevant: I once created an Xcode Workspace that included the old version of this project (but not the new one.) I abandoned the workspace long ago as it was problematic, in favor of working with the project directly.
UPDATE: This appears to be an Xcode-related problem-- I have discovered I have the same lack of search-ability in all of my projects. I uninstalled Xcode (I had the version that was still using the Developer directory) and installed the latest version (4.3.3) that does not use the developer directory, but I am still seeing this problem.
I am curious if anyone knows a way to wipe out Xcode's cache of project code indexes, if such a thing exists, that might potentially "reset" its knowledge of my projects and thus fix the situation. Possibly something in the Library directory?
One last clue as to what might be happening: In addition to the search navigator failures, I noticed one of my projects was still using resources that no longer existed in the filesystem-- again, making me think Xcode has cached information about my projects somewhere and is now using outdated versions of my files that no longer exist. this post helped me solve that problem by resetting the simulator's content and settings, but the search issue persists.
Have you checked your Find Options? This same problem was biting me and then I remembered I had added a custom Scope in 'My Scope' that directed XCode to my other project. Changing this back to 'Workspace' fixed the problem.

Resources