App crashes while reading file on android, Error: java.lang.NumberFormatException
See original GitHub issueVersions:
"react-native-fetch-blob": "0.10.8"
"react-native": "0.49.5"
I was reading a file using this code:
RNFetchBlob.fs
.readFile(filePath, "ascii")
.then(data => {
this.showProgressModal = true;
...
}).catch(e){}
On Android device I got this error and app crashes:
java.lang.NumberFormatException: For input string: "raw:/storage/emulated/0/Download/Bittrexv1.csv"
at java.lang.Long.parseLong(Long.java:590)
at java.lang.Long.valueOf(Long.java:804)
at com.RNFetchBlob.Utils.PathResolver.getRealPathFromURI(PathResolver.java:41)
at com.RNFetchBlob.RNFetchBlobFS.normalizePath(RNFetchBlobFS.java:918)
at com.RNFetchBlob.RNFetchBlobFS.readFile(RNFetchBlobFS.java:141)
at com.RNFetchBlob.RNFetchBlob$6.run(RNFetchBlob.java:208)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
PS. Its working fine on Android emulator and ios simulator. Haven’t tested on ios device yet. Please let me know if more information is needed to debug the issue, Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
android - application crashed with NumberFormatException
The reason you are getting this error is because the EditText is not created on the UI yet. But, you need the EditText...
Read more >Crash in java.lang.NumberFormatException: For input string
I have checked for all usages of IconTabWidget as well as its functions and it is never used in order to add tabs...
Read more >Detect and diagnose crashes - Android Developers
An app that is written using Java or Kotlin crashes if it throws an unhandled exception, represented by the Throwable class.
Read more >java.lang.numberformatexception for input string null
By the way, this is not the application developer's fault. This is a data error and to solve this problem you need to...
Read more >How to Fix with java.net.SocketException: Connection reset ...
This occurred when Server closed the connection, while the client is still waiting to read data from its InputStream. For example, if you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
simple workaround just for now.
I am still facing this issue in
"rn-fetch-blob": "^0.10.15"
is it not yet merged to master ?