Skip to content

null is not an object (evaluating 'RNUnity.initialize') #31

@Liiisey

Description

@Liiisey

Hello everyone !

I having an issue when i run npm start with expo in my android device (see just below) :
Screenshot_2021-01-13-11-32-07-084_host exp exponent

It seems that my delegateName is still null.

I have follow your instructions : I have named a new game object in my Unity scene (UICommandsDelegate) and attached it with the script (RNCommandsDelegate.cs), and I have declared this variable in my Unity.init(); in my App.js, as you can see here :

`import React, {PureComponent} from 'react';
import {View, Text, TouchableOpacity} from 'react-native';

import {Unity, UnityResponderView} from '@wowmaking/react-native-unity';

Unity.init('UICommandsDelegate');

Unity.addEventListener('test', e => {
console.warn(e);
});

class App extends PureComponent {
render() {
return (
<>
[...]`

What's wrong ? What am I missing ?
Thanks in advance for your precious help !
(I'm using Expo ~40.0.0, React Native 0.63.2 and Unity 2019.4.8f1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions