Android studio slow performance when working with large kotlin files - performance

I have a problem with Kotlin files in android studio. when the file is too large (for example more than 2000 lines), the android studio is not responding and actually, it freezes when I try to work with it.
I should mention that I have no problem with java files it exists only with Kotlin ones. Also, I've increased the IDE RAM but no luck.
I have a Kotlin file with more than 2000 lines and I cannot work it. when I open it, it stuck and freezes, I cannot even close the file anymore, I must quit the IDE and reopen it.
Is there any known issue or a way to solve this problem?

Related

Opening solution using Visual Studio 2017

I have been working on this little mobile app for android using Xamarin in Visual Studio 2017.
When opening the solution with the laptop that I used to develop the app works like a charm. Then I zip the entire folder over the solution.
../myFolder/
app1/ //here is all the code
app1.sln //solution file
myFolder.zip
Transfer the zip file to other laptop/PC through usb, email and online repository, even extensions like rar, 7zp and tar. I simply can not load the solution from other Visual Studio but the one where I created/developed the application originally.
Hours passing with this screen then VS is not responding and after that, it simply crashes/closes with no error message.
In the other hand, I can open any solution created from any other PC in my laptop without issues. After saving, I haven't found the pattern yet, but some solutions can't be opened from the original PC which creates them nor others.
You may be using an older version of Visual Studio on the PC you've facing the issue. I've faced that too.
It was a known bug (reported here and here) already fixed on newer versions.
The workaround is to close VS, delete the folder vs created in the same directory of your solution and try to reopen it.
To avoid other problems on compiling or running your app after that, I recommend you also to delete all bin and obj folders from your project's folders, clean and rebuild the solution.
It's safer keep all your development environments updated in software wise to avoid this kind of trouble.
I hope it helps.

Visual studio reinstalls apps when re-running with no changes

I’m having a problem when debugging my Android app. When I start debugging, then stop, then start debugging again, it will always re-install the app on the phone even though there hasn’t been any changes done. This can start being a pain since our app is large and each build takes over a minute to complete. As far as I can tell, I’ve set everything correctly, including having Fast Deployment turned on and having the linker disabled to speed up the build process but it still rebuilds, uninstalls and reinstalls the app, taking up a lot of time. One thing to note is that we don't see this behavior in Xamarin Studio on the mac, it’s only within Visual Studio.
I’m running visual studio 2015 14.0.25123 update2 with
Xamarin Android 6.0.3.5 (a94a03b).
Please help me resolve this issue.
Thank you.
Based on the information you've provided, it seems like you're hitting a recent issue we've seen with NuGet packages and dating. The new NuGet client for Visual Studio will now honour the dates found inside of the .nupkg, instead of using the current date when writing files to disk.
What this means is that packages with odd dates in their files, like the popular ModernHttpClient library (which dates its files using 2046) will end up written in disk with those dates. As a result of this, msbuild will detect this future date upon build and assume your app is not up to date and will then fire a complete rebuild, essentially breaking incremental build support.
You can check that this is the case by turning on msbuild diagnostic output. The very first line in the build output pad should read something like:
1>Project 'App3' is not up to date. Input file 'c:\temp\app3\packages\modernhttpclient.2.4.2\lib\monoandroid\okhttp.dll' is modified after output file 'C:\temp\App3\App3\bin\Debug\App3.pdb'.
To fix it, you can touch the date of the offending .dll to the current date or download the NuGet packlage from the NuGet website, then extract using Windows built-in .zip support (you must use the Windows built-in support other utilities may keep the bogus dates).
The following VS extension was also created to automatically touch the dates of offending packages and is definitely the easiest way to get things sorted:
https://visualstudiogallery.msdn.microsoft.com/0ffd5d55-6d03-4be1-95b5-a94c89af86ba
Do note that this issue does not manifest if you're using Xamarin Studio.

How can I open a Visual Studio solution without loading all of its projects?

I have big solution in Visual Studio that has some Android, Windows Phone and iOS Xamarin projects. Unfortunately, Visual Studio hangs (for hours) when it tries to load the whole solution. It worked fine as long as I usually only loaded either the Android or the iOS project (and plug-in project), but not both at the same time.
Unfortunately, I changed it and now I can't load the solution anymore. I read that settings like these are stored in the .suo file, but I have no idea how I change it (and disable loading the Android projects for example). How can I close certain projects without doing this after the whole solution loaded?
Thank you!
You can open the sln file in notepad and just delete the projects you dont need.
But to make sure you don't mess things up I would suggest making a backup of your sln file.
You could just open the PRJ file that you're interested in all by itself.

Windows Phone Profiler don't work in project with multiple assemblies and pcl

I have a problem with the Windows phone application analysis tool in VS 2012,
when I start any of the three available profiling modes on my project with multiple assemblies, the project is being rebuilt and nothing happens, only the progress ring is animating and I can't exit VS without killing its process in Task Manager, but when I run it on a sample project with only the one app project the profiler runs perfectly.
I don't know where the problem is, so please if anyone had this problem too, share your solution for fixing it.
The problem was in one image named with non ASCII characters and renaming it solved the problem.

Why does Visual Studio's Publish Web feature intermittently fail to copy all changed files

For years now, across multiple versions of Visual Studio, there has been a bug with the Publish Web command (the one you get when you right-click on a web app and click Publish).
Very intermittently (about 10% of the time), some files that have changed will not be deployed if they already exist in the output directory. This is highly disturbing behaviour as you can never be confident that all your changed files have been copied to the destination correctly. The only workaround I know is to totally clear out the destination directory but this is a big hassle.
Does anyone else experience this issue? What could be the cause? Are there any known workarounds?
I have run into this too. And yes, it is disturbing. Especially since we seem to have to wait 2 years for any Visual Studio updates.
The only workaround I found was to check up some of my changed ASPX files, and verify that they changed, and if not, I select the Delete all files option in Publish to force a complete rebuild (slow and tedious).

Resources