Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XA0126: Unable to copy Fast Deployment tools to 'files/.__tools__/xamarin.find' on the target device. ... #9646

Closed
bokidotnet opened this issue Jan 3, 2025 · 12 comments
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects. need-info Issues that need more information from the author.

Comments

@bokidotnet
Copy link

Android framework version

net9.0-android

Affected platform version

VS 2022 17.12.3

Description

Starting this morning all projects made only for Android devices on compile in VS reports

XA0126: Unable to copy Fast Deployment tools to 'files/.tools/xamarin.find' on the target device. ...

After I turned off Fast Deployment to Android it's working but compile is soo soo slow.
Project properties -> Build -> General - Android - Options
Fast deployment
[ ] Debug

Beside that interesting on all above is that few days ago, VS started to compline that project need to be deployed first on emulator/device.
Solved by going to Configuration Manager and check Deploy for Debug.

It's very very wired since both issues I didn't have before at all.

Steps to Reproduce

Starting this morning all projects made only for Android devices on compile in VS reports

XA0126: Unable to copy Fast Deployment tools to 'files/.tools/xamarin.find' on the target device. ...

After I turned off Fast Deployment to Android it's working but compile is soo soo slow.
Project properties -> Build -> General - Android - Options
Fast deployment
[ ] Debug

Beside that interesting on all above is that few days ago, VS started to compline that project need to be deployed first on emulator/device.
Solved by going to Configuration Manager and check Deploy for Debug.

It's very very wired since both issues I didn't have before at all.

Did you find any workaround?

No response

Relevant log output

@bokidotnet bokidotnet added Area: App+Library Build Issues when building Library projects or Application projects. needs-triage Issues that need to be assigned. labels Jan 3, 2025
@bokidotnet
Copy link
Author

Work around so far.

  • Delete current Android emulators which were used for testing and dev. using e.g. Android Device Manager
  • Create new ones again using e.g. Android Device manager (+ New)
  • Run project
    For now, no more issue XA0126: Unable to copy Fast Deployment tools...

@dellis1972 dellis1972 added need-info Issues that need more information from the author. and removed needs-triage Issues that need to be assigned. labels Jan 4, 2025
@dellis1972
Copy link
Contributor

@bokidotnet can you get the binlog which contains the fast deployment error please?

dotnet build foo.csproj -t:Install -c Debug -bl

@bokidotnet
Copy link
Author

@bokidotnet can you get the binlog which contains the fast deployment error please?

dotnet build foo.csproj -t:Install -c Debug -bl

Will try to manage hope soon if I grab spare time... since issues with maui eats me a lot of time.

@dotnet-policy-service dotnet-policy-service bot added need-attention A xamarin-android contributor needs to review and removed need-info Issues that need more information from the author. labels Jan 4, 2025
@jonathanpeppers jonathanpeppers added need-info Issues that need more information from the author. and removed need-attention A xamarin-android contributor needs to review labels Jan 27, 2025
Copy link

Hi @bokidotnet. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

Copy link

Hi @bokidotnet. Due to inactivity, we will be closing this issue. Please feel free to re-open this issue if the issue persists. For enhanced visibility, if over 7 days have passed, please open a new issue and link this issue there. Thank you.

@Mike-E-angelo
Copy link

FWIW I am seeing this after upgrading to Microsoft Visual Studio Community 2022 (64-bit) - Preview Version 17.13.0 Preview 4.0

I attempted to run this command but get the following error:

 error MSB4057: The target "Install" does not exist in the project.

@dellis1972
Copy link
Contributor

try

dotnet build foo.csproj -t:Install -f net9.0-android -c Debug -bl

or net8.0-android depending on what you are targeting.

@Mike-E-angelo
Copy link

Thank you for your quick response, @dellis1972. 🙏 I was able to produce a binlog for you here:
https://developercommunity.visualstudio.com/t/XA0126:-Unable-to-copy-Fast-Deployment-t/10841736

@dellis1972
Copy link
Contributor

So this issue is down to permissions on the device

Failed to push xamarin.find to files/.__tools__/xamarin.find. Mono.AndroidTools.AdbException: couldn't create file: Permission denied

Which suggests that we cannot write to the /data/local/tmp folder or run-as cannot write to the internal files/.__tools__.
Which is odd because the version file existed.

I would try completely deleting the application from the device, make sure you are not in multi user mode as well. And if you are make sure you have deleted the app from any other users which have it installed.

@Mike-E-angelo
Copy link

Mike-E-angelo commented Feb 4, 2025

Thank you for your investigation @dellis1972 it is appreciated. I did try to delete the application, clearing cache and files, then uninstalling the application. I am not in multi-user mode (I think -- I never added another user or anything fancy like this). I tried running it after deleting the application but the error persists. :(

As this worked in the previous Preview without error this seems to be an upgrade-related consideration, but I am not sure. I am new to Android development so this is all foreign territory for me.

@Mike-E-angelo
Copy link

I had to clone the emulator instance, delete the old one, and rename the new one to the old one's name to get this working again. 😞

@dellis1972
Copy link
Contributor

I had to clone the emulator instance, delete the old one, and rename the new one to the old one's name to get this working again. 😞

That sounds like the emulator image was corrupted somehow (which can happen).

@github-actions github-actions bot locked and limited conversation to collaborators Mar 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: App+Library Build Issues when building Library projects or Application projects. need-info Issues that need more information from the author.
Projects
None yet
Development

No branches or pull requests

4 participants