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() on a null object reference #304

Open
savayer opened this issue Feb 13, 2023 · 14 comments

Comments

@savayer
Copy link

savayer commented Feb 13, 2023

What did you do?

I just created this component

import React from 'react';
import ContentLoader, { Rect } from 'react-content-loader/native';

export default function RectLoader() {
  return (
    <ContentLoader
      speed={1}
      width={120}
      height={30}
      viewBox="0 0 200 30"
      backgroundColor="#ebebeb"
      foregroundColor="#f5f5f5"
    >
      <Rect x="0" y="0" rx="0" ry="0" width="150" height="28" />
    </ContentLoader>
  );
}

and it doesn't matter where I call it, anyway I am getting the error. Also tried to show default <ContentLoader /> and got the same error

What happened actually?

image

I don't get the error just using npm run android of expo. I've noticed that ready .apk built doesn't work at all and doesn't show any error. To see the error I use expo prebuild -p android and then npx react-native run-android

Which versions of react-content-loader, and which browser are affected by this issue?

"dependencies": {
    "@ptomasroos/react-native-multi-slider": "^2.2.2",
    "@react-navigation/bottom-tabs": "^6.5.0",
    "@react-navigation/native": "^6.1.0",
    "@react-navigation/stack": "^6.3.8",
    "axios": "^1.2.1",
    "dateformat": "^5.0.3",
    "expo": "~47.0.12",
    "expo-font": "~11.0.1",
    "expo-splash-screen": "~0.17.5",
    "expo-status-bar": "~1.4.2",
    "expo-web-browser": "~12.0.0",
    "i18next": "^22.4.8",
    "nativewind": "^2.0.11",
    "react": "18.1.0",
    "react-content-loader": "^6.2.0",
    "react-i18next": "^12.1.1",
    "react-native": "0.70.5",
    "react-native-animatable": "^1.3.3",
    "react-native-calendars": "^1.1292.0",
    "react-native-gesture-handler": "~2.8.0",
    "react-native-maps": "1.3.2",
    "react-native-safe-area-context": "4.4.1",
    "react-native-screens": "~3.18.0",
    "react-native-svg": "13.4.0",
    "react-native-toast-message": "^2.1.5",
    "rn-range-slider": "^2.2.2"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "babel-plugin-module-resolver": "^4.1.0",
    "prettier": "^2.8.0",
    "react-native-dotenv": "^3.4.2",
    "tailwindcss": "^3.2.4"
  },

image

@codinsonn
Copy link

Did you find a solution yet? (Having this exact issue as well, not sure how to fix)

@savayer
Copy link
Author

savayer commented Feb 23, 2023

@codinsonn no, I'm using this https://github.com/mfrachet/rn-placeholder instead

@TijsM
Copy link

TijsM commented Feb 23, 2023

@savayer Not a real solution, but disabling the shiver animations by setting the animate prop tofalse fixes the issue.

The error originates from the react-native-svg package, so without the animations, there are no svg's.

EDIT: We could enable them on iOS, but not on Android

@rafhpabustan
Copy link

Any updates on this? For me it only happens for android devices. IOS works as expected

@haleyngonadi
Copy link

Updating react-native-svg to the latest version (v13.7.0) resolved the issue for me.

@Estevete
Copy link

Estevete commented Mar 28, 2023

Same issue here. And I have to stick to react-native-svg: "13.4.0" because the svg package has not been bumped in the Expo SDK 48 yet. Any update on this? 👀

@gt-off
Copy link

gt-off commented Apr 4, 2023

same issue using 13.4.0 react-native-svg and expo v47.0

@gintoki05
Copy link

same issue here using 13.4.0 react-native-svg and expo v48.0

@YZahringer
Copy link

same here with expo...

@amerikan
Copy link

amerikan commented Apr 20, 2023

@savayer Not a real solution, but disabling the shiver animations by setting the animate prop tofalse fixes the issue.

The error originates from the react-native-svg package, so without the animations, there are no svg's.

Good temporary solution. Temporarily not animating is better than crashing.

@iamromec
Copy link

iamromec commented Apr 28, 2023

Updating react-native-svg to the latest version (v13.5.0) resolved the issue for me.

@nlevyr
Copy link

nlevyr commented May 4, 2023

@iamromec Thanks so much! Just switched from 13.4.0 to 13.5.0, and although Expo warns about the mismatched library when starting Expo Go, it still works and builds don't crash anymore. Lifesaver!

@dohooo
Copy link

dohooo commented May 19, 2023

Are there any updates? 🫠

@OliverWeitman
Copy link

Switching to react-native-svg 13.5.0 fixed the issue for me. Not sure what the cause is and if it works out for others but that could be a try. There was another potential fix mentioned here as well expo/expo#20983 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests