This project has moved. For the latest updates, please go here.

Push File FileNotFoundException

Jul 10, 2013 at 2:24 PM

I will Develop an application and C # that sends a database via cable to the Android device. It turns out that using your dll when I try to send a file to the device, sending happens successfully, but an exception is thrown FileNotFoundException (Unable to locate ....) Debugging into the code I could see that the problem occurs at the time the adb tries to access the file. One detail is that if I go after shipped in Windows Explorer and browse to the file and it appears not only appears after restarting the equipment. Does anyone know what this could be?
Aug 2, 2013 at 1:47 PM
Edited Aug 2, 2013 at 2:00 PM
This happens in the SyncService.cs class => private SyncResult DoPushFile ( string local, string remotePath, ISyncProgressMonitor monitor )

after pushing the file to the device it wants to set the Chmod. on that point the remote file is not found.

Preventing the crash is easy :
if (Device.FileSystem.Exists(remotePath))
   // files pushed have no permissions...
   this.Device.FileSystem.Chmod(remotePath, "0666"); 
but fact is the file is not found using Filesystem yet it's there.

When you try the following :
var devicelocation =  device.SyncPackageToDevice(@"C:\temp\yourgreatapplication.apk");
device.InstallRemotePackage(devicelocation, true);
you will notice an error, if you check for the file you will notice it's not found
var devicelocation =  device.SyncPackageToDevice(@"C:\temp\yourgreatapplication.apk");
if (device.FileSystem.Exists(devicelocation))
    device.InstallRemotePackage(devicelocation, true);
Still looking into the issue myself
Sep 9, 2013 at 6:48 PM
Did you ever work out a solution to this? Running into the same issue.
Oct 1, 2013 at 7:58 AM
Edited Oct 1, 2013 at 7:59 AM
No i never got this resolved. I know where was already a work item concerning this.

I've added an issue but it has not een picked up.
Feb 11, 2014 at 7:50 AM
herghost wrote:
Did you ever work out a solution to this? Running into the same issue.
I actually found a sort of work around.

in the Device.CS i changed the Temp_Directory_For_Install to :
    public const string TEMP_DIRECTORY_FOR_INSTALL = "/mnt/sdcard/tmp/";
It appeared that the sdcard folder cannot be used directly, it's a virtual. Going there thru the mnt folder fixed it for me.
Aug 24, 2014 at 6:54 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.