android 6.0 ,open .geodatabase file err

06-03-2016 01:37 AM
New Contributor

after android runtime update,tip java.lang.RuntimeException: Unable to open the database file

0 Kudos
4 Replies
Regular Contributor II

You need to enable runtime permissions for access to external storage at Android API 23.  If you are compiling/deploying to API 22 or below this is not required.  See the following help documentation:

Requesting Permissions at Run Time | Android Developers

0 Kudos
Occasional Contributor

I don't know if this helps but I am noticing in Android M (6.0) when pointed at SD Card that some environmental variables no longer work even with permissions setup correctly.  For example I had to change the following...(there are probably other ways to do this also).


to a little more convoluted method to get SD Card path...

if (Build.VERSION.SDK_INT >= 23) {

   for (File file : mContext.getExternalFilesDirs(null)) {

       if (file.getPath().contains("emulate")) {


              File fileParent = file.getParentFile();

              appSDPath = fileParent.getPath() + "/Reference_Data";

              appSDPathApplication = fileParent.getPath();




   appSDPath = System.getenv("SECONDARY_STORAGE") + "/Android/data/";


Regular Contributor II

dgtery dgt​,

Did the above suggestions help?  Are you still having issues?

0 Kudos
Regular Contributor

Hi dgtery dgt​,

Make sure you enable the permission in your AndroidManifest.xml, you probably not give the WRITE & READ permission.

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

Install and set up—ArcGIS Runtime SDK for Android | ArcGIS for Developers

Hope this can help.