com.facebook.react.bridge.readablenativemap cannot be cast to java.lang.string

See original GitHub issue

Why do I get the error with my code :

            RNFetchBlob.config({fileCache: true}).fetch("https://gateway-lon.watsonplatform.net/text-to-speech/api/v1/synthesize?accept=audio%2Fwav&text=hola%20mundo&voice=es-ES_EnriqueVoice",
            {
                method: 'GET',
                headers: {
                    'Authorization': 'Basic ' + btoa('apikey:my_api_key_here'),
                }
            })
            .then(
            (res) =>  console.log('response has arrived'),
            (error) => console.log('ERROR OCCURED', error)
            )
  • “react”: “16.9.0”
  • “react-native”: “^0.61.0”
  • “rn-fetch-blob”: “^0.11.2”

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

21reactions
vitto-mozcommented, Jun 5, 2020

in my case, there was needed to stringify body

RNFetchBlob.fetch(
      config.method || DEFAULT_CONFIG.method,
      config.url,
      {Authorization: token, ...DEFAULT_CONFIG.headers},
      JSON.stringify(config.body) // <==== here
    )
0reactions
hungdevcommented, Apr 25, 2021

in my case, there was needed to stringify body

RNFetchBlob.fetch(
      config.method || DEFAULT_CONFIG.method,
      config.url,
      {Authorization: token, ...DEFAULT_CONFIG.headers},
      JSON.stringify(config.body) // <==== here
    )

Thank you so much!. It worked ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

com.facebook.react.bridge.readablenativemap cannot be cast ...
readableNativeArray cannot be cast to java.lang.boolean. And the issue was me passing a string instead of a boolean to a component.
Read more >
com.facebook.react.bridge.ReadableNativeMap cannot be ...
ReadableNativeMap cannot be cast to java.lang.string #28978 ... //Throws an error on any kind of argument //com.facebook.react.bridge.
Read more >
[Android] com.facebook.react.bridge.ReadableNativeMap ...
[Android] com.facebook.react.bridge.ReadableNativeMap cannot be cast to java.lang.String.
Read more >
java.lang.string cannot be cast to java.lang.double react native
facebook.react.bridge.readablenativemap cannot be cast to java.lang.string. React native : Failed to construct transformer: Error: Cannot create a string longer ...
Read more >
com.facebook.react.bridge.ReadableNativeMap Java Examples
This page shows Java code examples of com.facebook.react.bridge.ReadableNativeMap.
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