Code Monkey home page Code Monkey logo

react-native-unity-view's Introduction

react-native-unity-view

Integrate unity3d within a React Native app. Add a react native component to show unity. Works on both iOS and Android.

If you're using a Unity version older than 2019.3 you can only export to android

Notice

This is a fork of https://github.com/f111fei/react-native-unity-view to make it work with React Native >= 0.60.

This project may or may not be updated depending on the further use of it at my workplace, however feel free to fork it

Install

yarn add @asmadsen/react-native-unity-view

Configuration

Since this project uses the exported data from Unity you will have do some extra configuring than a normal React Native module.

Configuring Unity

To configure Unity to add the exported files somewhere accessible to your app we use some build scripts. And the default configuration expects that you place your Unity Project in the following position relative to our app.

.
├── android
├── ios
├── unity
│   └── <Your Unity Project>    // Example: Cube
├── node_modules
├── package.json
└── README.md

Add Unity Build scripts

Copy Build.cs and XCodePostBuild.cs and place them in unity/<Your Unity Project>/Assets/Scripts/Editor/

If you want to place your Unity Project somewhere else you will have to change the following paths which is relative to the Untiy Project

Player Settings

  1. Open your Unity Project
  2. Go to Player settings (File => Build Settings => Player Settings)
  3. Change Product Name to the name of your Xcode project. (ios/${XcodeProjectName}.xcodeproj)
Additional changes for Android Platform

Under Other Settings make sure Scripting Backend is set to IL2CPP, and ARM64 is checked under Target Architectures.

Android Configruation

Under Other Settings make sure Auto Graphics API is unchecked, and the list only contains OpenGLES3 and OpenGLES2 in that order.

Android graphics

Additional changes for iOS Platform

Under Other Settings make sure Auto Graphics API is checked.

Player settings for iOS

Now Unity is configured and ready

Now you can export the Unity Project using ReactNative => Export Android or ReactNative => Export IOS.

Build dropdown

Then the exported artifacts will be placed in a folder called UnityExport inside either the android or the ios folder.

Adding UnityMessageManager Support

Add the contents of the Assets folder, to your Unity project.

You will have to rebuild for changes to appear in React Native.

Configure Native Build

Android Build

To allow for the project to recognize the UnityExport folder you will have to add two lines to android/settings.gradle.

  1. Add the following to the android/build.gradle
flatDir {
    dirs "${project(':UnityExport').projectDir}/libs"
}

So it looks like this

// [..]
allprojects {
    repositories {
        // [..]
        flatDir {
            dirs "${project(':UnityExport').projectDir}/libs"
        }
    }
}
  1. Add these two lines to android/settings.gradle
include ":UnityExport"
project(":UnityExport").projectDir = file("./UnityExport")
After Unity Export

iOS build

  1. Open your ios/{PRODUCT_NAME}.xcworkspace and add the exported project(ios/UnityExport/Unity-Iphone.xcodeproj) to the workspace root

Add unity ios project to ReactNative Ios workspace

  1. Select the Unity-iPhone/Data folder and change the Target Membership to UnityFramework

Set Target Membership of Data folder to UnityFramework

  1. Add UnityFramework.framework as a library to your Project

Add UnityFramework to project

  1. Modify main.m
#import "UnityUtils.h"

int main(int argc, char * argv[]) {
  @autoreleasepool {
    InitArgs(argc, argv);
    return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
  }
}

Use in React Native

UnityView Props

onMessage

Receive message from Unity

Make sure you have added UnityMessageManager

Example:
  1. Send message from Unity
UnityMessageManager.Instance.SendMessageToRN("click");
  1. Receive message in React Native
onMessage(event) {
    console.log('OnUnityMessage: ' + event.nativeEvent.message);    // OnUnityMessage: click
}

render() {
    return (
        <View style={[styles.container]}>
            <UnityView
                style={style.unity}
                onMessage={this.onMessage.bind(this)}
            />
        </View>
    );
}

onUnityMessage

[Recommended]Receive json message from unity.

onUnityMessage(handler) {
    console.log(handler.name); // the message name
    console.log(handler.data); // the message data
    setTimeout(() => {
      // You can also create a callback to Unity.
      handler.send('I am callback!');
    }, 2000);
}

render() {
    return (
        <View style={[styles.container]}>
            <UnityView
                style={style.unity}
                onUnityMessage={this.onMessage.bind(this)}
            />
        </View>
    );
}

UnityModule

import { UnityModule } from 'react-native-unity-view';

isReady(): Promise<boolean>

Return whether is unity ready.

createUnity(): Promise<boolean>

Manual init the Unity. Usually Unity is auto created when the first view is added.

postMessage(gameObject: string, methodName: string, message: string)

Send message to unity.

  • gameObject The Name of GameObject. Also can be a path string.
  • methodName Method name in GameObject instance.
  • message The message will post.

Example:

  1. Add a message handle method in MonoBehaviour.
public class Rotate : MonoBehaviour {
    void handleMessage(string message) {
		Debug.Log("onMessage:" + message);
	}
}
  1. Add Unity component to a GameObject.

  2. Send message use javascript.

onToggleRotate() {
    if (this.unity) {
      // gameobject param also can be 'Cube'.
      UnityModule.postMessage('GameObject/Cube', 'toggleRotate', 'message');
    }
}

render() {
    return (
        <View style={[styles.container]}>
            <UnityView
                ref={(ref) => this.unity = ref}
                style={style.unity}
            />
            <Button label="Toggle Rotate" onPress={this.onToggleRotate.bind(this)} />
        </View>
    );
}

postMessageToUnityManager(message: string | UnityViewMessage)

Send message to UnityMessageManager.

Please copy UnityMessageManager.cs to your unity project and rebuild first.

Same to postMessage('UnityMessageManager', 'onMessage', message)

This is recommended to use.

  • message The message will post.

Example:

  1. Add a message handle method in C#.
void Awake()
{
    UnityMessageManager.Instance.OnMessage += toggleRotate;
}

void onDestroy()
{
    UnityMessageManager.Instance.OnMessage -= toggleRotate;
}

void toggleRotate(string message)
{
    Debug.Log("onMessage:" + message);
    canRotate = !canRotate;
}
  1. Send message use javascript.
onToggleRotate() {
    UnityModule.postMessageToUnityManager('message');
}

render() {
    return (
        <View style={[styles.container]}>
            <UnityView
                ref={(ref) => this.unity = ref}
                style={style.unity}
            />
            <Button label="Toggle Rotate" onPress={this.onToggleRotate.bind(this)} />
        </View>
    );
}

addMessageListener(listener: (message: string | MessageHandler) => void): number

Receive string and json message from unity.

addStringMessageListener(listener: (message: string) => void): number

Only receive string message from unity.

addUnityMessageListener(listener: (handler: MessageHandler) => void): number

Only receive json message from unity.

pause()

Pause the unity player.

resume()

Resume the unity player.

Example Code

import React from 'react';
import { StyleSheet, Image, View, Dimensions } from 'react-native';
import UnityView from 'react-native-unity-view';

export default class App extends React.Component<Props, State> {
    render() {
    return (
      <View style={styles.container}>
        <UnityView style={{ position: 'absolute', left: 0, right: 0, top: 0, bottom: 0, }} /> : null}
        <Text style={styles.welcome}>
          Welcome to React Native!
        </Text>
      </View>
    );
  }
}

react-native-unity-view's People

Contributors

artistika-dev-team avatar asmadsen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-unity-view's Issues

C'ant build my project for android

It's my first time using this package and I'm having this error on unity 2020.3.22f1

InvalidOperationException: The build cannot be appended. UnityEditor.BuildPipeline.BuildPlayer (System.String[] scenes, System.String locationPathName, System.String assetBundleManifestPath, UnityEditor.BuildTargetGroup buildTargetGroup, UnityEditor.BuildTarget target, UnityEditor.BuildOptions options, System.String[] extraScriptingDefines) (at /home/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline.bindings.cs:329) UnityEditor.BuildPipeline.BuildPlayer (UnityEditor.BuildPlayerOptions buildPlayerOptions) (at /home/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline.bindings.cs:295) UnityEditor.BuildPipeline.BuildPlayer (System.String[] levels, System.String locationPathName, UnityEditor.BuildTarget target, UnityEditor.BuildOptions options) (at /home/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline.bindings.cs:290) Build.DoBuildAndroid (System.String buildPath) (at Assets/Scripts/Editor/Build.cs:44) Build.DoBuildAndroidLibrary () (at Assets/Scripts/Editor/Build.cs:23)

Vuforia Camera taking time to start!!

Hi,
I have integrate vuforia with unity and using this package i am running unity from RN,

Now the problem is that, when i navigate to screen, Unity logo show up and vuforia camera take 10 to 12 second to start up, whereas if i directly run the build and run app from unity, then vuforia camera show up in only 3 seconds approx.

Can you tell me how can i reduce the time in React native

create a library/module using the example application

The project requires quite some files and gradle settings to be set up. For modular reusability, I have been trying to create a module that can be easily imported in another react native project without the need for the unity files and gradle setup etc.

However, because of all this custom setup, I have not been able to create a reusable library using the standard methods

Would it be possible to turn this repo for example into a library, and if so, are there any guidelines on how to do this?

iOS - RNUnityView was not found in the UIManager.

I was able to export the project and run in my device using the example project from RN. Followed the tutorial to integrate the UnityView into the xcode workspace and all seemed fine.
Then i copied the "Example Code" from the bottom of the "README" to the App.js file and it gave me this error.
IMG_5090

IMG_5089

react-native 0.62 collapse android

I created a new react-native project. The current project version is 0.62.2. When I use UnityView in App.js, the program crashes immediately without an error message.

iOS Build crash

I'm trying to follow the README with an empty new project.
It builds successfully to my iPad, but it immediately crashes.
Sorry, I'm new to xCode, don't know whats going on.

From xCode:

2020-03-03 19:04:03.108 [info][tid:main][RCTRootView.m:293] Running application unityTest ({
initialProps = {
};
rootTag = 1;
})
2020-03-03 19:04:03.162944-0300 unityTest[1736:1593257] [] nw_socket_handle_socket_event [C3.1:1] Socket SO_ERROR [61: Connection refused]
2020-03-03 19:04:03.164193-0300 unityTest[1736:1593257] [] nw_socket_handle_socket_event [C3.2:1] Socket SO_ERROR [61: Connection refused]
2020-03-03 19:04:03.164519-0300 unityTest[1736:1593260] [] nw_connection_get_connected_socket [C3] Client called nw_connection_get_connected_socket on unconnected nw_connection
2020-03-03 19:04:03.164569-0300 unityTest[1736:1593260] TCP Conn 0x2838f12c0 Failed : error 0:61 [61]
2020-03-03 19:04:18.711 [info][tid:com.facebook.react.JavaScript] Running "unityTest" with {"rootTag":1,"initialProps":{}}
2020-03-03 19:04:18.718125-0300 unityTest[1736:1593258] [] nw_socket_handle_socket_event [C5:1] Socket SO_ERROR [61: Connection refused]
2020-03-03 19:04:18.718994-0300 unityTest[1736:1593262] [] nw_connection_get_connected_socket [C5] Client called nw_connection_get_connected_socket on unconnected nw_connection
2020-03-03 19:04:18.719501-0300 unityTest[1736:1593262] TCP Conn 0x2838f4900 Failed : error 0:61 [61]
2020-03-03 19:04:18.742680-0300 unityTest[1736:1593056] Built from '2019.3/staging' branch, Version '2019.3.0f6 (27ab2135bccf)', Build type 'Release', Scripting Backend 'il2cpp'
UnityFramework was compiled with optimization - stepping may behave oddly; variables may not be available.
(lldb)

Screen Shot 2020-03-03 at 19 11 56

Screen Shot 2020-03-03 at 19 12 01

libman.so

Hello still got libma.so error though i have alredy checked Player settings a it was mentioned inprevious answers java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.xyz--xcZJ-kO3KCWgDTEKcmJxQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.xyz--xcZJ-kO3KCWgDTEKcmJxQ==/lib/x86, /data/app/com.xyz--xcZJ-kO3KCWgDTEKcmJxQ==/base.apk!/lib/x86, /system/lib]]] couldn't find "libmain.so"

ld: symbol(s) not found for architecture arm64 . also experienced issue for arm7

Ld /Users/administrator/Library/Developer/Xcode/DerivedData/ActionAR-etqwbnfrpvcjklhagwwkknyzyvwh/Build/Intermediates.noindex/ArchiveIntermediates/ActionAR/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/UnityFramework.build/Objects-normal/armv7/Binary/UnityFramework normal armv7 (in target 'UnityFramework' from project 'Unity-iPhone')
cd /Users/administrator/.jenkins/workspace/action_ar_ios_app_pool_upload_autobuild/mobileapp/ActionAR/ios/UnityExport
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target armv7-apple-ios10.0 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.2.sdk -L/Users/administrator/Library/Developer/Xcode/DerivedData/ActionAR-etqwbnfrpvcjklhagwwkknyzyvwh/Build/Intermediates.noindex/ArchiveIntermediates/ActionAR/BuildProductsPath/Release-iphoneos -L/Users/administrator/.jenkins/workspace/action_ar_ios_app_pool_upload_autobuild/mobileapp/ActionAR/ios/UnityExport/Libraries -F/Users/administrator/Library/Developer/Xcode/DerivedData/ActionAR-etqwbnfrpvcjklhagwwkknyzyvwh/Build/Intermediates.noindex/ArchiveIntermediates/ActionAR/BuildProductsPath/Release-iphoneos -filelist /Users/administrator/Library/Developer/Xcode/DerivedData/ActionAR-etqwbnfrpvcjklhagwwkknyzyvwh/Build/Intermediates.noindex/ArchiveIntermediates/ActionAR/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/UnityFramework.build/Objects-normal/armv7/UnityFramework.LinkFileList -install_name @rpath/UnityFramework.framework/UnityFramework -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -map -Xlinker /Users/administrator/Library/Developer/Xcode/DerivedData/ActionAR-etqwbnfrpvcjklhagwwkknyzyvwh/Build/Intermediates.noindex/ArchiveIntermediates/ActionAR/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/UnityFramework.build/UnityFramework-LinkMap-normal-armv7.txt -dead_strip -Xlinker -object_path_lto -Xlinker /Users/administrator/Library/Developer/Xcode/DerivedData/ActionAR-etqwbnfrpvcjklhagwwkknyzyvwh/Build/Intermediates.noindex/ArchiveIntermediates/ActionAR/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/UnityFramework.build/Objects-normal/armv7/UnityFramework_lto.o -fembed-bitcode -Xlinker -bitcode_verify -Xlinker -bitcode_hide_symbols -Xlinker -bitcode_symbol_map -Xlinker /Users/administrator/Library/Developer/Xcode/DerivedData/ActionAR-etqwbnfrpvcjklhagwwkknyzyvwh/Build/Intermediates.noindex/ArchiveIntermediates/ActionAR/BuildProductsPath/Release-iphoneos -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -weak_framework CoreMotion -weak-lSystem -liPhone-lib -framework Security -framework MediaToolbox -framework CoreText -framework AudioToolbox -weak_framework AVFoundation -framework AVKit -framework CFNetwork -framework CoreGraphics -framework CoreMedia -weak_framework CoreMotion -framework CoreVideo -framework Foundation -framework OpenAL -framework OpenGLES -framework QuartzCore -framework SystemConfiguration -framework UIKit -liconv.2 -lil2cpp -framework CloudKit -weak_framework Metal -weak_framework GameController -Xlinker -dependency_info -Xlinker /Users/administrator/Library/Developer/Xcode/DerivedData/ActionAR-etqwbnfrpvcjklhagwwkknyzyvwh/Build/Intermediates.noindex/ArchiveIntermediates/ActionAR/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/UnityFramework.build/Objects-normal/armv7/UnityFramework_dependency_info.dat -o /Users/administrator/Library/Developer/Xcode/DerivedData/ActionAR-etqwbnfrpvcjklhagwwkknyzyvwh/Build/Intermediates.noindex/ArchiveIntermediates/ActionAR/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/UnityFramework.build/Objects-normal/armv7/Binary/UnityFramework
Undefined symbols for architecture armv7:
"_onUnityMessage", referenced from:
_UnityMessageManager_onUnityMessage_mC3031C4585567E720F536DB4EE28B0C20AB8A7C4 in Assembly-CSharp1.o
(maybe you meant: _UnityMessageManager_onUnityMessage_mC3031C4585567E720F536DB4EE28B0C20AB8A7C4)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

can anyone help with this issue?

Question! @react-native-community/async-storage could not be found within the project or in these directories: node_modules/@react-native-community

Does anyone know why I get @react-native-community/async-storage errors from the packager after installing this package?
Here is the error message while loading JS in the packager.

@react-native-community/async-storage could not be found within the project or in these directories:
  node_modules/@react-native-community

I have cleared every cache possible and re-installed hundreds of time. Nothing seems to fix this error.

Wondering if anyone else had the same problem.

onUnityMessage not working

Hi,
I recently encountered this error,

reason of the problem
At RNUnityViewManager.m,

RCT_EXPORT_MODULE (RNUnityView)
- (UIView *) view (
    self.currentView = [[RNUnityView alloc] init];
    if ([UnityUtils isUnityReady]) {
        [self.currentView setUnityView: [GetAppController () unityView]];
    } else {
        [UnityUtils createPlayer: ^ {
            [self.currentView setUnityView: [GetAppController () unityView]];
        }];
        (GetAppController () setUnityMessageHandler: ^ (const char * message) (
            [_bridge.eventDispatcher sendDeviceEventWithName: @ "onUnityMessage"
                                                            body: [NSString stringWithUTF8String: message]];
        }];
    }
    return self.currentView;
}

Doesn't run else section.

on UnityView.mm

- (void) createPlayer: (void (^) (void)) completed (
    if (_isUnityReady) (
        completed ();
        return;
    }
    [[NSNotificationCenter defaultCenter] addObserverForName: @ "UnityReady" object: nil queue: [NSOperationQueue mainQueue] usingBlock: ^ (NSNotification * _Nonnull note) {
        _isUnityReady = YES;
        completed ();
    }];
    if (UnityIsInited ()) (
        return;
    } ......

been calling _isUnityReady = YES before View method in this file

Currently for those who may encounter this error,
If you create <UnityView> before call UnityModule.createUnity(),
onUnityMessage works without any problems

Execution failed for task ':UnityExport:BuildIl2CppTask'.

Hi everyone,

I have a error when i build my application on Android :

  • What went wrong:
    Execution failed for task ':UnityExport:BuildIl2CppTask'.

A problem occurred starting process 'command '/Users/teera0ne/Desktop/Jabi/jabi-react-native-cli/app/android/UnityExport/src/main/Il2CppOutputProject/IL2CPP/build/deploy/netcoreapp3.1/il2cpp.exe''
`

Do you have a solution ?

Unity scene not visible inside React Native

I'm using Unity v 2020.3.29f1. The project builds fine and is running on an iphone 8. There are no build or runtime errors, but the scene is not being rendered inside react-native. I put a red background on the UnityView and I can see that it is full screen. I can see the messages coming back and forth from react-native and unity when I click the "toggle rotation" button.

I noticed that this version of Unity does not support OpenGL for iOS. Should I be using Unity v2019?

import { StatusBar } from 'expo-status-bar';
import React from 'react';
import {
  SafeAreaView,
  StyleSheet,
  ScrollView,
  View,
  Text,
  Button,
  Alert,
} from "react-native";
import {
  Header,
  LearnMoreLinks,
  Colors,
  DebugInstructions,
  ReloadInstructions,
} from "react-native/Libraries/NewAppScreen";
import UnityView, { UnityModule } from "@asmadsen/react-native-unity-view";

export default function App() {
  const [count, setClickCount] = React.useState(0);
  console.log(count);
  const onUnityMessage = (handler) => {
    console.log({ handler });
  };

  const onClick = () => {
    UnityModule.postMessageToUnityManager({
      name: "ToggleRotate",
      data: "",
      callBack: (data) => {
        Alert.alert("Tip", JSON.stringify(data));
      },
    });
  };

  return (
    <View style={{ flex: 1 }}>
      <View style={{ flex: 1 }}>
        <UnityView
          style={{ flex: 1, backgroundColor: "red", borderWidth: 1 }}
          onMessage={onUnityMessage}
          onUnityMessage={onUnityMessage}
        />
      </View>
      <Button
        style={{ width: "100%" }}
        title="Toggle rotation"
        onPress={onClick}
      />
    </View>
  );
}

const styles = StyleSheet.create({
  scrollView: {
    backgroundColor: Colors.lighter,
  },
  engine: {
    position: "absolute",
    right: 0,
  },
  body: {
    backgroundColor: Colors.white,
  },
  sectionContainer: {
    marginTop: 32,
    paddingHorizontal: 24,
  },
  sectionTitle: {
    fontSize: 24,
    fontWeight: "600",
    color: Colors.black,
  },
  sectionDescription: {
    marginTop: 8,
    fontSize: 18,
    fontWeight: "400",
    color: Colors.dark,
  },
  highlight: {
    fontWeight: "700",
  },
  footer: {
    color: Colors.dark,
    fontSize: 12,
    fontWeight: "600",
    padding: 4,
    paddingRight: 12,
    textAlign: "right",
  },
});

Cant run on ios device. Shows Command PhaseScriptExecution failed with a nonzero exit code

I cannot run in ios device. I have added UnityFramework as in documentation. But while running im getting this errors.

PS: I can still run the unity game alone by chanigng the product. But Build fails when included in react native project.

Extracting arm64 from UnityFramework
fatal error: lipo: input file (/Users/myname/Library/Developer/Xcode/DerivedData/myapp-gwhkxmittlbkqsgzagmbvbwexrwd/Build/Products/Debug-iphoneos/myapp.app/Frameworks/UnityFramework.framework/UnityFramework) must be a fat file when the -extract option is specified

Merging extracted architectures: arm64
fatal error: lipo: can't open input file: /Users/myname/Library/Developer/Xcode/DerivedData/myapp-gwhkxmittlbkqsgzagmbvbwexrwd/Build/Products/Debug-iphoneos/myapp.app/Frameworks/UnityFramework.framework/UnityFramework-arm64 (No such file or directory)
rm: /Users/myname/Library/Developer/Xcode/DerivedData/myapp-gwhkxmittlbkqsgzagmbvbwexrwd/Build/Products/Debug-iphoneos/myapp.app/Frameworks/UnityFramework.framework/UnityFramework-arm64: No such file or directory

Replacing original executable with thinned version
mv: rename /Users/myname/Library/Developer/Xcode/DerivedData/myapp-gwhkxmittlbkqsgzagmbvbwexrwd/Build/Products/Debug-iphoneos/myapp.app/Frameworks/UnityFramework.framework/UnityFramework-merged to /Users/myname/Library/Developer/Xcode/DerivedData/myapp-gwhkxmittlbkqsgzagmbvbwexrwd/Build/Products/Debug-iphoneos/myapp.app/Frameworks/UnityFramework.framework/UnityFramework: No such file or directory

Command PhaseScriptExecution failed with a nonzero exit code

How to close Unity Game (UnityView)

In React Native App at some page i have loaded UnityView. After exiting from that page, when user visits again that page then can we start the unity once again not resuming. As of now it keeps running until app is killed from memory.
Means on page exit can unity be destroyed ?

iOS build fail

Hello! When I try build ios app, I have an error in UnityUtils.h: 'UnityFramework/UnityFramework.h' file not found
Screenshot 2020-07-04 at 15 18 49

React-native version: 0.62.2

OTA support

Hi anyone knows,that if it's possible to load the files from server somehow to be able to update the game without updating the app?

Android - InvalidOperationException: The build target does not support build appending.

Hello!

Following the tutorial to the point but I get this error when trying to Export Android (2019.3.*).
I am using Unity 2019.4.15f1. This error occurs also with newer versions of Unity.

Unity error:

InvalidOperationException: The build target does not support build appending.
UnityEditor.BuildPipeline.BuildPlayer (System.String[] scenes, System.String locationPathName, System.String assetBundleManifestPath, UnityEditor.BuildTargetGroup buildTargetGroup, UnityEditor.BuildTarget target, UnityEditor.BuildOptions options) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.BuildPipeline.BuildPlayer (UnityEditor.BuildPlayerOptions buildPlayerOptions) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.BuildPipeline.BuildPlayer (System.String[] levels, System.String locationPathName, UnityEditor.BuildTarget target, UnityEditor.BuildOptions options) (at <a8e33794c0064f2aa201ade069162226>:0)
Build.DoBuildAndroid (System.String buildPath) (at Assets/Scripts/Editor/Build.cs:44)
Build.DoBuildAndroidLibrary () (at Assets/Scripts/Editor/Build.cs:23)

Library not loaded

Screen Shot 2021-09-29 at 11 24 36

Hi all, my unity project is using an external library NatCorder. After reactnative - export and then Build app,
I got an error like this. Can anyone help me?. I have searched and tried many ways but to no avail. By the way, when I try with another Unity project that doesn't use NatCorder, it works. So I guess error when adding external library like NatCorder. Thanks a lot

iOS build crash

Hi, when i try to run the example on this repo and even with another unity project, i get this build error in xcode
Undefined symbols for architecture arm64: "_onUnityMessage", referenced from: _UnityMessageManager_onUnityMessage_m8A904C01129EA827FDD76B08B34FAF9A6C4B5E36 in Assembly-CSharp.o (maybe you meant: _UnityMessageManager_onUnityMessage_m8A904C01129EA827FDD76B08B34FAF9A6C4B5E36) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

i've done correctly all the steps, i'm on unity 2019.3.0f6. Any idea how to solve this problem?

Cannot run the example code

Hi, I was trying to run the example code but got an error for Android

* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve project :UnityExport.
     Required by:
         project :app > project :@asmadsen_react-native-unity-view
      > Unable to find a matching configuration of project :UnityExport:
          - None of the consumable configurations have attributes.
   > Could not find :unity-classes:.
     Searched in the following locations:
       - file:/Users/chathuri/Downloads/react-native-unity-view-master/example/android/UnityExport/libs/unity-classes.jar
     Required by:
         project :app > project :@asmadsen_react-native-unity-view

Any thoughts? In the ReadMe I can see that it says to copy Unity Export which I cant really seem to find in the example folder either. I'm stuck at this step, as I am not sure how to generate the UnityExport folder

onUnityMessage/onMessage stops receiving messages dispatched by Unity after Metro refresh

@asmadsen

I'm running into an issue where when I refresh the Metro server, UnityView's onUnityMessage and onMessage handlers stop receiving messages dispatched by Unity. Issue is occurring with iOS build to physical device.

I've tried adding event listeners manually, but still a no-go.

The message is being dispatched by Unity with the following implementation:

public class MenuManager : MonoBehaviour
{
    public Button SignUpButton;
    public Button LoginButton;

    void Awake()
    {
        SignUpButton.onClick.AddListener(routeToSignUp);
        LoginButton.onClick.AddListener(routeToLogin);
    }
    void routeToSignUp() {
      Debug.Log("signup button clicked");
      UnityMessageManager.Instance.SendMessageToRN("SignUp");
    }

    void routeToLogin() {
      Debug.Log("login button clicked");
      UnityMessageManager.Instance.SendMessageToRN("Login");
    }
}
const UnityScreen = () => {
  const onMessage = (handler) => {
    console.log(handler);
  };

  return <UnityView style={s.unity} onMessage={onMessage} />;
};

However, after Metro is refreshed, I can still see the Debug.Log's output to Xcode which tells me that SendMessageToRN should be invoking but React Native is unable to receive the messages after a single refresh.

Project with path ':unityLibrary' could not be found in project ':UnityExport'.

When I'm trying to run yarn react-native run-android

Got the following error stack in terminal

FAILURE: Build failed with an exception.

* Where:

Build file '/Users/ReactNativeVuf/android/UnityExport/build.gradle' line: 92


* What went wrong:

A problem occurred configuring project ':UnityExport'.

> Project with path ':unityLibrary' could not be found in project ':UnityExport'.


 

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.


 

* Get more help at https://help.gradle.org


 

BUILD FAILED in 2s


 

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.

Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

iOS Archive build: UnityFramework/UnityFramework.h file not found

Generally this works great, thank you. I have hit a bit of a brick wall on the final straight though....

I can build directly to a device no problem but upon building to archive I'm getting:

{...}/node_modules/@asmadsen/react-native-unity-view/ios/UnityUtils.h:2:9: 'UnityFramework/UnityFramework.h' file not found

Presumably a setting in the target that's missing, but having tried a few things I'm wondering if you got that far and, if so, how you made it build?

No matching configuration of project :UnityExport was found.

when I try to build the app with react-native run-android

and I get this error

`* What went wrong:
Could not determine the dependencies of task ':app:mergeDebugAssets'.

Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
Could not resolve project :UnityExport.
Required by:
project :app > project :asmadsen_react-native-unity-view
> No matching configuration of project :UnityExport was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'react-native-camera' with value 'general' but:
- None of the consumable configurations have attributes.
`

'Custom instantiated <UnityDefaultViewController: > must be kind of class SplashViewController'

Hi there,

So I've updated build scripts to work with Unity 2019.4.* versions. And It was working good, without any problems. Now I have this error on Unity 2019 LTS, 2019.4.34, when starting Unity inside ReactNative:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Custom instantiated <UnityDefaultViewController: 0x107e34490> must be kind of class SplashViewController'

It is breaking integration at very beginning, and Unity does not even start. Could be related maybe to some iOS updates?

Any suggestions/ideas ?

Screen freezes when opening UnityView two times

Hi everyone,

I'm getting an head scratching bug for a few days.

My react-native app uses the unityView at several places. I can open it at every place without issues, but when I'm trying to open it two times in a row (either at the same place or different places), the screen freezes.

The screen displays the last frame that unity rendered before closing Unity.

The strangest thing is that the unityView is still running : I can ear the sounds and even click on buttons (if I remember where they are 😄)

The issue looks similar to open issues in the former module like this one for instance .

The former fix seemed to be this, but doesn't work here.

<UnityView style={{ position: 'absolute', left: 0, right: 0, top: 1, bottom: 1 }} />

Relevant code for the modal on RN side :

`class UnityModalComponent extends Component {
constructor(props) {
super(props);
const { route } = props;
this.state = {
renderUnity: true,
currentScene: route.params?.data?.scene,
};
this.shouldWait = false;
}

componentDidMount() {
const { currentScene } = this.state;
StatusBar.setHidden(true);
UnityModule.isReady().then(ready => {
if (ready) {
this.shouldWait = false;
UnityModule.postMessageToUnityManager(currentScene);
} else {
this.shouldWait = true;
}
});
}

componentDidUpdate(prevProps, prevState) {
const { renderUnity } = this.state;
if (renderUnity !== prevState.renderUnity && !renderUnity) {
const { navigation } = this.props;
navigation.pop();
}
}

componentWillUnmount() {
StatusBar.setHidden(false);
}

Did anyone encounter the issue or has any idea on how to fix this?

Thank you,

README example code is not working

The current example code at the end of the readme is not working, I guess because of the extra : null}.
Anyway, I think the whole code is deprecated with the latest react native version.

This code worked for me:

import * as React from 'react';
import { Button, View, } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import UnityView from '@asmadsen/react-native-unity-view';

const Stack = createStackNavigator();

function HomeScreen({ navigation }) {
  return (
    <View>
      <UnityView style={{ position: 'absolute', left: 0, right: 0, top: 0, bottom: 0, }} />
    </View>
  );
}

function App() {
  return (
    <NavigationContainer>
      <Stack.Navigator initialRouteName="Home" screenOptions={{headerShown: false}}>
        <Stack.Screen name="HomeScreen" component={HomeScreen} />
      </Stack.Navigator>
    </NavigationContainer>
  );
}

export default App;

Android emulator crash

I can run the project with no problems in a physical device, but when i render a UnityView in the emulator it crashes right away.

There is something i need to do to run the project in the emulator?

A problem when using Nice Vibrations in Unity

I have just added Nice Vibrations to my Unity project and now I get this error while building the whole React Native + Unity app on rect-native-unity-view compile step:

Module 'UnityFramework_NiceVibrationsPrivate' not found (https://prnt.sc/10cremj)

UnityFramework_NiceVibrationsPrivate is described in module.modulemap file in Nice Vibrations library (https://prnt.sc/10crh5p):

module UnityFramework_NiceVibrationsPrivate {
header "UnitySwift-Bridging-Header.h"
export *
}

It connects swift and Obj-C code:

MMNViOSCoreHapticsInterface.swift -> UnityFramework_NiceVibrationsPrivate -> UnitySwift-Bridging-Header.h:

#import <Foundation/Foundation.h>
#import <CoreHaptics/CoreHaptics.h>
#import "UnityInterface.h"
typedef void (*HapticCallback)();

Nice Vibrations has post process script to add some dependencies when building Xcode project from Unity:

https://prnt.sc/10crmx7
https://prnt.sc/10cro72

Unity Framework compiles OK https://prnt.sc/10crqcr , but has warning:

Umbrella header for module 'UnityFramework' does not include header 'UnitySwift-Bridging-Header.h'

When build comes to react-native-unity-view, I get the error https://prnt.sc/10crsgk

I will be grateful for any help or ideas in solving the problem

UnityExport file size for iOS too big

Need help how to reduce the file size of unity export for ios?
I have a simple unity project and when i build a unity export for ios it way too big nearly 1G.

Mostly because of libraries folder alone have 700MB

Screenshot 2021-09-09 at 17 42 33

Running multiple unity projects

Hi,
Based on the example, I can only see the possibility of being able to load one unity project, per react-native project. Is it possible to load multiple unity projects instead?

For instance, if I have two Unity Projects exported as ios and android builds, how can I specify react-native-unity-view to load project A or project B based on a user selection?

Using with iOS simulator

Has anyone managed to use react-native-unity-view with a simulator on iOS?

I try to export iOS project with Target SDK = Simulator SDK in Player Settings, but when building I get:

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_UnityAppController", referenced from: objc-class-ref in libreact-native-unity-view.a(RNUnityViewManager.o) objc-class-ref in libreact-native-unity-view.a(UnityUtils.o) ld: symbol(s) not found for architecture x86_64

iOS - The build cannot be appended.

Sorry if this is a dumb question, but i don't know what i'm doing wrong.

The React project i'm using is the default "AwesomeProject" from react's setting up tutorial. Installed via the ' npx react-native init AwesomeProject ' command.
Then i created a Unity project using version 2020.1.13f1 and followed the first instructions.

As you can see on the attached image the project is named the same as the React, i copied both required scripts to Assets > Scripts > Editor and the Auto Graphics API is on.

Screen Shot 2020-11-19 at 1 05 38 PM

Cannot find the React Native GUI

Hello Andreas,

I have faced this issue with Unity 2019.4.34 and Unity 2020.3.18
After doing the steps in the player settings ... I still cannot find this UI in the engine ...
Am I missing something ... thank you

image
ou

FileNotFoundException and nothing exported

Hello!

I'v been using this package for some time, but recently upgraded unity to version 2020 as it was the only way to fix a Unity bug.

But now when exporting android, I receive the error message:

FileNotFoundException: Could not find file "/Users/bla/src/c/packages/c-native/android/UnityExport/build.gradle"
System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.String msgPath, System.Boolean bFromProxy, System.Boolean useLongPath, System.Boolean checkHost) (at <695d1cc93cca45069c528c15c9fdd749>:0)
(wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize, System.Boolean checkHost) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.StreamReader..ctor (System.String path, System.Boolean detectEncodingFromByteOrderMarks) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.StreamReader..ctor (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
(wrapper remoting-invoke-with-check) System.IO.StreamReader..ctor(string)
System.IO.File.ReadAllText (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
Build.DoBuildAndroid (System.String buildPath) (at Assets/Scripts/Editor/Build.cs:64)
Build.DoBuildAndroidLibrary () (at Assets/Scripts/Editor/Build.cs:25)

Is this error causing the export to fail or is the error appearing because nothing is exported (there's noting in the UnityExport folder)

How to call multiple games

Hey,

If I do unity export of two games.
How can I call the views of them separately?
Is it going to support only one module?

Vuforia AR not working iOS

I have developing React Native app in which there is AR feature. The app working fine on Android but in iOS successfully run but AR is not working. I have run the same Unity project directly without RN integration and its working fine on my iPad but when I export this project to integrate in my React Native app, Vuforia camera opening but AR not working.

Unity: 2019.4.10f1
Vuforia: 9.4.6
React Native: 0.62.2

This is the log on XCode after rendering UnityView:


2020-09-18 23:13:37.718945+0500 MyFirstPrayer[1853:957853] [Window] Manually adding the rootViewController's view to the view hierarchy is no longer supported. Please allow UIWindow to add the rootViewController's view to the view hierarchy itself.

Setting UIViewControllerBasedStatusBarAppearance to NO is no longer supported.
Apple actively discourages that, and all application-wide methods of changing status bar appearance are deprecated

-> applicationDidBecomeActive()
GfxDevice: creating device client; threaded=1
Initializing Metal device caps: Apple A10 GPU
Initialize engine version: 2019.4.10f1 (5311b3af6f69)
2020-09-18 23:13:38.788304+0500 MyFirstPrayer[1853:957853] Unbalanced calls to begin/end appearance transitions for <SplashScreenController: 0x11d425260>.
UnloadTime: 5.941333 ms
Compiled for iOS
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Vuforia.PlatformRuntimeInitialization:InitPlatform()
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

Initializing Vuforia Engine
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Vuforia.VuforiaRuntime:InitVuforia()
Vuforia.VuforiaRuntime:VuforiaInitialization()
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

Vuforia Engine Version: 9.4.6
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Vuforia.VuforiaRuntime:LogVersions()
Vuforia.VuforiaRuntime:InitVuforia()
Vuforia.VuforiaRuntime:VuforiaInitialization()
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

Vuforia Engine Unity Extension Version: 9.4.6
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Vuforia.VuforiaRuntime:LogVersions()
Vuforia.VuforiaRuntime:InitVuforia()
Vuforia.VuforiaRuntime:VuforiaInitialization()
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

Unity Editor Version: 2019.4.10f1
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Vuforia.VuforiaRuntime:LogVersions()
Vuforia.VuforiaRuntime:InitVuforia()
Vuforia.VuforiaRuntime:VuforiaInitialization()
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

2020-09-18 23:13:40.765786+0500 MyFirstPrayer[1853:957853] User pre-granted access to the camera
2020-09-18 23:13:40.765905+0500 MyFirstPrayer[1853:957853] INFO/AR(1853) 2020-09-18 23:13:40: Vuforia selected rendering API OpenGL ES 2.x
2020-09-18 23:13:40.765957+0500 MyFirstPrayer[1853:957853] INFO/AR(1853) 2020-09-18 23:13:40: Vuforia SDK version 9.4.6
2020-09-18 23:13:40.765993+0500 MyFirstPrayer[1853:957853] INFO/AR(1853) 2020-09-18 23:13:40: Vuforia SDK build 5809
2020-09-18 23:13:40.891872+0500 MyFirstPrayer[1853:957853] INFO/AR(1853) 2020-09-18 23:13:40: Matched precache profile for Apple, iPad7,5, iOS 13, 800.1
2020-09-18 23:13:42.148450+0500 MyFirstPrayer[1853:957853] INFO/AR(1853) 2020-09-18 23:13:42: Vuforia Fusion: Detected and enabled use of ARKit
2020-09-18 23:13:42.149215+0500 MyFirstPrayer[1853:957853] Rendering mode set to: OpenGL ES 2.0
Vuforia Engine initialization successful
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Vuforia.VuforiaRuntime:CheckInitStatus(InitError)
Vuforia.VuforiaRuntime:InitInternal()
Vuforia.VuforiaRuntime:InitVuforia()
Vuforia.VuforiaRuntime:VuforiaInitialization()
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

Trackable ArfaCard-01 NO_POSE -- UNKNOWN
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:LogFormat(LogType, String, Object[])
UnityEngine.Debug:LogFormat(String, Object[])
DefaultTrackableEventHandler:OnTrackableStatusChanged(StatusChangeResult)
System.Action`1:Invoke(T)
Vuforia.TrackableBehaviour:RegisterOnTrackableStatusChanged(Action`1)
DefaultTrackableEventHandler:Start()
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

Dataset handwash could not be loaded and cannot be activated.
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogError(Object)
Vuforia.DatabaseLoadARController:LoadDatasets()
Vuforia.VuforiaARController:StartAfterInitializationCompleted()
Vuforia.VuforiaARController:Start()
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
System.Delegate:DynamicInvokeImpl(Object[])
System.MulticastDelegate:DynamicInvokeImpl(Object[])
System.Delegate:DynamicInvoke(Object[])
Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[])
Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action)
Vuforia.VuforiaBehaviour:Start()
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

Start Vuforia Engine
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Vuforia.VuforiaARController:StartVuforia(Boolean)
Vuforia.VuforiaARController:StartAfterInitializationCompleted()
Vuforia.VuforiaARController:Start()
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
System.Delegate:DynamicInvokeImpl(Object[])
System.MulticastDelegate:DynamicInvokeImpl(Object[])
System.Delegate:DynamicInvoke(Object[])
Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[])
Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action)
Vuforia.VuforiaBehaviour:Start()
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

cameraDeviceStartCamera
2020-09-18 23:13:42.247740+0500 MyFirstPrayer[1853:957853] INFO/AR(1853) 2020-09-18 23:13:42: Starting camera with profile for iPad7,5, 800.1
Starting Positional Device Tracker.
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Vuforia.PositionalDeviceTrackerImpl:Start()
Vuforia.VuforiaARController:StartVuforia(Boolean)
Vuforia.VuforiaARController:StartAfterInitializationCompleted()
Vuforia.VuforiaARController:Start()
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
System.Delegate:DynamicInvokeImpl(Object[])
System.MulticastDelegate:DynamicInvokeImpl(Object[])
System.Delegate:DynamicInvoke(Object[])
Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[])
Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action)
Vuforia.VuforiaBehaviour:Start()
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

2020-09-18 23:13:42.254611+0500 MyFirstPrayer[1853:957853] ERROR/AR(1853) 2020-09-18 23:13:42: VideoBackgroundConfig with screen size of zero received, skipping config step
Trackable noseWash NO_POSE -- UNKNOWN
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:LogFormat(LogType, String, Object[])
UnityEngine.Debug:LogFormat(String, Object[])
DefaultTrackableEventHandler:OnTrackableStatusChanged(StatusChangeResult)
System.Action`1:Invoke(T)
Vuforia.TrackableBehaviour:RegisterOnTrackableStatusChanged(Action`1)
DefaultTrackableEventHandler:Start()
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

Trackable handWash NO_POSE -- UNKNOWN
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:LogFormat(LogType, String, Object[])
UnityEngine.Debug:LogFormat(String, Object[])
DefaultTrackableEventHandler:OnTrackableStatusChanged(StatusChangeResult)
System.Action`1:Invoke(T)
Vuforia.TrackableBehaviour:RegisterOnTrackableStatusChanged(Action`1)
DefaultTrackableEventHandler:Start()
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)```

Undefined symbols for architecture armv7: "_OBJC_CLASS_$_UnityAppController"

Hi guys

Does anyone know why i'm getting this error when trying to build:

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_UnityAppController", referenced from:
      objc-class-ref in libreact-native-unity-view.a(UnityUtils.o)
      objc-class-ref in libreact-native-unity-view.a(RNUnityViewManager.o)
ld: symbol(s) not found for architecture armv7

I recently updated unity version, i can build and run just fine to physical device. But when trying to build to archive im presented with the above error?

How do I send a JSON from unity?

I'm sorry but there doesn't seem to be a clear explanation to this on the README

UnityMessageManager.Instance.SendMessageToRN(new UnityMessage() { name = "click", callBack = (data) => { Debug.Log("onClickCallBack:" + data); } });

When i do this from unity, nothing happens on the react native side, the function passed to onUnityMessage doesnt get triggered

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.