question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android: Deprecation warnings about SDCardDir and SDCardApplicationDir

See original GitHub issue

Branch: 0.10.9

Just calling the following code:

import RNFetchBlob from 'react-native-fetch-blob';

const url = http://my.server.com/my/upload/API;
const headers = { Authorization: 'Bearer xxxxxxxxx' };
const body = RNFetchBlob.wrap('file:///storage/emulated/0/Android/data/some/local/file');
const res = await RNFetchBlob.fetch('POST', url, headers, body);

generates the following warnings in the Android logs:

W ReactNativeJS: SDCardDir as a constant is deprecated and will be removed in feature release. Use RNFetchBlob.android.getSDCardDir():Promise instead.
W ReactNativeJS: SDCardApplicationDir as a constant is deprecated and will be removed in feature release. Use RNFetchBlob.android.getSDCardApplicationDir():Promise instead. This variable can be empty on error in native code.

These warnings have been added by https://github.com/joltup/react-native-fetch-blob/commit/22fd32a but apparently there are still some occurrences of SDCardDir and SDCardApplicationDir in the code of the 0.10.9 branch.

I’m aware that the 0.10.9 branch isn’t stable yet but it is intended to be released with a bunch of bug fixes so I believe that these warnings should be fixed before the release.

Thanks

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
Traviskncommented, Jun 26, 2018

This issue should be resolved by #77

1reaction
chrusartcommented, Jun 14, 2018

You’re right, this getters are called when dirs object is instantiated just be importing fs.js file. Will think about it @ataillefer .

Read more comments on GitHub >

github_iconTop Results From Across the Web

SDCardFS Deprecation - Android Open Source Project
SDCardFS is deprecated on devices that launch with Android 11 or higher and run kernel version 5.4 or higher. On such devices, VTS...
Read more >
Deprecation warnings from generated sources not ...
In our Android project, targeting API 33 caused a lot of deprecation warnings. In particular, the generated code for navigation args are ...
Read more >
The rn-fetch-blob from joltup - Coder Social
Grant Permission to External storage for Android 5.0 or lower ... Android: Deprecation warnings about SDCardDir and SDCardApplicationDir. Branch: 0.10.9.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found