0

This code works for me but it is reported in fabric crashlytics not work on some devices and actually mkdirs retrun false I checked already the dir.exists() before .

File dir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "/Gahvare/");
        if (!dir.exists()) {
            if (!dir.mkdirs()) {
                Crashlytics.logException(new Exception("in downloadFileWithProgressBar directory not exist, path: " + dir.getPath() + "  absolut path is :" + dir.getAbsolutePath()));
                //  callback.onFailure(CONNECTION_ERROR);
            }
        }

fabric report

device list not workdevice list not work

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
emad pirayesh
  • 654
  • 7
  • 12

1 Answers1

0

Try below in application manifest

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.app.appname" 
    android:versionCode="1"
    android:versionName="0.2">

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