Error The process cannot access the file 'classes.dex' because it is being used by another process.

BageraBagera USMember ✭✭

Hi,

I am using Microsoft Visual Studio Professional 2015 Update 3 with Xamarin 4.2.2.11.
I am facing this error every time I try to compile:
Error The process cannot access the file 'classes.dex' because it is being used by another process.
I tried to restart the Adb server but it didn't work.
Any one know how to solve it without restarting Visual Studio every time?

Tagged:

Best Answer

  • BageraBagera US ✭✭
    Accepted Answer

    It was fixed after I updated the Xamarin.Build.Download to version 0.4.3

Answers

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai

    Given you are using Visual Studio and a Windows environment, you would want to see what has a lock on that handle.

    Process Explorer is a wonderful tool to do just this:

    https://technet.microsoft.com/en-us/sysinternals/processexplorer.aspx

    When inside, you can use the Find -> Find Handle or DLL and type in classes.dex to see what process has a hold on it. Most likely it will be adb.exe or a Visual Studio process. Once you find that handle, you can manually free it up by right clicking on the list item and selecting Kill Process.

  • GautamJainGautamJain INMember ✭✭✭

    Yes, it was adb.exe or VS. In order to kill adb.exe I had to exit Visual Studio also.

  • BageraBagera USMember ✭✭

    Thank you all for your answers.

    Regarding my problem, I think it is because of Xamarin.Android.Support.v7.AppCompat library.

  • BageraBagera USMember ✭✭
    Accepted Answer

    It was fixed after I updated the Xamarin.Build.Download to version 0.4.3

Sign In or Register to comment.