Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question xcode framework from Unity2018, dynamic lib UnitySendMessage failed

Discussion in 'iOS and tvOS' started by HyunMok_Moon, Apr 9, 2021.

  1. HyunMok_Moon

    HyunMok_Moon

    Joined:
    Oct 14, 2016
    Posts:
    24
    Hello,
    I built a xcode project with Unity 2018.3.0f2.
    I create a new xcode project and import Data, Classes, Libraries (which from unity).
    I can success Native app with unity scene wrapped.
    I followed this link. https://medium.com/@IronEqual/how-to-embed-a-unity-game-into-an-ios-native-swift-app-772a0b65c82
    and this link. https://the-nerd.be/2015/11/13/integrate-unity-5-in-a-native-ios-app-with-xcode-7/

    I want to build ios framework from Unity built xcode project, but I failed.
    I searched from this keyword, but I have no clue.

    Expected function body after function declarator
    Unknown type name '_LIBCPP_INLINE_VISIBILITY' at stdlib.h
    Code (CSharp):
    1.  
    2. inline _LIBCPP_INLINE_VISIBILITY long      abs(     long __x) _NOEXCEPT {return  labs(__x);}
    3. ...
    Unkown type name '_LIBCPP_PUSH_MACROS' at limits c++
    Code (CSharp):
    1.  
    2. _LIBCPP_PUSH_MACROS
    3. #include <__undef_macros>
    4. #include <__cxx_version>
    5. ...
    Unkown type name '_LIBCPP_CONSTEXPR' at limits c++
    Code (CSharp):
    1.  
    2. static _LIBCPP_CONSTEXPR const  bool is_specialized = false;
    3. ...
    No template named 'is_arithmetic' at limits c++
    Code (CSharp):
    1.  
    2. template <class _Tp, bool = is_arithmetic<_Tp>::value>
    3. class __libcpp_numeric_limits
    4. {
    5. ...
    I doubt xcode build settings about c++ compiler, but I can't solve yet.

    Apple Clang - Language - C++
    C++ Language Dialect : GNU++11 [-std=gnu++11]
    C++ Standard Library : libc++ (LLVM C++ standard library with C++11 support)


    My Unity version is 2018.3.0f2 and Xcode version is 11.5.

    I researched UaaL (Unity as a Library) in Unity 2019 version, but I have to use 2018 version for dependency.

    Thank you.
     
    Last edited: Apr 9, 2021
  2. HyunMok_Moon

    HyunMok_Moon

    Joined:
    Oct 14, 2016
    Posts:
    24
    I build Xcode project from Unity2018.3, and I make framework project in xcode 11.5.
    I add Unity group and Data, Classes, Libraries folder to this framework project.
    I build success, and I import this framework to other new xcode Application project.
    When I set in buildsetting, Mach-O type with dynamic library, I call UnitySendMessage method, in unity there is no respond of this UnitySendMessage() (the method in gameobject will call if message is sent).
    I linked libiPhone-lib.a to App project, becuase _UnitySendMessage undefied symbol error. And also other frameworks to fix build error. Do you have any idea why UnitySendMessage() is not received in unity?
    I can see unity scene (skybox) when "startUnity" button in application project. But UnitySendMessage is not answer.
    I followed this example link: https://medium.com/@IronEqual/how-to-embed-a-unity-game-into-an-ios-native-swift-app-772a0b65c82


    If I build framework with Mach-O type static library, then when I run app project, this error occured.
    EXC_BAD_ACCESS at UnityInitApplicationNoGraphics() method in UnityApplicationDelegate.mm

    https://forum.unity.com/threads/il2...-sometimes-when-the-game-starts.383145/page-2

    Thank you.