Code Monkey home page Code Monkey logo

unity-ios-framework's Introduction

Unity-iOS project to Framework

This is a solution for building Unity-iOS project to Cocoa Touch Framework.

icon

What's this used for?

When you developed some 3D features by Unity, and you wanna provide these features for other iOS Native Apps. There is no perfect way to do this before! With this solution, you can build your Unity-iOS project to a Cocoa Touch Framework, then other native project could use the framework. It's very useful when making VR/AR/MR SDK.

Usage

  1. Export your Unity project to Unity-iOS project. Make sure your iOS Player Settings —> Target SDK is : Device SDK. Because this solution only support running on iOS device, don't support simulator.

  2. Build Unity-iOS to Cocoa Touch Framework, then add it to your testing Xcode project.

    Follow this instruction: config-instrution / 配置说明

    There maybe a little complicate, but it will be a work.

Preview

This is a simple native app using Unity framework.

preview

Supported versions

arm64, armv7, armv7s iPhone/iPad device

iOS 8.0 +

Unity 5.5.1+

To do

Support Swift

Support Dynamic Library

Better encapsulation and simple interface in UnityOut Framework. This will be very difficult.

Thanks

Daniel Arantes Loverde and his Bitbucket repo Unity, Vuforia and iOS native subclass

Build Unity app as framework | Unity Community

IL2CPP: crashes | Unity Commnity

How can I build the ios unity project as ios framework project? | Stack Overflow

@JjieChen

@zhoukaijun123

Contact

[email protected]

[email protected]

unity-ios-framework's People

Contributors

forestlin1212 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

Watchers

 avatar

unity-ios-framework's Issues

Linker errors

Thanks for sharing this code. Quick question regarding your example app:

I had to add libIphone to the framework to get it compiled but when I run the unity-framework-ios test project I get tons of linker errors for missing symbols. See below an example.

This is using Xcode9/Unity2017.4 and trying to run on an iPhone 8. Any idea?

Undefined symbols for architecture arm64:
  "_UnityNotifyDeferSystemGesturesChange", referenced from:
      iphone::DeliverUnityUIEvents() in UnityOutFramework(platformdependent_iphoneplayer_0.o)
  "_il2cpp_gchandle_get_target", referenced from:
      ScriptingGCHandle::ResolveBackendNativeGCHandle(unsigned long long) in UnityOutFramework(runtime_scripting_3.o)
  "_il2cpp_gchandle_free", referenced from:
      ScriptingGCHandle::ReleaseAndClear() in UnityOutFramework(runtime_scripting_3.o)
  "_il2cpp_gchandle_new_weakref", referenced from:
      ScriptingGCHandle::Acquire(ScriptingObjectPtr, ScriptingGCHandleWeakness) in UnityOutFramework(runtime_scripting_3.o)
  "_il2cpp_gchandle_new", referenced from:
      ScriptingGCHandle::Acquire(ScriptingObjectPtr, ScriptingGCHandleWeakness) in UnityOutFramework(runtime_scripting_3.o)
  "_il2cpp_unhandled_exception", referenced from:
      ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) in UnityOutFramework(runtime_scripting_2.o)
  "_il2cpp_free", referenced from:
      Scripting::ErrorMessageForUnsupportedEnumField(ScriptingFieldPtr) in UnityOutFramework(runtime_scripting_1.o)
  "_il2cpp_exception_from_name_msg", referenced from:
      Scripting::CreateManagedExceptionImpl(char const*, char const*, char const*, char*) in UnityOutFramework(runtime_scripting_1.o)
      Scripting::RaiseMonoException(char const*, ...) in UnityOutFramework(runtime_scripting_1.o)
      Scripting::CreateNullExceptionObject(ScriptingObjectPtr) in UnityOutFramework(runtime_scripting_1.o)
  "_il2cpp_runtime_unhandled_exception_policy_set", referenced from:
      InitializeIl2CppFromMain(core::basic_string<char, core::StringStorageDefault<char> > const&, core::basic_string<char, core::StringStorageDefault<char> > const&, int, char const**) in UnityOutFramework(runtime_scripting_1.o)
  "_il2cpp_set_config_dir", referenced from:
      InitializeIl2CppFromMain(core::basic_string<char, core::StringStorageDefault<char> > const&, core::basic_string<char, core::StringStorageDefault<char> > const&, int, char const**) in UnityOutFramework(runtime_scripting_1.o)
  "_il2cpp_set_data_dir", referenced from:
      InitializeIl2CppFromMain(core::basic_string<char, core::StringStorageDefault<char> > const&, core::basic_string<char, core::StringStorageDefault<char> > const&, int, char const**) in UnityOutFramework(runtime_scripting_1.o)
  "_il2cpp_init", referenced from:
      InitializeIl2CppFromMain(core::basic_string<char, core::StringStorageDefault<char> > const&, core::basic_string<char, core::StringStorageDefault<char> > const&, int, char const**) in UnityOutFramework(runtime_scripting_1.o)
  "_il2cpp_set_config", referenced from:
      InitializeIl2CppFromMain(core::basic_string<char, core::StringStorageDefault<char> > const&, core::basic_string<char, core::StringStorageDefault<char> > const&, int, char const**) in UnityOutFramework(runtime_scripting_1.o)
  "_il2cpp_domain_assembly_open", referenced from:
      MonoManager::LoadAssemblies() in UnityOutFramework(runtime_scripting_1.o)
  "_il2cpp_add_internal_call", referenced from:
      scripting_add_internal_call(char const*, void const*) in UnityOutFramework(runtime_scriptingbackend_il2cpp_0.o)
  "_il2cpp_unity_liveness_calculation_from_root", referenced from:
      scripting_liveness_calculation_from_root(ScriptingObjectPtr, void*) in UnityOutFramework(runtime_scriptingbackend_il2cpp_0.o)
  "_il2cpp_domain_get", referenced from:
      scripting_domain_get() in UnityOutFramework(runtime_scriptingbackend_il2cpp_0.o)
      MonoManager::LoadAssemblies() in UnityOutFramework(runtime_scripting_1.o)
  "_il2cpp_get_corlib", referenced from:
      scripting_get_corlib() in UnityOutFramework(runtime_scriptingbackend_il2cpp_0.o)
      MonoManager::GetScriptingClass(char const*, char const*, char const*) in UnityOutFramework(runtime_scripting_1.o)
      Scripting::CreateManagedExceptionImpl(char const*, char const*, char const*, char*) in UnityOutFramework(runtime_scripting_1.o)
      Scripting::CreateNullExceptionObject(ScriptingObjectPtr) in UnityOutFramework(runtime_scripting_1.o)

Cannot build

I tryed to donwload this repo, to do the same that you did but it cannot run. I buidl before the Framework, all right, but don't build the example that use this.

Crash at il2cpp::vm::MetadataCache::Initialize()

When trying to build the application and to encapsulate the didFinishLaunchingWithOptions call in the framework (when pressing a button on the test application), the application crashes on the call.
I am using Unity 2017.4.1f1, Xcode 10.0.

The logs are the following :
matadata_cache_issue.�
screen shot 2018-07-17 at 08 56 23
screen shot 2018-07-17 at 08 57 00

According to some info gathered here, it should be due to the Unity code not finding a file name 'global-metadata.dat' in a Data/Managed/Metadata directory but I have no clue on where to put it, the Data/ folder is a reference to the one located in the framework folder as in the repository.

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.