module named 'app' already exists on Android Studio - android-studio

I did something wrong and I don't know what I did. But the module name has been changed to my-android-app.
And I am trying to get it back to app. The default name of single module.
I tried Rename Module. But I get.
in the drop down menu of build, there are my-android-app and app. But I just have one build.gradle of module from my-android-app.
In the project structure. I just have my-android-app. Nothing to delete.
How can I fix this problem?

You need to rename *.iml file(IntelliJ IDEA Module). This is the name of module. This file describes about the module.
Edit configuration if you see two.
Delete all except for app. And change Name to app if its name is different.
.idea >your-app.iml`
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/app/your-app.iml" filepath="$PROJECT_DIR$/app/your-app.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
</project>
Delete one of them. (Maybe your-app.iml module tags.) Or if the location is incorrect then fix it.
File > Invalidate Caches & Restart.
Clean Build.

Related

Publish on TFS does not find the pubxml file for Node.js test project

I created a Node.js project for an protractor test environment using the Node.js Tools to test a web application on a team foundation server. The test project and the web application are in one solution file. However, if i want to deploy the Node.js project on the tfs, it is not able to find the pubxml file located in the web application project.
Error log:
12>CoreCompile:
Creating directory "bin".
Copying file from "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Node.js Tools\Microsoft.NodejsTools.WebRole.dll" to "bin\Microsoft.NodejsTools.WebRole.dll".
ValidatePublishProfileSettings:
Validating PublishProfile(TestProfile) settings.
12>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4364,5): error : The value for PublishProfile is set to 'TestProfile', expected to find the file at '<PATH>\TestProject.Web.Protractor.Tests\__profiles\TestProfile.pubxml' but it could not be found. [<PATH>\TestProject.Web.Protractor.Tests.njsproj]
12>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4371,4): error : PublishProfile(TestProfile) is set. But the $(WebPublishMethod) does not have a valid value. Current Value is "". [<PATH>\TestProject.Web.Protractor.Tests.njsproj]
12>Done Building Project "<PATH>\TestProject.Web.Protractor.Tests.njsproj" (default targets) -- FAILED.
After analyzing the Microsoft.Web.Publishing.targets i found the PublishProfileRootFolder variable to change the search path for the pubxml file.
First i tried to place the variable inside the MSBuild arguments. However, this raised problems with other test projects and i was not able to use variables like the $(SolutionDir).
I ended trying to use the PublishProfileRootFolder variable inside the project file and this works now:
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
...
<PublishProfileRootFolder>$(SolutionDir)PathToWebApplication\Properties\PublishProfiles</PublishProfileRootFolder>
</PropertyGroup>
...
PS: Additionally you need a Web.config file, placed in the project root of the test project:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<customErrors mode="on"/>
<compilation debug="true"/>
</system.web>
</configuration>

Server Error in '/ccnet' Application

My CCTray says build is broken and on the server(http://172.25.165.10/ccnet/)
I get this error
Server Error in '/ccnet' Application.
Configuration Error
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<!-- This is your CruiseControl.NET Server Configuration file.
Add your projects below! -->
<project name="winapp"
description="demoproject showing a small config" queue="Q1">
<webURL>http://172.25.165.10/ccnet/</webURL>
<!-- specify a state folder to prevent CCNet from saving it in Program Files\CruiseControl.NET\server
programs may not standard write their data in it on windows Vista and up)
-->
<sourcecontrol type="svn">
<trunkUrl>https://citdevbox.arcade.local:8443/svn/cardwellR/trunk/winapp</trunkUrl>
<workingDirectory>c:\builds\winapp</workingDirectory>
<username>***</username>
<password>***</password>
</sourcecontrol>
<state type="state" directory="C:\CCNet\State" />
<!-- specify a artifactDirectory to prevent CCNet from saving it in Program Files\CruiseControl.NET\server
programs may not standard write their data in it on windows Vista and up)
-->
<artifactDirectory>C:\CCNet\BuildArtifacts\MyFirstProject</artifactDirectory>
<tasks>
<msbuild>
<executable>C:\WINDOWS\Microsoft.NET\Framework\\v3.5\MSBuild.exe</executable>
<projectFile>C:\Builds\build\BootStrapper.msbuild</projectFile>
<buildArgs>/noconsolelogger /t:CTSx86;BuildZip /v:d</buildArgs>
<logger>ThoughtWorks.CruiseControl.MsBuild.XmlLogger,C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
<timeout>900</timeout>
</msbuild>
</tasks>
<triggers>
<!-- check the source control every X time for changes,
and run the tasks if changes are found -->
<intervalTrigger
name="continuous"
seconds="300"
buildCondition="IfModificationExists"
initialSeconds="5"/>
</triggers>
<publishers>
<xmllogger />
<artifactcleanup cleanUpMethod="KeepLastXBuilds"
cleanUpValue="50" />
</publishers>
</project>
</cruisecontrol>
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: The root element must match the name of the section referencing the file, 'appSettings'
Source Error:
Line 1: cruisecontrol xmlns:cb="urn:ccnet.config.builder"
Source File: C:\Program Files (x86)\CruiseControl.NET\server\ccnet.config Line: 1
Version Information: Microsoft .NET Framework Version:2.0.50727.5456; ASP.NET Version:2.0.50727.5456
You didn't post the content of your ccnet.config file which the error you are getting is complaining about. Lets start with the obvious. I would look to see if there is a typo in there, for example maybe a missing quote or something in the appSettings section. If you have the unmodified version revert back to that and see if your issue goes away and compare the unmodified with the modified.
There is an app called CCValidator which will tell you where the error is in your ccnet.config file. I suspect that is not where the problem is. It sounds like the error is in the ccservice.exe.config. Perhaps someone accidentally copied ccnet.config to ccservice.exe.config. The error may also be in your web dashboard's configuration.
I solved the issue by removing the build args tag.
</noconsolelogger /t:CTSx86;BuildZip /v:d>
My processor was 64 bit and I was using noconsolelogger /t:CTSx86 which is for a 32 bit processor. Anyway these were optional so I removed it worked fine.

How to allow web.config files as normal files and allow download IIS inside a virtual directory

I am working on a Unity 3D game which upon build for Windows generates game.exe and game_Data file and folder. The Game_Data folder contains a directory called **Game_Data\Mono\etc\mono\2.0**.
The directory files are shown in image.
The Browsers directory contains one file called Compact.browser.
The Current Scenario.
1. These game files are hosted on a server where IIS 7.5 is running.
The game resource files are served in virtual directory of the game website.
I've made few changes to the website's root web.config file so that all filetypes are allowed to download only in the game resources folder on server.
Yes, all file types including .html, .aspx, .xml, .config, .browser, .map etc are all downloading as normal files.
The problem
As you see the directory structure there is a web.config file inside the game resources folder. The file has nothing to do with website configuration but with the game (which is on client side after downloading).
As the files are served as individual files each file is downloaded separately. So when the client tries to download all files including the contents of the above folder.
Due to this web.config file, contents of the directory is not downloading. If I delete this web.config file all of the .aspx, .config, .map files are downloading. Also there are some other folders where many different files are downloading properly.
But this web.config file is also required for the game, and it is not allowing it be downloaded with other files too in the directory shown above.
I've tried to look into the solution. Found some hints to avoid inheritance in nested config files. But actually I want to completely treat this file as a normal file, not as a site configuration file.
I think you got my problem. Please let me know your suggestions. You can say adding Mime types. But actuall all of the file types are downloading including .config files. Except the file named web.config.
I'm having the same problem, and I think I found the solution: there is a way to tell IIS not to interpret web.config files.
To do this, modify the C:\Windows\System32\inetsrv\config\applicationHost.config file (I haven't found a way to do this in the IIS user interface), by specifying allowSubDirConfig="false" for the relevant <virtualDirectory> element:
<configuration>
<system.applicationHost>
<!-- ... -->
<sites>
<site name="Default Web Site" id="1">
<application path="/">
<virtualDirectory path="/" physicalPath="%SystemDrive%\inetpub\wwwroot" />
<virtualDirectory path="/Staging" physicalPath="C:\inetpub\wwwroot\Staging" allowSubDirConfig="false" />
</application>
<bindings> <!-- ... --> </bindings>
</site>
See http://www.iis.net/configreference/system.applicationhost/sites/site/application/virtualdirectory for the details.
The problem is, it still won't let you download the web.config file, it keeps returning a 404 - Not found, even after removing all handlers.
Edit - found the solution. The short answer is that in your web.config, you should clear the fileExtensions and hiddenSegments lists:
<system.webServer>
<security>
<requestFiltering>
<hiddenSegments>
<clear />
</hiddenSegments>
<fileExtensions>
<clear />
</fileExtensions>
</requestFiltering>
</security>
I've written a blog article about it that explains all the details.

how to call multiple project from different path in ccnet config file

I have a multiple project which is defined in ccnet.config file in below.it's very confusing to read.there is anyway, we can split these project file in some location path.and call these project file in ccnet config.please help me out for these issue.
<cruisecontrol>
<project name="project1">
...
</project>
<project name="project2">
...
</project>
</cruisecontrol>
It's better to use the pre-processor, it will also the system when one of the sub-files change.
http://www.cruisecontrolnet.org/projects/ccnet/wiki/Configuration_Preprocessor
You can look at an example here :
http://www.cruisecontrolnet.org/projects/ccnet/wiki/Scenarios
Step 2 Build on Check-in, and next steps.
It will show you how that example config grows when there are new requirements for the build server.
<!DOCTYPE cruisecontrol [
<!ENTITY project1 SYSTEM "file:project1.xml">
<!ENTITY project2 SYSTEM "file:project2.xml">
]>
<cruisecontrol>
&project1;
&project2;
</cruisecontrol>
From:
http://www.cruisecontrolnet.org/projects/ccnet/wiki/TheCruiseControlConfigurationBlock
Note, the one "gotcha" is that if you change any of the "sub-file"'s, the system will not recycle ....... (as it would if you made a change to ccnet.config ).
The work around is to change the sub-file, then add a space (or take a space) (or some other whitespace character) in the ccnet.config file).

MSBuild: Permanently Change PropertyGroup Property of a Project

I was hoping to find a way to set a value in my csproj file during my build to a value. Is there a task in MSBuild that I can use to set a property permanently to a value? In the example below, can I set CustomValue = Yes permanently?
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
.....
<CustomValue>XXXX</CustomValue
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids></ProjectTypeGuids>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
You can use the XmlPoke task to do that. It seems a little odd to be altering projects this way though. Alternatively, you can set up a tiny import file,
<!-- in your main project file, right below the PropertyGroup -->
<Import
Condition="Exists('Custom.props')"
Project="Custom.props"
/>
Then dynamically create this property file, as,
<?xml version="1.0" encoding="utf-8"?>
<Project
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
ToolsVersion="4.0">
<PropertyGroup>
<CustomValue>True</CustomValue>
</PropertyGroup>
</Project>
You can either use XmlPoke on just this .props file, or use WriteLinesToFile to create the entire file. This secondary file wouldn't need to be checked into source control, the condition on the import makes the project functional when the file doesn't exist.
The XmlPoke task would look like this,
<XmlPoke
XmlInputPath="./Custom.props"
Namespaces="<Namespace Prefix='x'
Uri='http://schemas.microsoft.com/developer/msbuild/2003'/>"
Query="//x:PropertyGroup/x:CustomValue/#Value"
Value="True"
/>

Resources