- ContextImpl Failed to ensure directory:
- Comments
- allbdeveloper commented Oct 22, 2016 •
- Expected Behavior
- Actual Behavior
- Steps to reproduce the Behavior
- jamesmontemagno commented Oct 22, 2016
- allbdeveloper commented Oct 22, 2016 •
- jamesmontemagno commented Oct 22, 2016
- jittya commented Mar 13, 2018
- MqttConnection throws exception(Failed to ensure directory) when trying to connect #185
- Comments
- rafaelekol commented Feb 14, 2017 •
- rafaelekol commented Feb 14, 2017
- jpwsutton commented Feb 22, 2017
- rafaelekol commented Feb 24, 2017
- rafaelekol commented Mar 31, 2017 •
- GregoryHo commented May 5, 2017 •
- jianglijs commented Sep 22, 2017
- jianglijs commented Sep 23, 2017
- algrid commented Dec 22, 2017
- Android: Failed to ensure directory: /storage/sdcard/Android/data/com.example.hellotest/files #43
- Comments
- eholmes commented Feb 5, 2014
- EddyVerbruggen commented Feb 5, 2014
- eholmes commented Feb 5, 2014
- EddyVerbruggen commented Feb 5, 2014
- eholmes commented Feb 5, 2014
- EddyVerbruggen commented Feb 5, 2014
- thomasMary commented Jan 10, 2015
- EddyVerbruggen commented Jan 10, 2015
- thomasMary commented Jan 12, 2015
- nh2 commented Aug 29, 2015
- Android failed to ensure directory
- Android: не удалось установить каталог
- ОТВЕТЫ
- Ответ 1
- Ответ 2
- Ответ 3
ContextImpl Failed to ensure directory:
Comments
allbdeveloper commented Oct 22, 2016 •
Please fill out either the bug or feature request section and remove whatever section you are not using.
Version Number of Plugin: 2.6.0.9 beta
Device Tested On: Samsung Galaxy s4 5.0 (api 21)
Simulator Tested On:
Project SDK target : 24 (Android N)
Expected Behavior
Actual Behavior
Steps to reproduce the Behavior
If I don’t use provider tag, app start correctly.
But I try to take a picture,
then app crashes.
[ContextImpl] Failed to ensure directory: /storage/extSdCard/Android/data/com.allXXnc.allbx/files/Pictures
It leaves only this log in application output console.
The text was updated successfully, but these errors were encountered:
jamesmontemagno commented Oct 22, 2016
allbdeveloper commented Oct 22, 2016 •
If I follow (added the lines you wrote), #110 occur.
if I don’t, this happens. (SOMETIMES)
Should I set SDK target to 6.0 as you said.?
@jamesmontemagno
jamesmontemagno commented Oct 22, 2016
If you aren’t using any 7.0 features then there is no need to target 7.0/api 25.
jittya commented Mar 13, 2018
Am getting same issue. But its not crashing. When am trying to take a picture it not showing anything and in my log i found this.
Источник
MqttConnection throws exception(Failed to ensure directory) when trying to connect #185
Comments
rafaelekol commented Feb 14, 2017 •
I am using MQTT to get and publish messages to Server. On most phones MQTT connect and disconnect is working, but on Phone: LG LFino with Android Kitkat 4.4.2, and HTC Desire 310 with Android JellyBean 4.2.2 I got exception when I try to immediately connect after disconnect.
I use MqttAndroidClient in my local service. Here is my code.
After more testing found out that phones where I can see this Exception in common has low available memory (About 200MB free memory).
The text was updated successfully, but these errors were encountered:
rafaelekol commented Feb 14, 2017
I removed DisconnectedBufferOptions and faulty devices seems to connect and disconnect fine now.
jpwsutton commented Feb 22, 2017
Looks like your application did not have permission within Android to read/write to the sdcard. You might need to change your application manifest file.
rafaelekol commented Feb 24, 2017
I already have that permission in Manifest.
rafaelekol commented Mar 31, 2017 •
Even though I disabled DisconnectedBufferOptions
I still get exception on HTC device, whenever I change WiFi connection, I get this exception.
The big issue is that, after that moment I can’t connect to socket anymore, since client.connect() is always throwing this error afterwards.
I observe this error on this device:
HTC Desire 310 with Android JellyBean 4.2.2
GregoryHo commented May 5, 2017 •
I got the same situation as refaeleko, some devices are working correctly, but the device «Lenovo YT3-X90F» with 5.1
After few seconds, connection lost and auto reconnect:
Here is my disconnect code :
Connect again when resume :
My connection options:
Also i already have the «android.permission.WRITE_EXTERNAL_STORAGE» in Manifest. Thanks.
jianglijs commented Sep 22, 2017
who know the answer,i have the same problem.
jianglijs commented Sep 23, 2017
I find the answer: MqttDefaultFilePersistence filePersistence = new MqttDefaultFilePersistence(getDir(«mqtt», MODE_PRIVATE).getAbsolutePath()); MqttAndroidClient mqttAndroidClient = new MqttAndroidClient(getApplicationContext(), MQTT_BROKER_HOST, clientId,filePersistence);
when in Android ,we should pass our own filePersistence in.The exactly answer still don,t know
algrid commented Dec 22, 2017
Another option is to use memory persistence (if you can allow for messages to be lost when the app is killed):
Источник
Android: Failed to ensure directory: /storage/sdcard/Android/data/com.example.hellotest/files #43
Comments
eholmes commented Feb 5, 2014
I installed the plugin manually and added a button:
When I click on the button in the Android emulator, I get this message in the console log:
Failed to ensure directory: /storage/sdcard/Android/data/com.example.hellotest/files
Does anyone know what I am doing wrong? Thank you!
The text was updated successfully, but these errors were encountered:
EddyVerbruggen commented Feb 5, 2014
Have you added this permission?
eholmes commented Feb 5, 2014
Yes, I’ve added that to the AndroidManifest.xml in the root of my project.
EddyVerbruggen commented Feb 5, 2014
Could you please share your code with me, so I can reproduce the problem and find a solution?
Thanks,
Eddy (eddyverbruggen[at]gmail.com)
eholmes commented Feb 5, 2014
I deleted my existing virtual devices, created new ones, and no longer see this error. Thank you for looking at my files!
EddyVerbruggen commented Feb 5, 2014
Many thanks for the update Eva.
Eddy
thomasMary commented Jan 10, 2015
Hi @EddyVerbruggen I’ve the same error («Failed to ensure directory: /storage/sdcard/Android/data/. «), and so i’m not able to share on twitter or facebook.
I’m working on a real device (Android 4.4), i’ve the correct permission (WRITE_EXTERNAL_STORAGE)
Here is the code my js code:
-for twitter:
$cordovaSocialSharings.shareViaTwitter(‘I love myapp.’, imageUrl, null);
-for facebook:
$cordovaSocialSharings.shareViaFacebook(‘I love viceversa.’, imageUrl, null)
I tried for both to upload with and url or base64 image data.
What if the target device doesn’t have a SD card? The plugin should still be able to share, right?
Any idea would be very appreciate. Thanks
EddyVerbruggen commented Jan 10, 2015
@thomasMary Can you try sharing a local image? One you host in your www folder somewhere?
thomasMary commented Jan 12, 2015
I found what was wrong. Facebook and Twitter were not installed on my phone. I expected a no-native fallback in that case, but i guess this is why you add canShareVia.. methods.
Thanks for that plugin, good job.
nh2 commented Aug 29, 2015
I deleted my existing virtual devices, created new ones, and no longer see this error. Thank you for looking at my files!
Источник
Android failed to ensure directory
ОС Android™ 5.1 (Lollipop), доступно обновление до Android 6.0.
Процессор: четырёхядерный
Оперативная память:
Объем встроенной памяти: 8-16 Гб (в зависимости от модели) + возможность увеличения памяти через USB
Последняя цифра в названии телевизора обозначает год выпуска:
[*]8 — 2013
[*]9 – 2014
[*]0 — 2015
[*]1 — 2016
[*]2 — 2017
[*] и т. д.
Пример: Philips 75PUS7101/60 является моделью 2016 года выпуска
В теме нет куратора. По вопросам наполнения шапки обращайтесь к модераторам раздела через кнопку под сообщениями, на которые необходимо добавить ссылки.
Если в теме есть пользователь, желающий стать Куратором и соответствующий Требованиям для кандидатов, он может подать заявку в теме Хочу стать Куратором (предварительно изучив шапку темы и все материалы для кураторов).
Сообщение отредактировал KёniG — 03.05.21, 21:01
Собственно, интересуют реальные характерстики устройства (конечно, устройства только 2016 года). Какой процессор, оперативная память, графический ускоритель, сенсоры и т. д.
Это можно узнать с помощью программ:
- System Info for Android
- AIDA64
- AnTuTu Benchmark
- Hardware Info
- CPU-Z
и т. д.
Очень желательно увидеть скрины.
Сообщение отредактировал Denis1121 — 09.10.16, 10:36
привет всем, на днях увидел Philips 49PFH5501/88 в интернете, меня оч заинтересовала модель, он как ни как 16го года, но вот по отзывам я теперь не могу понять кого же искать на платформе андроид филипс или сони? Также выбор пал на Сони 50w808.
Сообщение отредактировал sunsanich — 11.09.16, 17:40
Источник
Android: не удалось установить каталог
Я использовал » Environment.getExternalStorage() » для хранения и управления файлами. И с этим методом нет предупреждающего сообщения от logcat и работает очень хорошо.
Но мой проект должен использовать метод » Context.getExternalFilesDir(String type) «, и есть предупреждающее сообщение
ContextImpl: Не удалось обеспечить каталог:/storage/external_SD/Android/data/(имя пакета)/файлы
К счастью, файл File работает нормально (чтение или запись или создание папки тоже работает).
Но я хочу знать, как разрешить это предупреждение. Я что-то пропустил?
ОТВЕТЫ
Ответ 1
Вы должны знать, как появляется предупреждающее сообщение.
getExternalFilesDir(String type) вызовет getExternalFilesDirs(String type) (обратите внимание на ‘s’ в конце второго имени метода).
getExternalFilesDirs(String type) найдет все типы этого типа и вызовет ensureDirsExistOrFilter() в конце, чтобы гарантировать существование каталогов.
Если каталог недоступен, он выведет предупреждение!
Итак, если ваше устройство имеет два пути sdcard, оно будет создавать два каталога. Если он недоступен, появится предупреждение.
Вывод заключается в том, что предупреждение не нужно исправлять.
Ответ 2
Если у вас есть код, который выполняет итерацию файлов, вызывая этот API много раз, это предупреждение может вызвать загрязнение журналов. Чтобы решить эту проблему (поскольку предупреждение действительно доброкачественное), вы можете создать класс-оболочку, который сохраняет результат вызова getExternalFilesDir/getExternalCacheDir и впоследствии возвращает сохраненное значение вместо вызова API. Таким образом, по крайней мере, вы только когда-нибудь увидите это сообщение.
Ответ 3
Я следую за источником getExternalFilesDir()
Источник