Android Studio 3.0.1 Unable to delete file - android-studio-3.0

Android Studio 3.0.1
Java 1.8
Sometimes(not always) when I try to run (Shift-F10) my application I get error:
Error:Execution failed for task ':app:clean'.
> Unable to delete file: D:\myproject\app\build\intermediates\processing-tools\runtime-deps\debug\desugar_try_with_resources.jar
I need to clean and rebuild project to fix this. The rebuild is too long (about 7 minutes). It's not very good.
So I want to avoid this error? How I can do this?

Related

Test Explorer is finding tests, but not running them after upgrading to NUnit3TestAdapter v4.3.0

I'm running Visual Studio Professional 2019 and have many NUnit tests in my project. A few days ago, I updated my NUnitTestAdapter nuget package from 4.2.1 to 4.3.0 and now my Test Explorer does not run any of the tests. It throws no errors and has no problem finding/displaying the tests, but whenever I try to run them, it says:
Test run finished: 0 Tests (0 Passed, 0 Failed, 0 Skipped) run in 172.1 ms
I can confirm that rolling back to 4.2.1, cleaning, and rebuilding the project fixes the problem so maybe the issue is a bug in the 4.3.0 package, however I wanted to check if anyone else has this problem or if there is any configuration I need to do in Visual Studio to fix this.
This issue (.Net Framework (4.8 and lower) would crash due to InternalTracelog files trying to be written to the Program Files directory.) was fixed in version 4.3.1 of NUnit3TestAdapter Nuget package.

.NET 5 Projects with Packaging Projects fail to build after VS2019 Upgrade to version 16.10

Following issue occurs only on .NET Desktop Projects that also include Windows Application Packaging Project.
After my VS2019 was updated to version 16.10, all my .NET 5 projects that also include a Windows Application Packaging Project fail to build in VS2019. Both the Clean Solution and Rebuild Solution actions fail. In both cases we get the following error:
ResolvePackageDependencies task failed unexpectedly
When I tried dotnet clean I got the following error:
C:\Program Files\dotnet\sdk\5.0.300\Microsoft\DesktopBridge\Microsoft.DesktopBridge.props" was not found. Confirm that the expression in the Import declaration "C:\Program Files\dotnet\sdk\5.0.300\\Microsoft\DesktopBridge\\Microsoft.DesktopBridge.props" is correct, and that the file exists on disk.
And I verified on my Windows 10 Pro - latest version 20H2 that the folder C:\Program Files\dotnet\sdk\5.0.300\Microsoft\ does not have the DesktopBridge folder - and that seem to cause the issue. Both the Clean Solution and Rebuild Solution were working fine just before an upgrade of VS2019 to version 16.10

Can't open or create projects: The type initializer for 'MonoDevelop.Projects.MSBuild.MSBuildEvaluationContext' threw an exception

This morning, I found I was unable to create or open any projects on Visual Studio Community for macOS v8.1.1 (build 27) without getting the error...
The project could not be created
The type initializer for 'MonoDevelop.Projects.MSBuild.MSBuildEvaluationContext' threw an exception.
This install of VS has been working for quite some time on this Mac. VS had found and installed some updates recently. This is not a box where I work routinely; it may have last worked successfully a week or so ago.
Here is a screencapture when trying to create a Console app project, for instance. The error occurs when I hit the "Create" button.
I've found a very similar error on a now defunct Bugzilla for the old Xamarin Studio here, which links me to this resolved GitHub issue on MonoDevelop, which is now Visual Studio, from 2017, which is marked Closed and Merged.
I've also found a very similar error report raised as another GitHub issue for MonoDevelop here. No clear resolution there; just a reply that, "Seems like MSBuild is not installed?"
They both suggest MSBuild isn't in the right place, but I'm not sure how I'd fix that.
I have tried uninstalling Visual Studio (by trashing) and removing .NET using sudo rm -rf /usr/local/share/dotnet. This removed .NET, but on reinstall of VS and .NET, the error returns.
Is there a better way to perform a clean install? Is there another way to resolve this issue?
Round 2
Since the issue was MonoDevelop specific, I did a find to find any file with mono in it. I found some stuff like this...
/Library/Frameworks/Mono.framework/Versions/Current/Commands/mono
... in the Frameworks folder, and that looked promising. I've messed with MonoDevelop in the past (remember icsharpcode?), know that it used to be its own, independent, OSS C# IDE, and blasted that Mono.framework folder away.
sudo rm -rf /Library/Frameworks/Mono.framework/
I also deleted Visual Studio and removed /usr/local/share/dotnet again, then reinstalled .NET and VS with the VS installer.
When I tried to open Visual Studio, I got a different message.
Now we're getting somewhere. I clicked the "Download Mono Framework" button in that dialog and initially tried installing the "Visual Studio" release from the page the button opened, tried reopening VS, and got the same error as before. Strangely, the VS release is 5.18.1.3, and the error message, above, says I need 5.18.1.24+. :thinking-face:
I tried downloading the latest "Stable" release of the mono framework instead, which is version 5.20.1.19.
Visual Studio opens and creates new projects without error, but...
EDIT: That was short lived. I now get a /usr/local/share/dotnet/sdk/2.1.700/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(5,5): Error MSB4018: The "GenerateDepsFile" task failed unexpectedly.
System.TypeLoadException: Could not load type of field 'Microsoft.NET.Build.Tasks.DependencyContextBuilder:_filteredPackages' (12) due to: Could not resolve type with token 01000025 from typeref ...
error when I try to build the stock console app.
NOTE: There is an official process for deleting Mono I missed, and is better than the quick & dirty rm -rf I tried, above.

How to setup android ndk in jenkins on linux

I have jenkins on ubuntu. Building worked fine until I started to use android ndk.
latest ndk is downloaded and extracted into /opt/android-sdk-linux/ndk-bundle
In /etc/profile.d/android.sh is:
export ANDROID_HOME="/opt/android-sdk-linux"
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH"
export ANDROID_NDK_HOME="/opt/android-sdk-linux/ndk-bundle"
but I got still error:
:common:compileDebugNdk FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':common:compileDebugNdk'.
NDK not configured.
Download the NDK from http://developer.android.com/tools/sdk/ndk/. Then add ndk.dir=path/to/ndk in local.properties.
(On Windows, make sure you escape backslashes, e.g. C:\ndk rather than C:\ndk)
The message says it all. You should add a text file local.properties to the project directory on the Linux machine, with one line
ndk.dir=/opt/android-sdk-linux/ndk-bundle
This file is usually in .gitignore, and Android Studio generates it automatically. But when you build your project in Jenkins, it does not open Android Studio.

Visual Studio 2015 RTM Cordova IOS Build Error - Could not find module 'Q'

I am using Visual Studio 2015 RTM, and I am working on a Cordova project. My project works fine for Android, but I cannot get it to build for IOS. I have figured out what the problem is, but I cannot figure out how to fix it.
When I build for IOS it is sending the build to the remote build agent installed on my Mac computer, but it is returning the following error:
Could not find module 'Q'. Please Go to Tools --> Options --> Tools
for Apache cordova --> Cordova Tools --> Clear Cordova Cache and try
building again.
Following it's suggestion and clearing the Cordova cache does not help. I did some research and have found that it is a bug in the cordova_ios library. Here is a link to the commit that fixed the error https://github.com/apache/cordova-ios/commit/ed272032878959c90eb28ccc1490e96fb7b69287.
Basically what the issue is that the check_reqs.js file is require 'Q' (uppercase) instead of 'q' (lowercase).
I can work around the problem (and confirm that this is the problem) by doing the following:
Copy my Cordova project over to my Mac computer.
At the command line add IOS as a Cordova platform.
Go to the /platforms/ios/cordova/lib/check_reqs.js file and change line 25 to be a lowercase 'q'.
Build and run the project on the Mac.
What I don't know is how to fix this in Visual Studio so I can build from Visual Studio? I have tried doing NPM updates on the computer that Visual Studio is installed on, but that has not fixed it. I have also tried to manually add the IOS platform to my project via the Cordova command line, and then changing the same file that I change on the Mac, but that does not fix it either.
It looks like this issue if fixed in the latest version of the cordova_ios library, I just cannot figure out how to get Visual Studio and/or the remote build agent on my Mac to use the latest version of the cordova_ios library.
Update
It looks like this is a bug that other people are seeing with Cordova. There are discussion about it here and here. I can reproduce this on my Mac computer. If I create a new Cordova project and add the iOS platform and try to build it for iOS I receive this error. I can then correct the issue by opening the check_reqs.js file and changing the uppercase 'Q' to a lowercase 'q'. However when I build from Visual Studio it sends the project across to the Mac with the incorrect check_req.js file and the build fails. I cannot figure out how to correct this issue when doing a iOS build from Visual Studio.
If your OSX machine has case a case sensitive filesystem you can hit this though a fix is in the works. (Most people do not turn on case sensativity.)
The fix you reference has not yet been released publicly. You can watch for a "platform" release here: http://cordova.apache.org/
Once the platform is released it is very likely a Cordova CLI update will also occur (ex: 5.1.2) so you can just update to that version via the config designer.
However, as an alternative you can add the following into your config.xml file to cause Cordova to use a different iOS platform version and then do a "clean" in VS to force it to take effect:
<engine name="ios" spec="3.9.0" />
3.8.0 is the currently released version.
A "DISCUSS" thread is already going for an iOS release - it should be out in the next couple of weeks.
You can try using the Git URI to get edge - but that could be buggy so exercise care:
<engine name="ios" spec="https://github.com/apache/cordova-ios.git" />
I think we should simply do a patch release of Cordova with this bug fix. Will start a thread on the mailing list to see if a quick release is possible.
Did you already try re-installing vs-tac? Here's the doc:
https://msdn.microsoft.com/library/dn771551(v=vs.140).aspx#vstac
What version of node do you have installed on the MAC machine? I have 0.12.2 and the require(Q) gets satisfied without any errors. Can you try installing a newer version of Node? Let me know.

Resources