swift-unity
swift-unity copied to clipboard
Unity 2018 il2cpp issues
Hi, I am trying this with Unity 2018.3/ XCode 10.1 and I am getting a lots of errors similar to this one: https://github.com/jiulongw/swift-unity/issues/31
For example: No member named 'ParseAssemblyName' in 'il2cpp::icalls::mscorlib::System::Reflection::AssemblyName' No member named 'UnsafeGetValue' in 'il2cpp::icalls::mscorlib::System::Reflection::FieldInfo' No member named 'PropertyInfo' in namespace 'il2cpp::icalls::mscorlib::System::Reflection'; did you mean simply 'PropertyInfo'? etc...
I also needed to fix some include paths like #include "Classes/Unity/UnitySharedDecls.h" to #include "../Classes/Unity/UnitySharedDecls.h" according to your folder structure.
When building project in Unity, I use scripting runtime version .NET 4.* Equivalent, since 3.5 is deprecated.
Am I doing something wrong?
You can try: https://github.com/jiulongw/swift-unity/pull/120
Hi, did you find a solution? I stuck in the same place...
@Arkania9 Did you try this? https://github.com/jiulongw/swift-unity/issues/119#issuecomment-456306381
@jenthone thank you so much, it worked! Cheers
I remove the file as suggested in #120 But still get the same error (clean and restart Xcode) I am using Unity 2018.3.4
Any idea @jenthone @Arkania9 ?
Hi, did you remove files or only reference from the project? In my case removing references was enough.
Ok thanks first only reference then deleted the files =/
Where are the files?
Build Error :No member named 'Contexts' in namespace 'il2cpp::icalls::mscorlib::System::Runtime::Remoting' on Xcode 10.2 and Unity 2018.3.121.
I have fixed this issue by appending "-DNET_4_0" to the OTHER_CFLAGS in Unity.xcconfing file.
see this for more info : https://github.com/jiulongw/swift-unity/issues/31
I also needed to go through this process so I put all required steps you guys mentioned together. Thanks a bunch for solving these issues. Hope it helps :).
Using Unity 2019.1.7f1 and build with Xcode 10.3
Note: Do a Clean Build Folder and in Xcode if you want to Rebuilding!!!
---- Step 1 ----
When error: _Undefined symbol: OBJC_CLASS$AVPlayerViewController
Xcode <Your Project File> → Target/<Your Target>/General/Linked Frameworks and Libraries → add AVKit.framework
---- Step 2 ----
When error: 'Classes/iPhone_Sensors.h' file not found
→ in DynamicLibEngineAPI.mm
change:
#include Classes/iPhone_Sensors.h
to:
#include iPhone_Sensors.h
---- Step 3 ----
→ in Unity.xcconfig
Appending -DNET_4_0 to the OTHER_CFLAGS in Unity.xcconfig file (also mentioned in a comment in this file).
source: https://github.com/jiulongw/swift-unity/issues/119#issuecomment-504901522
---- Step 4 ----
Please delete reference of: DynamicLibEngineAPI-functions.h && DynamicLibEngineAPI.mm from xcode projectif this error occur (can be about 100 errors):Undefined symbols for architecture arm64:"_SetUnityiOS81orNewerBody", referenced from:_SetAllUnityFunctionsForDynamicPlayerLib in DynamicLibEngineAPI.o"_SetUnityiOS82orNewerBody", referenced from:_SetAllUnityFunctionsForDynamicPlayerLib in DynamicLibEngineAPI.o
source: https://github.com/jiulongw/swift-unity/pull/120#issuecomment-456315250
→ search in Xcode project for:
#include DynamicLibEngineAPI-functions.h
and comment out or delete all #include directives that reference this file.
most calls are → in DynamicLibEngineAPI.mm
---- Step 5 ----
Clean Build Folder, Build Project
→ Error free :)
---- Step 6 ----
If you are using Vuforia (8.3.8 or similar) and having VuforiaWrapper not found error then add "$(PRODUCT_NAME)/Unity/Libraries/com.ptc.vuforia.engine/Vuforia/Plugins/iOS" to the LIBRARY_SEARCH_PATHS in Unity.xcconfig file
@RichardAchilles for step 2, you can achieve the same by adding a build phase before Unity Rsync to avoid editing:
sed -i '' 's+Classes/iPhone_Sensors.h+iPhone_Sensors.h+g' "$UNITY_IOS_EXPORT_PATH"/Classes/DynamicLibEngineAPI.mm