Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to invoke virtual method 'double java.lang.Double.doubleValue() #23126

Closed
mojtaba-hajishah opened this issue Jan 23, 2019 · 25 comments
Closed
Labels
Bug Resolution: Locked This issue was locked by the bot.

Comments

@mojtaba-hajishah
Copy link

mojtaba-hajishah commented Jan 23, 2019

Environment

System:
OS: macOS 10.14
CPU: (4) x64 Intel(R) Core(TM) i5-4260U CPU @ 1.40GHz
Memory: 36.91 MB / 4.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.15.0 - /usr/local/bin/node
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 11.2, macOS 10.13, tvOS 11.2, watchOS 4.2
Android SDK:
API Levels: 27, 28
Build Tools: 27.0.3, 28.0.3
System Images: android-27 | Intel x86 Atom_64, android-27 | Google Play Intel x86 Atom, android-28 | Intel x86 Atom_64
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5056338
Xcode: 9.2/9C40b - /usr/bin/xcodebuild
npmPackages:
react: 16.7.0 => 16.7.0
react-native: ^0.57.8 => 0.57.8
npmGlobalPackages:
react-native-cli: 2.0.1

Description

I've built a music player app and when user taps on the next or previous buttons, a state change happens.
I get this error when user taps on these buttons rapidly.

screenshot-2019-01-23_17 23 57 731

this error causes the app to crash in production releases. but I've received these reports only on android devices. no reports for iOS devices. I don't know if that's relevant.

Reproducible Demo

I can't share my code because of NDA stuff.

@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.57 and verify if the issue still exists.

The "⏪Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

@mojtaba-hajishah
Copy link
Author

upgraded to react native 0.57.8 and react 16.7.0 but the issue still exists.

@mojtaba-hajishah
Copy link
Author

this is the stack trace of this error:

com.facebook.react.bridge.ReadableNativeArray.getDouble ReadableNativeArray.java:114
com.facebook.react.bridge.JavaMethodWrapper$4.extractArgument JavaMethodWrapper.java:64
com.facebook.react.bridge.JavaMethodWrapper$4.extractArgument JavaMethodWrapper.java:60
com.facebook.react.bridge.JavaMethodWrapper.invoke JavaMethodWrapper.java:359
com.facebook.react.bridge.JavaModuleWrapper.invoke JavaModuleWrapper.java:160
com.facebook.react.bridge.queue.NativeRunnable.run NativeRunnable.java
android.os.Handler.handleCallback Handler.java:751
android.os.Handler.dispatchMessage Handler.java:95
com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage MessageQueueThreadHandler.java:29
android.os.Looper.loop Looper.java:154
com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run MessageQueueThreadImpl.java:192
java.lang.Thread.run Thread.java:762

@ithustle
Copy link

I'm facing this error too on android after upgrading to RN 0.58.2.
I downgraded React 16.7.0 to 16.6.3 to upgrade to new RN version.

Any help?

@grabbou
Copy link
Contributor

grabbou commented Jan 28, 2019

@ithustle we have managed to reproduce it on 0.58.2 and are working on a fix. Can you try 0.58.1 as an alternative for now?

@ithustle
Copy link

If work, I'm cool... I'll try

@Titozzz
Copy link
Collaborator

Titozzz commented Jan 28, 2019

@ithustle Can you give me the list of dependencies inside your package.json ?

@ithustle
Copy link

@grabbou , the same error on RN 0.58.1 :(

@Titozzz

"dependencies": {
    "axios": "^0.18.0",
    "react": "^16.6.3",
    "react-native": "^0.58.1",
    "react-native-audio-file-streamer": "0.0.5",
    "react-native-camera": "^1.9.2",
    "react-native-device-info": "^0.24.3",
    "react-native-dialog-input": "github:ithustle/react-native-dialog-input",
    "react-native-fast-image": "^5.1.2",
    "react-native-get-music-files": "^2.1.0",
    "react-native-local-mongodb": "^2.2.4",
    "react-native-marquee": "^0.3.2",
    "react-native-music-control": "^0.9.7",
    "react-native-remote-svg": "^1.4.0",
    "react-native-vector-icons": "^6.2.0",
    "react-navigation": "^1.6.1",
    "react-navigation-redux-helpers": "^1.1.2",
    "react-redux": "^6.0.0",
    "redux": "^4.0.1",
    "redux-logger": "^3.0.6",
    "redux-thunk": "^2.3.0",
    "rn-fetch-blob": "^0.10.15"
  },
  "devDependencies": {
    "@babel/runtime": "^7.3.1",
    "babel-core": "6.26.3",
    "babel-jest": "23.6.0",
    "jest": "23.2.0",
    "metro-react-native-babel-preset": "^0.51.1",
    "react-test-renderer": "^16.6.3",
    "redux-immutable-state-invariant": "^2.1.0",
    "schedule": "^0.4.0",
    "seamless-immutable": "^7.1.4"
  },
  "jest": {
    "preset": "react-native"
  }

@grabbou
Copy link
Contributor

grabbou commented Jan 28, 2019

Fix is on the way. Please wait for about an hour for 0.58.3 to try.

@mojtaba-hajishah
Copy link
Author

@grabbou any news?

@kelset
Copy link
Contributor

kelset commented Jan 29, 2019

@mojtaba-hajishah 0.58.3 is out.

That said

I can't share my code because of NDA stuff.

That's not a valid thing to write, you should always provide a minimal repro created with react-native init.

@mojtaba-hajishah
Copy link
Author

@kelset
after updating to react native 0.58.3, I get this error after running react-native run-android:

module.js:550
    throw err;
    ^

Error: Cannot find module './bundle/unbundle'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/barazaman/Desktop/Hajishah/Git/Midoone/node_modules/react-native/local-cli/commands.js:44:1)
    at Module._compile (module.js:653:30)
    at Module._compile (/Users/barazaman/Desktop/Hajishah/Git/Midoone/node_modules/pirates/lib/index.js:83:24)
    at Module._extensions..js (module.js:664:10)
    at Object.newLoader (/Users/barazaman/Desktop/Hajishah/Git/Midoone/node_modules/pirates/lib/index.js:88:7)
    at Module.load (module.js:566:32)

@Fasteel
Copy link

Fasteel commented Jan 30, 2019

rm -rf ./node_modules
npm i
react-native run-android 

work for me :)

@kelset
Copy link
Contributor

kelset commented Jan 31, 2019

@mojtaba-hajishah have you tried cleaning up the project as @Fasteel wrote?

@mojtaba-hajishah
Copy link
Author

mojtaba-hajishah commented Feb 6, 2019

@kelset cleared the node modules folder and react-native run-android works.
BUT, the original issue still exists.
Could you please tell me the reason behind this error? maybe I can find a temporary workaround. it's affecting hundreds of my app's users everyday.

@kelset
Copy link
Contributor

kelset commented Feb 6, 2019

Could you please tell me the reason behind this error?

I have no way of helping you without a repro (which means, a react-native init-ed project with the minimal changes that leads to creating the same issue you are reporting), sorry. Probably it's some race condition, maybe something on a didMount or some button press getting fired before the method that it needs to run is ready. But again, there is no way to help you without a reproducible demo.

@hramos hramos removed the Bug Report label Feb 6, 2019
@mojtaba-hajishah
Copy link
Author

Thank you @kelset for the follow up.
I managed to find the origin of the issue, which was react-native-text-ticker.
The stack trace of the issue was misleading and referenced react native library as the source of the problem, but after removing this library, everything works just fine.
I still have absolutely no idea what was going on, but since I no longer face the issue, feel free to close this.

@kelset
Copy link
Contributor

kelset commented Feb 8, 2019

Ok thanks - may be worth opening an issue in that repo then, but still glad you found the fix 👏

@likobe-mobonda-jeandenis

Capture d'écran 2019-09-24 02 07 04

could someone help me ?? because I did everything but no solution

@zeyios
Copy link

zeyios commented Oct 24, 2019

In my case, I found there is some bugs in my Javascript code.
You can debug Android code with Android Studio and find which call cause this crash.
File: com.facebook.react.bridge.JavaMethodWrapper
image

My js code call measureLayout with null params:
image

@zuhairnaqi
Copy link

If you are using keyboardShift on somewhere in project. Do remove it and check.
This works for me

@anuj-njoshi
Copy link

Any one found exact reason of this bug i am facing same issue
My env
react: 16.8.3 => 16.8.3 react-native: 0.59.9 => 0.59.9

@stevenleeg
Copy link

I also ran into this issue and used @AsiamCn's suggestion to track it down to react-native-reanimated. Fire up Android Studio, run the app, and watch the logcat (it's a tab in the bottom of the Android Studio window) in order to get a stack trace which will hopefully lead you to the culprit.

In my case, I just needed to upgrade react-native-reanimated from 1.2.0 -> 1.6.0 and everything worked.

@boltware
Copy link

I also ran into this issue and used @AsiamCn's suggestion to track it down to react-native-reanimated. Fire up Android Studio, run the app, and watch the logcat (it's a tab in the bottom of the Android Studio window) in order to get a stack trace which will hopefully lead you to the culprit.

In my case, I just needed to upgrade react-native-reanimated from 1.2.0 -> 1.6.0 and everything worked.

This worked for me!. I recently migrated to react-native 0.61 and was getting above error. I updated react-native-reanimated from 1.2.0 -> 1.6.0 and it Wola!!!!!

@kishor3854
Copy link

I also face same problem with react-native version 61.2 and react version 16.9.0. I remove react-native-reanimated library and reinstall & relink it. It's work fine.Its error due to old version of react-native-reanimated, just upgrade it and run it. :)

@facebook facebook locked as resolved and limited conversation to collaborators Feb 8, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Feb 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests