react-native icon indicating copy to clipboard operation
react-native copied to clipboard

TypeError in RCTNetworking.sendRequest for android for 0.16.0-rc

Open yychun1217 opened this issue 11 years ago • 29 comments

I encountered the error in android when using 0.16.0-rc

TypeError: expected dynamic type 'double', but had type 'boolean' (constructing arguments for RCTNetworking.sendRequest at argument index 5)

yychun1217 avatar Dec 02 '15 11:12 yychun1217

Hey yychun1217, thanks for reporting this issue!

React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.

  • If this is a feature request or a bug that you would like to be fixed by the team, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
  • If you don't know how to do something or not sure whether some behavior is expected or a bug, please ask on StackOverflow with the tag react-native or for more real time interactions, ask on Discord in the #react-native channel.
  • We welcome clear issues and PRs that are ready for in-depth discussion; thank you for your contributions!

facebook-github-bot avatar Dec 02 '15 11:12 facebook-github-bot

@yychun1217 Please see this issue. May be it gets some help.

andycaramba avatar Dec 02 '15 16:12 andycaramba

@andersryanc But in my case, even if I init a new project, and run in android device straight away, the same error occurs. There is no fonts directory in my android project

yychun1217 avatar Dec 03 '15 03:12 yychun1217

@yychun1217 Can you share the code which causes this issue?

satya164 avatar Dec 03 '15 03:12 satya164

Same thing for me. Installing react-native@latest is a complete bomb. I get the same red screen as the above issue mentioned. Trying to upgrade so we can close out https://github.com/facebook/react-native/issues/4132#issuecomment-161307414 but no luck

And this from the console: image

jforaker avatar Dec 03 '15 06:12 jforaker

@jforaker @yychun1217 Try running react-native upgrade after updating. Just solved this problem for me.

jasonals avatar Dec 03 '15 17:12 jasonals

Interesting. However it did not work for me :/

jforaker avatar Dec 03 '15 17:12 jforaker

@jforaker Restarted packager?

jasonals avatar Dec 03 '15 18:12 jasonals

I had the same issue on a real device after upgrading to 0.16.0 Uninstalling the app completely and redeploying it solved the issue.

marclaval avatar Dec 05 '15 16:12 marclaval

This is fixed in 0.16.0 Feel free to open it again if you still run into problems. Thanks!

christopherdro avatar Dec 05 '15 17:12 christopherdro

By what commit @christopherdro?

jforaker avatar Dec 05 '15 17:12 jforaker

@jforaker I was testing a few issues on android today and came across this. I tested @jasonals suggestion but then came across issue #4573.

After taking another look I was still using 0.16.0-rc so I updated to the latest stable release and everything worked smoothly.

@mkonicek Is there a specific commit we can refer to for this fix?

christopherdro avatar Dec 05 '15 18:12 christopherdro

@christopherdro just started a brand new project with react-native init App and it throws this error in Android.

TypeError: expected dynamic type 'boolean', but had type 'int64' (constructing arguments for RCTNetworking.sendRequest at argument index 5)

jforaker avatar Dec 06 '15 19:12 jforaker

I was able to resolve the issue for a brand new project by doing the following:

  1. brew update && brew upgrade
  2. android update sdk --no-ui --filter 'platform-tools'
  3. running android and using the SDK Manager to update to the latest api 23
  4. restart the project/packager

jforaker avatar Dec 06 '15 21:12 jforaker

@jforaker :+1: Glad you got it working!

christopherdro avatar Dec 07 '15 04:12 christopherdro

I seem to be facing the issue in release builds, and it happens after second time only. The app crashes every time I try to open it, and the following is the error stack trace from the logs,

12-08 17:46:13.031 30787-30838/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
   Process: io.scrollback.neighborhoods, PID: 30787
   com.facebook.react.bridge.NativeArgumentsParseException: TypeError: expected dynamic type `boolean', but had type `int64' (constructing arguments for RCTNetworking.sendRequest at argument index 5)
       at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:240)
       at com.facebook.react.bridge.NativeModuleRegistry$ModuleDefinition.call(NativeModuleRegistry.java:143)
       at com.facebook.react.bridge.NativeModuleRegistry.call(NativeModuleRegistry.java:64)
       at com.facebook.react.bridge.CatalystInstanceImpl$NativeModulesReactCallback.call(CatalystInstanceImpl.java:405)
       at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
       at android.os.Handler.handleCallback(Handler.java:746)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
       at android.os.Looper.loop(Looper.java:135)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$1.run(MessageQueueThreadImpl.java:137)
       at java.lang.Thread.run(Thread.java:818)
    Caused by: com.facebook.react.bridge.UnexpectedNativeTypeException: TypeError: expected dynamic type `boolean', but had type `int64'
       at com.facebook.react.bridge.ReadableNativeArray.getBoolean(Native Method)
       at com.facebook.react.bridge.BaseJavaModule$1.extractArgument(BaseJavaModule.java:68)
       at com.facebook.react.bridge.BaseJavaModule$1.extractArgument(BaseJavaModule.java:64)
       at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:235)
       at com.facebook.react.bridge.NativeModuleRegistry$ModuleDefinition.call(NativeModuleRegistry.java:143) 
       at com.facebook.react.bridge.NativeModuleRegistry.call(NativeModuleRegistry.java:64) 
       at com.facebook.react.bridge.CatalystInstanceImpl$NativeModulesReactCallback.call(CatalystInstanceImpl.java:405) 
       at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
       at android.os.Handler.handleCallback(Handler.java:746) 
       at android.os.Handler.dispatchMessage(Handler.java:95) 
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) 
       at android.os.Looper.loop(Looper.java:135) 
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$1.run(MessageQueueThreadImpl.java:137) 
       at java.lang.Thread.run(Thread.java:818) 

I have tried different versions of build tools, cleaning and rebuilding project several times (deleting both node_modules and gradle build folder several times.). I'm reopening this issue so we can investigate what's going on.

satya164 avatar Dec 08 '15 12:12 satya164

cc @mkonicek

satya164 avatar Dec 08 '15 12:12 satya164

I did have this issue, but following @jforaker instructions I can't start the build anymore:

BUILD FAILED

Total time: 3.267 secs
Could not install the app on the device, see the error above.

Probably another issue, but just warning. Not sure what to do now.

Ehesp avatar Dec 08 '15 12:12 Ehesp

@Ehesp what is the error in see the error above? Keep in mind that my solution was to start a brand new project using react-native init NewProject. And then when I saw the issue occuring I performed the steps above.

jforaker avatar Dec 08 '15 15:12 jforaker

Ah, my bad I didn't have 23.0.1 build tools installed, just 23.0.2 - no clue whether your instructions remove it, been working fine previously.

Anyway, I installed that 23.0.1, did a new project and get that error - not touched anything else:

image

Ehesp avatar Dec 08 '15 15:12 Ehesp