Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
I have a Single-View app made in Xamarin, with Visual Studio 2017. If I run the app from Visual Studio in Debug mode, the app gets installed in Android/data/...
If I build on release and sign the apk Ad-Hoc(the use adk to install), or run on release directly, the app gets installed, but I am unable to find where. Apparently it is in a secure hidden location on the device, where I have no access.
Is there something special I need to do to have an apk that can be installed and deployed in Android/data/.. ?
I would highly recommend you use an app from the app store such as "My APK" or a similar tool to see the exact path it's being installed to.
Typically apps get installed to internal memory via:
You can also use a file explorer to view these items too. You will want to see exactly where it's being installed first.
I would highly recommend looking at the following answer to get a better understanding:
I am using ES File Explorer to see the storage.
This is the way I am getting the path:
string path = System.Reflection.Assembly.GetExecutingAssembly().Location;
When I run from DEBUG mode, the location it gives me is: /storage/emulated/0/Android/data/com.smallcaps.app/files/.__override__/com.smallcaps.app.dll
Also, I am able to find the folder using ES File Explorer, and the location is /Android/Data/com.smallcaps.app/files
The same behavior happens when I install an apk from google play.
But, when I run from RELEASE mode, the location give is:
Also, I am unable to find any folder with that name using ES File Explorer.
The same behavior as the one on Release, happens to the apks installed with Signed Ad-Hoc certificate.
From what I could deduce, is the fact that the installation takes place in a restricted area of the internal memory, where I have no access, and thus, I cannot get a path due to security issues?
The system is working as expected in this case. Our development tools use the android tooling to install the apk so the apps end up where ever the android tooling installs them. Typically /data/app/<package>.
A quick question, what is it you are trying to do which means you need access to the installation directory? I you are trying to load content that you have included via `AndroidAsset` then you should be using the AssetManager  to do that. On older versions of android the application was not extracted from the .apk so there is no way to use System.IO.* to load files from the application "folder".
I am trying to create folders, create databases, download specific files, load dlls via MEF. These operations take place in to folder of the solution. Also, I am writing logs at that location, that I wanted to be able to see. These all work while building on Debug.
In order to reproduce the behavior that is seen when installing google play apks, what do I need to do? To make an apk and signed it with a Google Play Certificate? Do I need to upload it to Google Play?
To reproduce the "release" behaviour in debug mode you need to switch off Fast Deployment. This will embed the assemblies into the .apk that is installed on the device. It should allow you to reproduce the environment.
Debug works in debug because the `/storage/emulated/0/Android/data/com.smallcaps.app/files/.__override__/` is writable.
You cannot write data into the application folder on a release device, this is a security feature.
You should be using a folder like
This should get you a path to the private storage area for the user. Or use one of the other ones available like
I would advise you take a look at https://forums.xamarin.com/discussion/3773/system-environment-specialfolder
Thank you for the answer. I will try to implement your suggestion.