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

TypeError: null is not an object (evaluating 'MaterialManager.setJSMaterials') #982

Open
monkeyK1n9 opened this issue Dec 9, 2022 · 2 comments

Comments

@monkeyK1n9
Copy link

Environment

System:

OS: Windows 10 10.0.19045
CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Memory: 12.36 GB / 23.96 GB

Binaries:

- Node: 16.14.2 - C:\Program Files\nodejs\node.EXE
- Yarn: 1.22.15 - C:\Program Files\nodejs\yarn.CMD
- npm: 8.5.0 - C:\Program Files\nodejs\npm.CMD
- Watchman: Not Found

SDKs:

- Android SDK: Not Found
- Windows SDK: Not Found

IDEs:

- Android Studio: AI-213.7172.25.2113.9123335
- Visual Studio: Not Found

Languages:

- Java: 11.0.2

npm Packages:

- expo SDK 47
- @react-native-community/cli: Not Found
- react: 18.1.0 => 18.1.0
- react-native: 0.70.5 => 0.70.5
- react-native-windows: Not Found

I am using @viro-community/react-viro: "^2.23.0"
Devices:
Samsung Galaxy A525F with android 13

Description

I installed the @viro-community/react-viro in my app but whenever I import any Viro element (ViroText, ViroScene, etc), I get this error.
I don't know what the problem is. Can someone help? I am stuck with this for days now.

Screenshot_20221209_132520_Expo Go

Reproducible Demo

  • create a new expo bare project with
npx create-expo-app --template
  • add @viro-community/react-viro with respect to the documentation and import any Viro element in your app.js
@AlbertoCabreraJr
Copy link

same issue

@monkeyK1n9
Copy link
Author

Hello everyone, hope this might help, @AlbertoCabreraJr or anybody.

I could find a work around.

This error comes when I use a recent react native version (0.70) especially with expo (sdk >= 45).

To solve my issue, I am using just the starter-kit provided by Viro (here).
The expo-viro-starter-kit does not for me, it produces similar errors (VRTText missing).

So I would advice, you use the starter-kit.

Special remarks:
1- You will need to change your /android/build.gradle file to this (see below), because of the recent Maven and jcenter changes in gradle (see blog post here) or else, it might not work:

buildscript {
    ext {
        buildToolsVersion = "30.0.2"
        minSdkVersion = 24
        compileSdkVersion = 30
        targetSdkVersion = 30
        ndkVersion = "20.1.5948944"
    }
    repositories {
        google()
        // mavenCentral()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.2.1")
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        exclusiveContent {
            filter {
               includeGroup "com.facebook.react"
            }
            forRepository {
                maven {
                   url "$rootDir/../node_modules/react-native/android"
                }
            }
        }
        mavenCentral()
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        // maven { url 'https://www.jitpack.io' }
        jcenter()
    }
}

2- You can rename your app following this nice tutorial or try the answers in the stackoverflow questions here

There you go, you are good to go. It worked for me. Hope it might help

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

2 participants