Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EXPERIMENTAL] support for .NET 4.6 runtime. #248

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KojiNakamaru
Copy link
Member

No description provided.

@LiamInJapan
Copy link

LiamInJapan commented Sep 20, 2017

Still very much struggling with this....

First of all I'm not sure I understand the intent of the patch? It seems to patch a bunch of project files and stuff? Here's my thought process:

~/Development/unity-webview$ curl -O https://github.com/gree/unity-webview/commit/36ad915db58459d6f52d815b5e219beb51a24a90.patch

~/Development/unity-webview$ git apply 36ad915db58459d6f52d815b5e219beb51a24a90.patch

(I get some warnings at this point... I'm wondering if this is some kind of Windows<>Mac file compatibility issues and if it is having any effect?)

36ad915db58459d6f52d815b5e219beb51a24a90.patch:5964: trailing whitespace.
  switchNetLibKey: 
36ad915db58459d6f52d815b5e219beb51a24a90.patch:5971: trailing whitespace.
  switchNSODependencies: 
36ad915db58459d6f52d815b5e219beb51a24a90.patch:5972: trailing whitespace.
  switchTitleNames_0: 
36ad915db58459d6f52d815b5e219beb51a24a90.patch:5973: trailing whitespace.
  switchTitleNames_1: 
36ad915db58459d6f52d815b5e219beb51a24a90.patch:5974: trailing whitespace.
  switchTitleNames_2: 
warning: squelched 34 whitespace errors
warning: 39 lines add whitespace errors.

Then I open the project that uses the webview in Unity (versions tried: 2017.1.1f1, 2017.1.0f3) and double click unity-webview/dist/unity-webview.unitypackage

This imports in the patched project into Unity without any complaint. However, if I then try and run the project, I get a hard crash in Unity with the following log output.... Seems strange though and unrelated to the WebView?

$ cat ~/Library/Logs/Unity/Editor.log

LICENSE SYSTEM [2017920 14:8:15] No start/stop license dates set

LICENSE SYSTEM [2017920 14:8:15] Next license update check is after 2017-09-21T03:18:37


 COMMAND LINE ARGUMENTS:
/Applications/UnityProperDeadNew/Unity.app/Contents/MacOS/Unity
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[CEF] undefined in file:///%2FUsers%2Fliam%2FLibrary%2FUnity%2FPackages%2Fnode_modules%2Funity-editor-home%2Fdist/assets/unity-editor-home.js at line 39
2017-09-20 14:08:16.220 Unity Helper[35066:2673440] XType: failed to connect - Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.fonts was invalidated." UserInfo={NSDebugDescription=The connection to service named com.apple.fonts was invalidated.}
2017-09-20 14:08:16.220 Unity Helper[35066:2673440] Font server protocol version mismatch (expected:5 got:0), falling back to local fonts
2017-09-20 14:08:16.220 Unity Helper[35066:2673440] XType: unable to make a connection to the font daemon!
2017-09-20 14:08:16.220 Unity Helper[35066:2673440] registering /System/Library/Fonts/*, /System/Library/Fonts/Base/*, and /Library/Fonts/* locally

Any thoughts or ideas much appreciated!

@KojiNakamaru
Copy link
Member Author

@LiamInJapan You don't need to patch the code by yourself. Instead,

cd unity-webview
git fetch --all
git checkout experimental/libmonobdwgc

then you can find correct binaries under dist/.

@LiamInJapan
Copy link

LiamInJapan commented Sep 20, 2017

I get the same behaviour (crashes on trying to play a scene with a webview) but different logs. Here's the part I think is relevant:

Registering platform support modules:
Platform assembly: /Applications/UnityProperDeadNew/Unity.app/Contents/Managed/Unity.SerializationLogic.dll (this message is harmless)
Platform assembly: /Applications/UnityProperDeadNew/Unity.app/Contents/MonoBleedingEdge/lib/mono/4.5/Boo.Lang.Compiler.dll (this message is harmless)
Platform assembly: /Applications/UnityProperDeadNew/Unity.app/Contents/MonoBleedingEdge/lib/mono/4.5/Boo.Lang.dll (this message is harmless)
Platform assembly: /Applications/UnityProperDeadNew/Unity.app/Contents/MonoBleedingEdge/lib/mono/4.5/Boo.Lang.Parser.dll (this message is harmless)
Platform assembly: /Applications/UnityProperDeadNew/Unity.app/Contents/MonoBleedingEdge/lib/mono/4.5/Accessibility.dll (this message is harmless)
Platform assembly: /Applications/UnityProperDeadNew/Unity.app/Contents/MonoBleedingEdge/lib/mono/4.5/Mono.WebBrowser.dll (this message is harmless)
Platform assembly: /Applications/UnityProperDeadNew/Unity.app/Contents/MonoBleedingEdge/lib/mono/4.5/Mono.Posix.dll (this message is harmless)
Registered platform support modules in: 0.0976969s.
Native extension for Android target not found
Native extension for iOS target not found
Native extension for OSXStandalone target not found
Load scene 'Temp/__Backupscenes/0.backup' time: 1.053992 ms 
Fallback handler could not load library /Applications/UnityProperDeadNew/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/WebView.bundle/Contents/MacOS/WebView
Fallback handler could not load library /Applications/UnityProperDeadNew/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/WebView.bundle/Contents/MacOS/WebView.dylib
Fallback handler could not load library /Applications/UnityProperDeadNew/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/WebView.bundle/Contents/MacOS/WebView.so
Fallback handler could not load library /Applications/UnityProperDeadNew/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/WebView.bundle/Contents/MacOS/WebView.bundle
Receiving unhandled NULL exception
Obtained 0 stack frames.
Launching bug reporter

It still seems odd to me that it's looking for WebView.dylib/so/bundle and so on inside of Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/

@KojiNakamaru
Copy link
Member Author

The issue might be caused by old Library. Could you please try to remove Library and launch Unity to recreate it? At least I can successfully run the sample app with the following steps:

git clone [email protected]:gree/unity-webview.git
cd unity-webview 
git checkout experimental/libmonobdwgc
cd sample
unzip ../dist/unity-webview.zip
# then launch Unity and open the sample.

image

@LiamInJapan
Copy link

LiamInJapan commented Sep 20, 2017

Still the same errors.

These are the exact steps I am taking to use this....

git clone [email protected]:gree/unity-webview.git
cd unity-webview 
git checkout experimental/libmonobdwgc

Open my project in Unity 2017.1.1f1
Double click on unity-webview/dist/unity-webview.unitypackage
Close Unity

cd myProject
rm -rf Library

Reopen Unity
Run scene with WebView
Crashes with same logs as above

Are you certain it's not a directory pointing issue? Or perhaps I'm missing a step in the install process? It seems very strange that it's looking for non-existent directories:

15:44:38 ✔ liam:/Applications/UnityProperDeadNew/Unity.app/Contents/Frameworks/Mono$ ls
total 0
drwxrwxr-x   3 root  admin  102 31 Aug 18:11 ./
drwxrwxr-x  21 root  admin  714 31 Aug 18:52 ../
drwxrwxr-x   3 root  admin  102 31 Aug 18:11 MonoEmbedRuntime/

(There is no /Mono/lib/libAssets/Plugins/WebView.bundle/ nor would I expect there to be... Not in Unity.app anyway... Unless I'm missing some kind of build/install step somewhere)

@KojiNakamaru
Copy link
Member Author

I don't know what the real issue is. Could you please try the sample app as I did? If we follow same steps, we should get the same result.

@LiamInJapan
Copy link

I get the same result as you with the sample app,

But when I try integrating with my project, it fails.

I am wondering if I am doing something wrong with how I am doing the install...

The other thing I am wondering is, I also can't build my MonoDevelop project now either, and I get 31 errors all similar to this:

/Applications/UnityProperDeadNew/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/Microsoft.Common.targets: Warning: TargetFrameworkVersion 'v4.6' not supported by this toolset (ToolsVersion: 4.0). (Assembly-CSharp-firstpass)

/Users/liam/Development/***/CSC: Error CS0518: The predefined type `System.Object' is not defined or imported (CS0518) (Assembly-CSharp-firstpass)

/Users/liam/Development/***/CSC: Error CS0518: The predefined type `System.Int32' is not defined or imported (CS0518) (Assembly-CSharp-firstpass)

And so on... I am wondering if the project can't compile, perhaps WebView files aren't being moved to the right place or something...

In any case, it feels like maybe there is some wrong mono version or something... But I get the same issues on two separate macs...

@KojiNakamaru
Copy link
Member Author

If there are some obsolete WebView-related files previously installed, it is better to remove them completely at first and confirm the app works without any issue. I guess the MonoDevelop.app issues you described may also occur even without WebView. Those issues won't occur if you don't import WebView files? NET4.6 support in Unity is still experimental, so it might be better to avoid it if possible...

@montag64
Copy link

montag64 commented Feb 7, 2018

@LiamInJapan I had the same exact issue as you mentioned in your last comment. I ended up ditching Monodevelop for Visual Studio for Mac (free) since this is going to happen in the next release or so. Problem resolved itself afterward.

https://blogs.unity3d.com/2018/01/05/discontinuing-support-for-monodevelop-unity-starting-in-unity-2018-1/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants