Error with GetChildNamed("xxxx") - blackberry

I'm playing with IwUI RSS sdk sample. I made a change of adding a link label to feed page (2nd page). I made this change by copying the description CIwUILabel block and renaming it to say 'linkLabel' and accordingly added that as an element to the CIwUIElement 'Lables' just below Title element. This works fine in x86 marmalade emulator, GCC ARM Debug emulator.
But when I take this to BlackBerry device, it breaks with the error - "Element '' does not have child with name 'linkLabel'. Why it is saying element ''?
Does it mean that my edits in IwUIItems.ui are not getting into device build?

I guess your changes didn't get included in the .bin file. The .group file or .ui file doesn't get included in the GCC build, you need the corresponding .bin file, which you'll get after loading the .group file in x86 simulator.
Just delete the data-ram folder, clean your project, re-run the x86 simulator, make sure UI.group gets loaded before you quit.
optionally you can even delete the VS project folder to get a perfectly clean build. Double clicking on mkb will recreate the project again.

If anybody stumbles on this, please find the details below -
As #Creator said, my changes did not get into the deployment package but the reason it was running fine in the Marmalade simulator does not allow to believe this. The reason was that the changes were getting in the .bin file correctly. But the deploy tool was looking for that file in data folder. There was an old file available and that was getting into my deployment package.
So I have to copy .group.bin file from data-ram\data-gles1 to data folder after running the application in x86 debug mode. Then build the deployment package for BlackBerry 10
For WP8, we have to copy .group.bin file form data-ram\gles2-dx11 to data folder.

Related

Xcode files in Red - but file still there

I've been working on an Xcode project on my desktop, and I was trying to save it to GitHub, so I could access it on the road. I've saved it to GitHub before, without issues, and the local Desktop version was working fine. After saving it to GitHub, I tried downloading it on the laptop, to make sure everything was fine, and one file was in red. It doesn't look like it was saved or even exists. I get a "Build Input File can't be found" error.
I went back to the Desktop version - that file is there and everything works. I thought, maybe I messed up with GitHub, so I tried to save it to iCloud, and then emailed myself a zip copy - same thing. Every other version, but the desktop version, had that one missing file in red.
I've looked at other posts for those with similar problems, and all the answers seem to say the same thing - the file was moved or deleted; however, it is still there on my original desktop working version. Any thoughts as to what is going on or what I should do are welcome.
I'm working on XCode 13.1, on a Mac running iOS 12.1
Follow up - locked files:
As some of you suggested, the file could be locked. It didn't appear so, and I thought it unlikely, as I don't know how to lock them. I copied the one file over, added it, and it is running, however, I got this warning when I tried to save and close it:
Locked file warning
I went through the steps to unlock it, and curiously, finder says it is not unlocked. Not locked but I'm getting the warning
Everyone has permission too
Any ideas as to why this might be? I'm stumped. I did try locking and then unlocking it, but no dice. I still get the error I don't have permission because it is a locked file.
Probably the file is not inside the project folder. This can easily happen with resources such as images and sound files that you copy to the project navigator. The project works fine but it has an external reference to the file. If the project folder is copied, eg zipped, the file is missing because it was not part of what was copied.
This generally occurs when you moved or deleted that file within Finder.
So try to delete that file from your project in Xcode and then re-add that file to your project folder in Xcode. Then your file would be working fine.
first: get your file from the current full path and cony it to any location on your mac enter image description here
Second: delete the red file from Xcode
third: drag file from the new location to Xcode don't forget to check on copy if you needed :)

UnityFramework-Swift.h file not found

I have an error 'Lexical or Preprocessor Issue Group' with building xcode project after have built from Unity.
'UnityFramework/UnityFramework-Swift.h file not found'
I have Nice Vibration asset and FB SDK in my project. So I tried to follow this instructions in 'Building for iOS' section, but have no result https://nice-vibrations-docs.moremountains.com/platform-specifics.html#building-for-ios
I makes it with .xcworkspace, not .xcodeproj file. I have read it's right way because of FB SDK needs CocoaPods build pipeline and I should use .xcworkspace. And it's happens in XCode 12, if it matters.
What could be wrong? I spent a few hours and so still there, where I have been :(
I also ran into this issue today (although because of the Firebase SDK, not FB).
The problems seems to be with the post-build processor, which modifies the output XCode project. The NiceVibrations implementation currently only copies a single file (module.modulemap) to the build directory. Instead, we need the entire NiceVibrations/Common/Plugins/iOS/Swift directory to be copied over.
While I can't publish the entire file, I will share my modifications with you for automating this process.
Open the following file:
NiceVibrations/Common/Scripts/Editor/MMNVBuildPostProcessor.cs
Locate the WritePropertiesToFramework function and replace:
System.IO.File.Copy(privateModuleFilepath, destination);
With this:
DirectoryCopy(Path.GetDirectoryName(privateModuleFilepath), Path.GetDirectoryName(destination), true);
You can find the source code for the DirectoryCopy function from the Microsoft dotnet docs here
Edit: You will have to change the second argument of file.CopyTo to true to allow for subsequent rebuilding atop the same directory to avoid runtime errors
Additionally, I have increased the callbackOrder to 60 to ensure that this hook runs last.
I am personally using .xcodeproj instead of workspaces, but it should work fine with workspaces as well. (Firebase uses something called External dependency manager which allows you to configure your project generation preference)
After making these changes, trigger a build from unity and "replace" the target folder to update your XCode files!

Resource files not updating with Xcode 5

I have some binary files with a proprietary extension that don't get updated in a build when I compile. In previous versions of Xcode with this same project, it would detect the file was changed, and rarely would I have to perform a 'Clean' as I have to do with this version. Of course this is consuming a lot more time -- I would appreciate it if someone could let me know what's changed with Xcode 5 and/or what I could do about this.
I didn't include any project specifics because it's really just a proprietary binary file with a custom extension in a resource folder, which, used to update automatically upon it being changed since last compile. If you need any specific project settings I would be glad to offer it.
It's using the sort of 'blue' resource folder that is a reference to the folder it's in, and isn't just copied into the project directory. I apologize since I forget what this particular resource folder type is called (I'm guessing Reference).
Version: Xcode 5 (5A1413)
UPDATE:
This only happens when I'm referencing a file that I modify programmatically with fopen,fwrite,etc, and upon using a file editor in OSX to resave the file (without really changing it) Xcode will then see it as changed.
I'm now looking into FSEvents to see if this underlying API is something I need to use, although I'm not exactly sure how to set flags with this just yet.
UPDATE:
Well, just as a simple test, I take the same file and resave it via:
NSData* data = [[NSData alloc] initWithContentsOfFile: #"/location/file.dat"];
[data writeToFile:#"/location/file.dat" atomically:YES];
Sure enough, after I call that and then run the app that uses the resource, it is updated via Xcode during the build. So it would seem that Xcode 5 relies on some special flags not set by the standard io functions. At this point I can either patch what I've got with that 2 line thing or figure out what the flagging mechanism is, and how to write to it. (FSEvents? I don't see a writing mechanism there..)
I had the same problem. I set up an Xcode build-phase script to touch the root resource folder, and it works now. I found the instructions here and they are as follows (see link for more detail):
1) Add your single resource directory (named anything but ‘Resources’) to your project in the Resources section as a blue ‘Folder Reference’
2) Right click on your app target, select Add->New Build Phase->New Run Script Build Phase
3) In the resulting ‘Info’ window, change the shell to /bin/tcsh and copy and past the script below into the ‘Script’ text view.
Script:
touch -cm ${SRCROOT}/../../YourResourceFolder
(Also, you may need to know how to find "Build Phases" in Xcode 5)
I was also running into problems. Everything was fine before Xcode 5, and my referenced resources folder would copy pretty dependably. However, after updating, no matter what I did to an individual file (touch it, delete and re-copy it, etc.), nothing triggered Xcode to scoop it up again.
However, I now modify the last write time on the referenced folder during my build step, and now it's contents seem to be copying correctly again. I Hope that helps you too.
I am using custom tools, but I'm sure a build script can do the same. My guess is that Xcode tries to optimize the dependency step, and checks the folder's last access/write times before diving into it.
well a simpler way would be to just touch the folder from your shell or term.
e.g. on your terminal just run
touch -cm PATH_TO_FOLDER_UNDER_RESOURCES
PATH_TO_FOLDER_UNDER_RESOURCES is actual path to the folder under resource folders which contains the files.
Since changing your files do not necessarily change the timestamp of the folder and Xcode looks into the timestamp of the containing folder.
I had the same issue with xcode5, I need to update javascript frequently. I had to clean and then build, it took long time because my project had many source files. Later I tried to delete the app (choose "move to trash" rather than "delete reference") and then build, it was quite fast, but I had to restart xcode so that app can appear in the project again.

xCode will not parse project from Unity

I am working on a different iOS project in Unity and I have built it by exporting to Xcode (like I always have).
Whenever I try to open the "Unity-iPhone.xcodeproj" in Xcode, it gives me the following error:
Project cannot be opened because the project file cannot be parsed.
I have looked everywhere but cannot figure it out.
The project name does not have any spaces in it.
I have checked the .plist and everything looks fine.
The bundle identifier matches that in .plist.
This has worked in previous projects but now I am getting this error for some reason. What gives?
Today, I've been facing this problem (Unity Ver. 5.5 Windows Based system).
When I try to open my windows exported iOS project, i got "(..)the project file cannot be parsed". So, I decided to explore the project file, located in:
{Project path}/Unity-iPhone.xcodeproj/project.pbxproj
It is a plain text file, so you can use any text editor.
I found a line with a mismatched quotes. It was:
shellScript = "\"$PROJECT_DIR/MapFileParser.sh\""\nrm -rf \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Data/Raw/QCAR\"";
To fix the problem, simply remove the quotation mark located at:
(...)MapFileParser.sh\" " \n(...)
It should be:
(...)MapFileparser.sh\" \n(...)
and it will be parsed correctly in xCode.
It's an automated typo error!
Good luck!
Well, after a couple days I have found the problem and it all has to do with the naming of the *.a files that the plugins import.
XCode does not allow for files to have spaces in their names (of course) but I had not caught that 3 of the *.a files from plugins had spaces in them.
After removing these plugins (I have different plugins that do the same thing anyways) xCode was able to parse the build and create a project for me!
Be careful of spaces!
Incompatable version of Xcode?
Are you using plugins? Most modify the project.
Try creating a new project and creating a build. If it works, it's a plugin, otherwise an Xcode version.
Faced the same issue today (Unity 2017.1.1).
Nothing related with the answers above. I just made a mistake in the Profile ID in the Player Settings of iOS : Edit > Project Settings > Player > iPhone, iPod Touch and iPad Settings > Other Settings > Identification.
I was getting this issue in Unity 2017.2 this week (building on Windows and then copying the build files over to the Mac for use in Xcode), and can confirm that the fix to the shell script line to remove the double quote as described by Anibal Itriago above worked in my case. Even an entirely blank iOS project with Vuforia disabled was failing to parse, but the line fix seems to resolve it.
My issue was related to dropbox.
I use a pc for development and a mac to build in xcode, so I store my project in dropbox. Sometimes dropbox can corrupt .pbxproj or even .plist files going from pc to mac, so when I attempt to open a project on my mac, xcode will throw the above parse error.
I had to zip the xcode project folder on the pc side, then on the mac side pull it out of the dropbox folder and unzip it. Then move it back to its original location. It's a pain but it worked.

How can I copy a file to the iOS simulator using Xcode?

I need to know how to copy resources (help files, images, pLists) to the iOS simulator and ultimately device. I recall this was done through Xcode but what is the exact procedure?
Just drag the file to your simulator
For iOS 6, the directory seems to be a bit different. I'm seeing:
~/Library/Application Support/iPhone Simulator/6.0/Applications/your app here/Documents, where 'your app here' is a long string. Fortunately, if you click on each directory, you'll see the name of the app you're building in the child directory. From there, it's straightforward to find the Documents folder.
You can drag your file to simulator or you can right click to file then send->Simulator.
Both work for me.
Just drag your file to the project. It will be copied to your app bundle when the app is installed (on the simulator).
Alternatively, put the file into ~/Library/Application Support/iPhone Simulator/User/Applications/... (if you have the 3.2 SDK.)
From the XCode docs.
A Copy Files build phase allows you to copy files and resources of any type to specific locations as part of the build process. It complements the build phases that copy specific types of files. An example is the Copy Headers build phase, which deals only with header files. You can have as many Copy Files build phases as you need in a target.
For example, using a Copy Files build phase, you can copy fonts to/Library/Fonts. Or, if you’re developing a plug-in, a Copy Files build phase can copy the generated plug-in to the appropriate location. You can have as many Copy Files build phases in a target as you need.
To create a Copy Files build phase:
In the project window, open the target to which you want to add the build phase, and select the build phase after which to add the new build phase.
Choose Project > New Build Phase > New Copy Files Build Phase. Xcode adds the new Copy Files build phase after the build phase selected in the Groups & Files list.
Drag the files you want to copy from the Groups & Files list to the Copy Files build phase.
To configure the new Copy Files build phase, select it and open the Copy Files build phase editor, shown in Figure 2-5.
Just copy files to iCloud Drive. Then open the files app on the simulator and sign into your iCloud account.
Get the folder in the Mac Finder and make an Alias
Yes getting the Path by Xcode, but using the Mac Finder and an Alias to get there, doing the file copy operations, is very smooth and solid.
I get my files into my Simulator units by:
Getting the path by putting a breakpoint in Xcode at (anywhere you like in the app code):
let FilePathName: String = NSTemporaryDirectory()
Using the Mac Finder going to, the simulator unit disk and application location (yes, it is in the Mac). There you find all the local folders of the simulator unit.
The path to the the Device unit and to the Application is like a crypto string and not that easy to separate from many other such in the folders alike, but quickly made.
Finding the folder of your choice, make an Alias, move the alias to the Mac Desktop.
Then you have a smooth way to the simulator units app storage
But an Alias must be made for each simulator unit and app.
The advantage is that you are dealing with the regular tool of Mac Finder folder/Alias and it is quite capable of handling large volumes of files, very smoothly.
You put the files exactly where you want them.
The Alias works like regular Alias works in a Mac.
By some upgrades of Xcode the simulator units are rest and the data has to be re-copied into the units.
The other suggestions are not that bad
Just copy files to iCloud Drive, works very smooth, is a good alternative.
But need to login,
But then the files need to be copied from the iCloud Drive to the simulator units storage, unless you want to use data in the iCloud? (The topic of the question was How can I copy a file to the iOS simulator using Xcode?)
Drag'n drop to the Simulator unit, should be the obviously most smooth way of doing it.
But I find it slow and not really reliable, I found it hanging copying volumes of files
I find also my suggested way giving much better control over the file storage, the desktop Mac is by far more easier to handle data than a phone or tablet?

Resources