cordova-ios: plist file not copied from Resources to xcarchive - firebase-cloud-messaging

I'm putting a custom plist file (GoogleService-Info.plist) into my Resources directory, but it isn't getting copied into my built project. I can go into XCode and manually add it through "Copy Bundle Resources", but I need to get this running without manual steps.
I can't just use <resource-file src="src/GoogleService-Info.plist" /> in my plugin.xml because I'm building for a couple different widgetIds - I have 2 versions of this file that I switch out, depending on my widgetId. I have the copying and renaming automated with a hook to get the right file into Resources/GoogleService-Info.plist.
How can I get the file I put into Resources included?

The cordova-ios project has code to get the resource files included in the XCode project files, and you could replicate that, but I ended up with a workaround:
Copied my file to a consistent name in a before_prepare hook
Used a resource-file tag for the new name in my plugin.xml

Related

File not found error in xcode

I have imported the folder containing SUPQueueConnection.h to the project and to the project root too. Still it is showing the same error SUPQueueConnection.h file not found.
And we imported all such needed .h and .m files to the project root.
Is there any other way for doing it?
Can anyone please help me in solving this problem?
In project navigation bar of your project check the folder you imported that it actually contains SUPQueueConnection.h file or not and if it is there try to import header file in the class in which you are using "SUPQueueConnection.h" file.Also if project is showing SUPQueueConnection.h file then right click on this file and click "Show IN Finder" option to see where actually the file is.Make sure it is copied in project folder.
If it does not solve the problem try deleting this file and drag and drop SUPQueueConnection.h again in project directly and make sure while copying on target your project is check marked.
Have you made sure that the files that aren't found are actually in your Xcode project? Make sure you can see the files somewhere in the sidebar. I've never actually tried it, but I don't think you can simply access files in the project directory root, they must be in your project. Xcode has changed since I used it last (been doing other things) but I think you can still add files by right clicking somewhere in your sidebar, also unless its changed you can add external files using a button in the file menu

libcocos2d libraries.a & PROJNAME.app missing

I have this new project created via the cocos2d 1.0.1 template in Xcode and I was copying over files from the project whose cocos2d engine is outdated (it's dated to 99.4, but it didn't have a CCSpriteBatchNode, instead using CCSpriteSheet) and I was rearrange files around into folders that matched the setup of the old file.
One of the folders is Products, which I stuck in the 'Code' folder. However, the two files within this Products folder have gone red:
MyGame.app
libcocos2d libraries.a
meaning they're undefined, and I need help solving this conundrum, I'm very new to paths and directories. Here's a screenshot:
http://i207.photobucket.com/albums/bb289/teh_Mac/Screenshot2011-12-21at90907PM.png
After you created the new project, you should only add source code files and resource files to your project. There's no need to recreate the Products folder.
Besides, the .app and .a are files that are created during the build process. Until you've made a successful build, they will remain in red. And even if the build was successful they may remain red due to bugs in Xcode.

Reading File to Frameworks of Xcode

I removed a file from the Framework section of my Xcode application and now I want to add the file back. However when I try to add the file back I get the following alert.
Could not copy /Users/brian/Downloads/iphone-exif-0-9.1(1)/Release-simulator-iphonesimulator/libiphone-exif.a to /Developer/CS193/GraffitiMap/libiphone-exif.a.
What is going on here?
When you add a file in you project, you can either copy it in you project or just reference the file somewhere else on your hard drive.
When you removed the file from you project, you didn't remove it from you project folder. Xcode can't write at that path since there's already a file, and gives you an error.
Just remove the file that's already in your project folder from the Finder.

Intellij Idea problem with text file impossible to read

I have a problem using Intellij Idea.
I am absolutely unable to load text file as InputStream - it doesnt matter where do I put the file (main/java, main/resources...) it just can't find the file - in Eclipse everything works just fine.
I tried setings->compiler->resource patterns and added ?*.txt but that doesn't seem to work either.
Any help is appreciated.
If you load it as a File, make sure that Working Directory is properly set in IDEA Run/Debug Configuration, since it's the default directory where Java will look for a file when you try to access it like new File("file.txt"). Working directory should be set to the directory of your project containing .txt files.
If you load files as a classpath resource, then they should reside somewhere under Source root and will be copied to the classpath according to Settings | Compiler | Resource Patterns.
If you can't get it working, upload your project somewhere including IDEA project files so that we can point to your mistake.
Look at the image, notice that the txt files are in the project root, and not the source folders (in blue).
If you open the Project Structure dialog, and click on Modules and select your module - are the correct folders marked as Source Folders on the sources tab?
Link for how to get to Project Structure dialog
Also, if you print out the absolute path of that file you are trying to read, is that anywhere near where you expect it to be?
An easy way to figure out the same would be to try creating a file in the same fashion and see where it gets created in your project. You can put your input file at the same location and it should work just fine (if it doesn't, you should check your resource pattern which might be causing the file to be not copied over in the build output).
This method actually gives you the working directory of your intellij settings which is pointed out in the accepted answer. Just sharing as I had similar trouble and I figured out this way. :)

How do i navigate through folders in code behind?

I need to address a file in my code. this file isn't located in my main project, but in a library project. When i call AppDomain.CurrentDomain.BaseDirectory, i end up in the start project's (let's call it mainproject) debug folder. What i want to to is call appdomain.cd.bd and go up 3 levels, so i leave debug, then bin and then mainproject. Then i would navigate to libraryproject and to folder where file is located.
What i've tried so far is do AD.CD.BD\..\.. or AD.CD.BD/../..
I thought i remembered those, but it's a no go.
Does anyone know how to do this.
Thanks in advance
It is concerning to see you wanting to codify paths based on project build paths. What happens when you release the project and these project directories don't exist.
I would recommend that if there is a file your project needs to execute is from a library project that doesn't get copied across during the build that you use a post build step to copy this file to the same location as your assembly. Alternatively you may be able to set the build action on the file in your project which might get this file to your main project build output directory.
Three levels up would be ../../../ wouldn't it?