Warnings while creating a new project - android-studio

I'm facing an issue with Android Studio. When I create a new project by default the project doesn't go in the AndroidStudioProject Folder.
If I try to move the project into the AndroidStudioProjects folder, while creating the project I become a lot of warnings: The following file could not be created since it already exists: gradle-wrapper.jar The following file could not be created since it already exists: gradle-wrapper.properties If you proceed the resulting project may not compile or not work as intended.

There is no default folder for saving new projects, there is only Last project location saved in your computer. So every project will be stored where last project was saved. (Unless you change location).
So, If you want to change the default location (which is technically the Last location), then you might wanted to change the location while creating a new project, and then all the succeeding projects will be saved in previously mentioned location.
Now this is what you have to do: Create a new project, point the project location to AndroidStudioProjects folder. Now, Android Studio will store every new project in that location.
Once that's done, then import all of your projects (which are outside that folder) in that folder by import an existing project.

Related

Can't create Sample Data Directory - Android Studio

I"m trying to Create a sample data directory, using Android Studio, by clicking on app in the project view and then right mouse click to find the menu item New > Sample Data Directory.
It is not working.
Creating the directory via android studio doesn't always work. You may need to create the directory manually in your directory structure (at /app/sampledata/) without using Android Studio. Once you create it (e.g., via Windows Explorer) it should show up in Android Studio. See the the following answer for more information about sample data in general: How to put new placeholder resources into Android Studio project ("tools:sample" resources)?
"Unlike resources like images, fonts, etc. The sample data does not go in /res/ (they are not compiled with the app, hence. It is probably easier to filter them out by putting them in a totally separate directory). They go in /app/sampledata/, for example: /app/sampledata/image.png."
You can create a sample data directory in Android Studio itself by following the below steps:
Change the view of directory structure from Android to Project as follows
Right click app folder and select New->Directory
Finally, give a name to your directory, in your case, it should be sampledata
I have already created sampledata directory that's why it says "Directory already exists".
That's it. You have done it. Remember that Android Studio also supports loading sample data from a json file. All you have to give is fully qualified name of the key residing in the json file.
Ex- if your json file contains key name inside a Json Array student, then you have to specify it as "#sample/your_student_file.json/student/name" to use values present in key name.
Unless your issue happens to be different, this is a known issue that only affects Windows. As I've found, it has something to do with 'C:\' in the file path.
https://issuetracker.google.com/issues/124553391
As Shawn mentioned, you need to manually create the directory.
I've been unable to get the images to actually display in the previewer, which I suspect may also be caused by the file path bug.
Inside the app folder in file explorer, You can create a new folder (sample data) which will be reflected in your android studio.

Project not running in myeclipse

I copied the project(folder) into the myeclipse environment folder and when i try to run it , it is giving the following error :
Problems occurred opening the selected resources.
The project description file (.project) for 'activity tracker' is missing. This file contains important information about the project. The project will not function properly until this file is restored.
activity tracker is the name of the project
How do i generate this file ?
i am currently running
MyEclipse Enterprise Workbench Version: 8.6
Delete the project from the workspace but don't delete the project files on disk (this is an option during the delete process). Then create a project, of the appropriate type, with the same name, in the same location (defaulted to the workspace). I'm not sure if you'll be prompted to reuse the files already in the project location but you can play it by ear.
Alternatively, move the project to another folder. Create a new project with the same name, of the same type, and add the appropriate capabilities. Then copy your source in from the moved old project.
Tip: 8.5 is very old, consider moving to the latest release, with loads of fixes and new features.

Duplicate jhipster project

I have developped a Jhipster project.
I need to create a new one which will be quite the same (but not the same). I would like to duplicate the first project.
The second project would just have a different name and different main package name.
Is there a way to do that properly?
Thanks
Duplicate your project folder, in new folder edit .yo-rc.json file and change name and package. You may also want to change the rememberMeKey
Delete src folder
Run jhipster --with-entities to re-generate app with new settings
Copy back from old project what you've added
Delete yo-rc.json .... and generate your new entity then every thing will be ok (Tested)

How do I rename a solution-level folder in TFS?

I'm using Visual Studio 2012 and TFS Express. I have the top level collection 192.168.100.100\Collection; under it I have a project for each program; under those I have the solution folders. So in the project folder FooBarBaz I have the solution OldName. (I'd rather not post screen shots of the folder tree, but I can rig up an ASCII art depiction if needed.)
I want to rename the folder OldName to NewName. I have already successfully renamed the solution itself and checked that in. I have also successfully changed my local mapping from ~/Projects/OldName to ~/Projects/NewName.
In MSVS Source Code Explorer, when I right-click on OldName the context menu options Rename and Move are both greyed out.
How do I rename the folder in TFS? I am the team's TFS admin so I can use the web-based settings and I can also use the TFS control panel on the host system.
Right click on the folder name in the left panel.
Also, you must have those folders mapped into your current workspace.
Pre-step assumption: Create local folder with solution and project under it and added solution to TFS. TFS now has a path in TFS pointing to a TFS folder that contains your added solution. This location is bound to the location on your local machine that is likely out of sync with the path structure represented in Source Control Explorer.
You want to rename the folder in TFS that holds your solution. When I right-click in Source Control Explorer, “Rename” is grayed out. It appears that TFS wants the TFS path to match your local path structure.
In order to rename the TFS folder I had to:
Check everything in
Remove binding to source control
Do a get latest - TFS assumes structure inherited binding - so whatever the folder is named and where it is in the TFS path structure, the get latest will create a local folder to hold the code.
Now, right click on the folder and do a rename in Source Control Explorer.
TFS and your local workspace are now in sync. If you now go and rename the TFS folder that contains your solution, the next time you open the solution, your local folder name will be automatically changed to match TFS.
Of course, don’t forget to go back later - after VS has released the lock, and delete your old/first/”no longer bound to TFS” version of the local solution folder.
I hope this helps someone else.

Visual Studio Express 2012 with TFS Mapping wrongly

I'm trying to map a folder from TFS, and it fouls it up every time I re-try doing it.
My structure on server is:
$/
--tool
----ASK
------Project1
------Project2
------Project3
------etc
I map to a local folder: C:\mytool and do a get. It correctly downloads all the folders in this structure:
C:/mytool
--tool
----ASK
------Project1
------Project2
------Project3
------etc
However, when I try to open ASK.sln (located in C:/mytool/tool folder) It fails when it tries to open projects.
Instead of opening
C:\mytool\tool\ASK\Project1
it complains that it can't find the project at
C:\mytool\tool\mytool\tool\Project1
and same for other projects, i.e.
C:\mytool\tool\mytool\tool\Project2
C:\mytool\tool\mytool\tool\Project3
Please help!
I've tried deleting everything, mapping C:\mytool to tool instead of '$/' and also to 'ASK' and every time it tries searching for projects in the wrong location.

Resources