App.js has red background in Titanium Studio. How can I get Titanium to import the project as if it's new? - titanium

I have a project that I imported from a shared folder.
Everything worked fine until the hosting computer restarted
After the shared folder was back up I restarted Ti Studio, deleted the project, and imported it again, but it still wouldn't allow me to run the app.
Now there is an asterisk next to the project name so it looks like
this:
* ProjectName [master]
However, before the connection was lost it said [master + 1].
Also there's an asterisk next to app.js, and the background is red:
When I try to run it I get the following error:
[ERROR] : ** BUILD FAILED ** [ERROR] : The following build commands failed:
[ERROR] : Ld build/Debug-iphonesimulator/ProjectName.app/ProjectName normal i386
[ERROR] : (1 failure)
This application worked before I accidentally lost connection to the host folder.
I have also tried cleaning the project.
It seems like Titanium is trying to recover what I saved during the restart, so it won't allow me to run the project again.
TL;DR: How do I make Titanium Studio "forget" this project, and treat it like it's brand new?
UPDATE: I tried deleting the project and creating a new one with the same name, now all the files and folders have an asterisk next to them and the files have a red background. Next I'll try a new name...
UPDATE 2: Naming the project a new name didn't work either. Next I'll try creating a new project locally.

I had to create the project locally. For some reason, after losing the connection, Titanium couldn't hold a connection to the shared folder.
Edit: Here's what I did to get everything back to normal:
I deleted everything locally, on the shared folder, and from the workspace
I created the project locally
copied it to the shared folder
deleted the project from Ti Studio (didn't choose the option to delete the actual files)
then imported the project from the shared folder

Create a file in project root folder name it .gitignore
file contents:
.DS_Store
/app
/build
/plugins
/Resources
/platform
/i18n
build.log
build
CHANGELOG.txt
DefaultIcon-ios.png
DefaultIcon.png
iTunesConnect.png
LICENCE
LICENCE.txt
Manifest
MarketplaceArtwork.png
README
tiapp.xml
npm-debug.log
tmp
.map
.project
.settings
Thumbs.db

Related

How to fix a broken Intellij Idea?

When I open an existing Maven project, the IDE shows only those files on the root directory, but not any directories in the project. After a while, the IDE will show the project as what it is in the file structure, but not the directory types such as source code, test when I reopen the project. I reinstall the community edition, but the problem still resists. I have experienced the same issue for a few Java projects lately.
How to resolve this issue?
1, Please ask another teammate to check if that project really works. Sometimes the application structure already broken, then it is not your local problem.
2, There is a .idea folder in the application, delete it. Or simply, you git clone a new place Important: Please notice if you have edited / created some new files in the original directory, otherwise you would lost them if you delete the application.
3, Open intellij, and File -> Invalite caches
Personally, the second point is recommendated.
Try to click on Reload All Maven Projects in Maven tool window:
If it doesn't help you can try to perform the following actions:
Close the project with File | Close Project.
Close the IDE.
Open your project in OS file manager and remove all .iml files and the .idea directory.
Reimport the project.
If the problem remains contact JetBrains support and attach a compressed log folder along with the project structure tree.

Copied Xcode Project won't build

OS X Version 10.10.5
Xcode version 7.2.1
Very simple steps, yet Xcode can't fathom what to do when you duplicate a folder that contains an Xcode project.
Start with Xcode CLOSED.
Start with an Xcode project that builds and runs perfectly.
Go to Finder window and right click on the directory that contains the buildable Xcode project and hit "Duplicate"
New directory is created, called "SomeProject copy"
Go into this new directory and double-click on the SomeProject.xcodeproj file to open it in Xcode.
Bam... enjoy your build errors.
In my case, it's complaining about an enum.
Tried deleting derived data folder (did so directly using finder)
Tried super-cleaning the build folder by holding down the option key.
Tried removing and re-adding complained about file that contains errors.
Tried changing path to file in Xcode File Inspector from "Relative To Group" to "Absolute Path"
I should also point out that either Finder -> Duplicate doesn't actually do what it says it does. Neither does Finder -> Copy, ~OR~ Xcode for some reason has now adopted not only the original source location as where to get its build files, but also the new location, hence the "Redefinition" error. I noticed that if I open the "copied" project and edit a file, then go back to my original project in an entirely different folder, the file is changed THERE.
And my paths (according to Xcode File Inspector), are RELATIVE TO THE PROJECT IN QUESTION. So in other words, ProjectAAA's files are pointed to the path under ProjectAAA's directory, and the same with copied project, ProjectBBB's files.
So somehow, the copy/duplicate is refusing to actually copy/duplicate.
Any ideas how to solve this?
Per John Elemans comment, moving my original project then revealed in the copied Xcode project a number of build paths and issues that needed resolving. I fixed those, and it worked as expected.
I solved this issue as follows:
After duplicating the root folder of the project, open the podfile of the duplicated project:
Podfile
then comment all the previously added pods by adding "#":
Commented Pods
hit CTRL + S in order to save the changes
Open the terminal and change the directory to the folder of the duplicated project and then perform: "pod install". Yes it will delete all the pods but don't worry we will install again in the next step
Pods deletion
Open again podfile and uncomment the previously commented pods:
Uncommented pods
hit CTRL + S to save the changes
Open the terminal and change the directory to the folder of the duplicated project and then perform "pod install". it will install again all the pods:
Pods installation
Finally, run the Project and it should run without any problem.

Can't see project folders in IntelliJ IDEA

Every once in a while, I open an old project and I can't see any of the folders in the intelliJ project viewer. I can see all the files at the root.. but no folders. Yes I can delete the .iml file and .idea folder and re-create the project, but come on.. there's gotta be an easier way to fix this.
Is there?
If you look in project settings (ctrl-shift-alt-s), you should see a module structure. If you instead see "Nothing to see", do the following:
In Project Structure -> Modules, press the + button,
press enter (since, for some weird reason, it won't let me click on "New Module")
In the window that pops up, click on the "..." next to Content root, find your root folder, and select it
Press ok
ignore any warning that says the name is already in use (or to that effect)
the simplest solution worked from me, just delete the .idea folder
keep in mind this will delete all of idea's current project configuration, it'll create the folder with default settings when reload the project again... but all other configuration will be lost if not properly backed-up
It might be because the project didn't have any modules defined. Try adding existing source code by hitting File > New > Module from Existing Sources and select the parent directory of the project for source code
Go to pom.xml file -> right click -> maven -> generate source and update folders. You will see your files and folder structures in left hand side.
All the project-specific settings for a project opened through Intellij IDE are stored in the .idea folder.
The .idea folder (hidden on OS X) in the solution root contains
IntelliJ’s project-specific settings files. These include per-project
details such as VCS mapping and run and debug configurations, as well
as per-user details, such as currently open files, navigation history
and currently selected configuration.
So, if you are not able to see the project file structure in your Intellij IDE, just delete the .idea folder,
rm -rf .idea
and reload the project, then after reload you'll be easily able to get your project structure displayed.
Thank you very much. I just remove the .idea folder and works in my case.
rm -rf .idea
For me, the java folder was not showing up. I went into File->Project Structure. In the second column, I selected on _main. In the third column, I selected the tab "sources". In what I call the fourth column, where the "+Add Content Root" is shown, I verified, the java source/folder was present. In my case, there was an extra source folder, which was the current location. I removed this, applied and the java folder immediately showed up.
Right click on the Project name -> Open Module Setting -> Check the application context path set it up at your project location.
Check your idea.log -- it may have some details explaining why or what is happening (Help | Reveal log in Explorer). Possibly one of the config files got corrupted.
You can always backup and delete .idea subfolder (project settings) and re-create project from scratch. When it's wroking again (after basic configuration) you may copy some of the files from that folder back to recover some of your settings (if there were many).
This happened to me on a new computer when I opened up a Java project in the newly installed Intellij.
The problem was that I had not installed any JDK on the machine.
I had to install a JDK and then go into the settings at ctrl-shift-alt-s and add a JDK by specifying the folder where I installed it. It's possible that IntelliJ would have found it if I closed it and reopened it.
In my case the solution was to create a new project, specifying the project type and creating it within the same directory path as the project that does not load the project files correctly.
PhpStorm automatically detects that the directory exists and gives you the option to create project from existing sources.
This can be found under:
File --> New project...
For gradle users: "Reload All Gradle Projects" option should help.

Team City build agent work dir not getting changed

I want to change the build dir of team city build agent to:
E://MY_PROJECT_SVN
While installing the build agent I set the same but it diaplays C://buildAgent/work in TeamCity web ui due to which my build fails.
My buildAgent.properties file shows
workDir=E\:\\MY_PROJECT_SVN
And buildAgent.dist.properties file shows
workDir=E://MY_PROJECT_SVN
But I get following error when I run team city
Failed to start MSBuild.exe. Failed to find project file at path:
C:\BuildAgent\work\3ac16e0b4e3af05b\Modules\SIM5.sln
Because of wrong working dir
The buildAgent.dist.properties is indeed just an example, but the solution is something you almost had; you need to put this into the buildAgent.properties:
workDir=E:/MY_PROJECT_SVN
Update:
It should be noted that on TeamCity 7.0 the workDir seemingly can't be on a separate disk; it runs most of the way through the build and then fails. However, using a junction to point from the local (default) folder to the E: drive will work. The tempDir can be pointed to a remote disk though.
The file buildAgent.dist.properties is not used, it is just an example. So don't worry about the contents of that file.
What you have set in buildAgent.properties is what matters. What is happening for you is the agent is reverting to the default location for the working directory.
This means that for some reason it is not able to read or parse the buildAgent.properties file. Make 100% certain that the entire file has no errors in it.
https://confluence.jetbrains.com/display/TCD8/Build+Agent+Configuration
Making any change to this file and saving it should cause the build agent to reboot automatically and reload the new config once it has restarted.
http://blog.jetbrains.com/teamcity/2007/10/configuration-files-editing-without-teamcity-restart/
To build on paul-f-wood's answer:
Teamcity 9.1.6 also has the "feature" where the work directory cannot be on a different drive. I tried several permutations of the temp and work dir, and the only ones that stuck were with the work dir on the same drive as the root teamcity folder. However as paul said, using a junction works like a charm.
cmd: rm C:\BuildAgent\work
cmd: mklink /J C:\BuildAgent\work E:\MY_PROJECT_SVN

How can I clone a whole project in IntelliJ Idea?

I want to run some tests in my project but I do not want to affect the
original code, and I wanto to clone the project so I can run tests there
Does anyone know how to clone a project on IntelliJ Idea 11?
Using your operating system File Explorer tool, just copy and paste the entire project directory somewhere new. All of the configuration should use relative paths by default.
If your IDEA project is .ipr based, then delete the new .iws file before opening the project.
If your IDEA project is .idea directory based, then delete the workspace.xml file before opening the project.
If you want to copy and rename the project too, like I wanted to clone a project in order to use it with a newer version of IntelliJ.
Copy the whole directory to a new location, for example on Linux:
cp -r myproject new/location/
To rename the project:
2.1. rename the project folder (e.g. mv myproject newproject)
2.2. get into the new project folder (e.g. cd newproject) and edit the .name file with a text editor.
Open the new project now in IntelliJ (you may want to remove the workspace.xml if you don't want to keep the open file history - I kept it) and enjoy your new project!
For copy with rename I had to do one more step to get it to stop referencing the old module name. That was to right click on the module in the project pane and do Refactor > Rename ( or do Shift + F6 ) to rename the module.
This was for IntelliJ IDEA 2016.3.3
I had a gradle project and the provided answers did not work. The project did not have a structure in IntelliJ and I did not see the source files.
The following worked:
Export project (Export to zip file)
Move the zip file somewhere new
Unzip
With IntelliJ, import as a new project with "open".
Better Solution of course:
Have it in a git directory, make a "test-branch" and try whatever you want to try.
Apparently the accepted answer doesn't work anymore with current versions of Idea and the many derived IDEs (I tried this with PHPStorm). The problem: most of the config files are located in the .idea subdirectory of your project, but the file .idea/workspace.xml also contains the ProjectId, and that should of course be unique. So, if you copied the project directory manually, the easiest fix is to change the ProjectId - from what I have seen you can enter any alphanumeric string, e.g. "ProjectId123".
As far as I can see the main settings that are stored under the ProjectId are the workspace settings, under ~/.config/JetBrains/[IDENameAndVersion]/workspace/[ProjectId].xml. This file mostly contains the open editor tabs (with paths relative to the project directory) and the tool windows, so if you copy the project directory, you will always have the same editor tabs open in both projects (containing the "same" files, but from the respective project). If you want to avoid opening all files and setting up the tool windows, you can copy the old [ProjectId].xml file to e.g. ProjectId123.xml (using the ProjectId that you entered earlier).
After Copying your existing Project to a new folder don't forget to mark your src directory as Source directory. You can do this under Project Structure | Modules.
To duplicate and rename a CLion cmake project I followed the info in the other answers with some tweaks.
What seems to be the stepless way to eliminate all references to the old project name in the new one (tested with CLion 2019.1.2):
Copy folder
rename the new folder
On the new project folder:
delete the project info folder (CLion will recreate it):
<new project name>/.idea
On a text editor, open:
<new project name>/CMakeLists.txt
change every reference to the old project name with the new name and save it.
This will assure CLion will not use Project and Target info in "CMakeLists.txt" file to recreate project files and data in ".idea" folder with the old name.
Note that other info in this file referencing the old project folder, or files stored there, such as INCLUDE, SOURCE directories, and files, should also be changed to point to the new folder.
delete old compile data. Delete folders like:
<new project name>/cmake-*
Open project in CLion
It should have the new name and no reference to the old name anywhere.
If using CSV, you may also wish to delete old CSV data
EDIT: If project requires CUDA, CUDACXX environment variable must be reassigned to full path of nvcc compiler:
File->settings->Build, Execution, Deployment->CMake->Environment
IF CLion CUDA Run Patcher is installed it maybe needed to restart CLion.