gree / unity-webview

zlib License
2.27k stars 687 forks source link

Can't load macOS plugin in Unity 2017.1 (libmono.0.dylib image not found) #219

Open atraver opened 7 years ago

atraver commented 7 years ago

I'm trying to upgrade from Unity 5.5.3p3 to 2017.1f03. The WebView plugin is not working in the Unity Editor when running on my macOS machine. I receive this error in the console:

Couldn't open /Users/adam/dev/game/Client/Assets/Plugins/WebView.bundle/Contents/MacOS/WebView, error: dlopen(/Users/adam/dev/game/Client/Assets/Plugins/WebView.bundle/Contents/MacOS/WebView, 2): Library not loaded: @executable_path/../Frameworks/MonoEmbedRuntime/osx/libmono.0.dylib
  Referenced from: /Users/adam/dev/game/Client/Assets/Plugins/WebView.bundle/Contents/MacOS/WebView
  Reason: image not found

One thing I've noticed is that Unity changed the location of the libmono.0.dylib file between 5.5 and 2017.1 (not sure about 5.6). Whereas before it was located in Unity.app/Contents/Frameworks/MonoEmbedRuntime/osx, it's now in Unity.app/Contents/Frameworks/Mono/MonoEmbedRuntime/osx, presumably to support the upgraded Mono engine work they're performing (there's also a MonoBleedingEdge directory as a sibling to the Mono directory).

I'm not sure if this is a Unity bug or something you can fix with your plugin but wanted to bring it up here. I'll also be filing a Unity bug just in case.

KojiNakamaru commented 7 years ago

At least their code works without any issue so it isn't a bug (perhaps, from their perspective). As you pointed out, however, libmono.0.dylib is placed differently, while it still contains an old linkage:

$ otool -L /Applications/Unity/Unity.app/Contents/Frameworks/Mono/MonoEmbedRuntime/osx/libmono.0.dylib 
/Applications/Unity/Unity.app/Contents/Frameworks/Mono/MonoEmbedRuntime/osx/libmono.0.dylib:
    @executable_path/../Frameworks/MonoEmbedRuntime/osx/libmono.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)

For now, the following whould be a simple coutermeasure:

$ cd /Applications/Unity/Unity.app/Contents/Frameworks/
$ ln -s Mono/MonoEmbedRuntime .

I'll add some note in README.md.

atraver commented 7 years ago

Thanks. I also got a note from Unity QA that they've reproduced the bug locally and have sent it to their development team.

atraver commented 7 years ago

Here's Unity's response:

We decided to close this issue as Won't fix.

We don't support third parties linking and depending on the layout of dynamic libraries in our Editor install. Additionally, even if we update our dynamic library to have correct path burned in, it will still not fix plugin as it exists since it's looking in the old location.

Is there a way the webview plugin can be built without depending on the libmono lib?

KojiNakamaru commented 7 years ago

I've found the solution: #223. Could you please try the latest.

montag64 commented 7 years ago

Is there a way to create this symbolic link automatically during the import process (run the terminal code on pkg import)? I have a feeling I'm going to forget to run the bash commands every time I update Unity.

It does work though.

KojiNakamaru commented 7 years ago

Have you tried the latest? With #223, you shouldn't need to make a symbolic link anymore.

LiamInJapan commented 7 years ago

I just installed latest (by deleting old files, and reinstalling with the unity package).

Now Unity hard crashes every time I load a scene with a webview.

Note: I get the same behaviour also when I use the symbolic link strategy

Unity Version: 2017.1.1f1 Mac Os X Version: 10.12.5

montag64 commented 7 years ago

Are you creating the symbolic link via terminal? can you trace out the symlink to make sure it's going to the right location?

I have the same version as you and OS X 10.12.6 and have had luck with the symlink fix

montag64 commented 7 years ago

compare

LiamInJapan commented 7 years ago

I've tried both the symlink, and also pulling latest from master and installing that. Both give me the same crash behaviour

screen shot 2017-09-19 at 15 24 50

LiamInJapan commented 7 years ago

Here are the last 20 or so lines of ~/Library/Logs/Unity/Editor.log

Native extension for iOS target not found Native extension for OSXStandalone target not found Load scene 'Temp/__Backupscenes/0.backup' time: 1.069750 ms Fallback handler could not load library /Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/WebView.bundle/Contents/MacOS/WebView Fallback handler could not load library /Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/WebView.bundle/Contents/MacOS/WebView.dylib Fallback handler could not load library /Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/WebView.bundle/Contents/MacOS/WebView.so Fallback handler could not load library /Applications/Unity/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

LiamInJapan commented 7 years ago

It would seem that the directory paths are still kind of broken?

$ pwd
/Applications/Unity/Unity.app/Contents/Frameworks/Mono
$ ls -alF
total 0
drwxrwxr-x   3 root  admin  102 Aug 31 18:11 ./
drwxrwxr-x  21 root  admin  714 Sep 19 15:46 ../
drwxrwxr-x   3 root  admin  102 Aug 31 18:11 MonoEmbedRuntime/

Which isn't where the above library loads point to it would seem...

Update: A reinstall of Unity makes the directory structure look a little more like the expected one in the logs, but it's still incorrect:

/Applications/Unity/Unity.app/Contents/Mono
$ cd lib/
$ pwd
/Applications/Unity/Unity.app/Contents/Mono/lib
$ ls -alF
total 31728
drwxrwxr-x  45 root  admin     1530 Jul 28 13:57 ./
drwxrwxr-x   5 root  admin      170 Aug 31 18:10 ../
-rwxrwxr-x   1 root  admin  1051464 Aug 31 18:01 libMonoPosixHelper.dylib*
-rwxrwxr-x   1 root  admin    32332 Aug 31 18:01 libMonoSupportW.dylib*
-rwxrwxr-x   1 root  admin    17628 Aug 31 18:01 libasprintf.0.dylib*
-rwxrwxr-x   1 root  admin   129872 Aug 31 18:01 libatk-1.0.0.dylib*
-rwxrwxr-x   1 root  admin   495004 Aug 31 18:01 libcairo.2.dylib*
-rwxrwxr-x   1 root  admin   146384 Aug 31 18:01 libexpat.1.5.2.dylib*
-rwxrwxr-x   1 root  admin   146384 Aug 31 18:01 libexpat.1.dylib*
-rwxrwxr-x   1 root  admin   210012 Aug 31 18:01 libfontconfig.1.dylib*
-rwxrwxr-x   1 root  admin    67372 Aug 31 18:01 libgailutil.18.dylib*
-rwxrwxr-x   1 root  admin  1297060 Aug 31 18:01 libgdiplus.dylib*
-rwxrwxr-x   1 root  admin   599420 Aug 31 18:01 libgdk-quartz-2.0.0.dylib*
-rwxrwxr-x   1 root  admin   126324 Aug 31 18:01 libgdk_pixbuf-2.0.0.dylib*
-rwxrwxr-x   1 root  admin   791276 Aug 31 18:01 libgettextlib-0.18.1.dylib*
-rwxrwxr-x   1 root  admin   291052 Aug 31 18:01 libgettextpo.0.dylib*
-rwxrwxr-x   1 root  admin   258760 Aug 31 18:01 libgettextsrc-0.18.1.dylib*
-rwxrwxr-x   1 root  admin    41076 Aug 31 18:01 libgif.4.1.6.dylib*
-rwxrwxr-x   1 root  admin   698344 Aug 31 18:01 libgio-2.0.0.dylib*
-rwxrwxr-x   1 root  admin   126672 Aug 31 18:01 libglade-2.0.0.0.7.dylib*
-rwxrwxr-x   1 root  admin   126672 Aug 31 18:01 libglade-2.0.0.dylib*
-rwxrwxr-x   1 root  admin  1011692 Aug 31 18:01 libglib-2.0.0.dylib*
-rwxrwxr-x   1 root  admin    31008 Aug 31 18:01 libgmodule-2.0.0.dylib*
-rwxrwxr-x   1 root  admin   289912 Aug 31 18:01 libgobject-2.0.0.dylib*
-rwxrwxr-x   1 root  admin    36856 Aug 31 18:01 libgthread-2.0.0.dylib*
-rwxrwxr-x   1 root  admin  4314544 Aug 31 18:01 libgtk-quartz-2.0.0.dylib*
-rwxrwxr-x   1 root  admin    73236 Aug 31 18:01 libigemacintegration.0.0.0.dylib*
-rwxrwxr-x   1 root  admin    48520 Aug 31 18:01 libikvm-native.dylib*
-rw-rw-r--   1 root  admin    56584 Aug 31 18:01 libintl.8.dylib
-rwxrwxr-x   1 root  admin   233660 Aug 31 18:01 libjpeg.8.dylib*
-rwxrwxr-x   1 root  admin    30828 Aug 31 18:01 libmono-profiler-aot.0.dylib*
-rwxrwxr-x   1 root  admin    30828 Aug 31 18:01 libmono-profiler-aot.dylib*
-rwxrwxr-x   1 root  admin    34972 Aug 31 18:01 libmono-profiler-cov.0.dylib*
-rwxrwxr-x   1 root  admin    34972 Aug 31 18:01 libmono-profiler-cov.dylib*
-rwxrwxr-x   1 root  admin   349460 Aug 31 18:01 libpango-1.0.0.dylib*
-rwxrwxr-x   1 root  admin   102856 Aug 31 18:01 libpangocairo-1.0.0.dylib*
-rwxrwxr-x   1 root  admin   388380 Aug 31 18:01 libpixman-1.0.dylib*
-rwxrwxr-x   1 root  admin   161276 Aug 31 18:01 libpng.3.dylib*
-rwxrwxr-x   1 root  admin   159368 Aug 31 18:01 libpng12.0.dylib*
-rwxrwxr-x   1 root  admin   477524 Aug 31 18:01 libsqlite3.0.dylib*
-rwxrwxr-x   1 root  admin   359144 Aug 31 18:01 libtiff.3.8.2.dylib*
-rwxrwxr-x   1 root  admin    26520 Aug 31 18:01 libtiffxx.3.8.2.dylib*
-rwxrwxr-x   1 root  admin  1263912 Aug 31 18:01 libxml2.2.6.30.dylib*
drwxrwxr-x   7 root  admin      238 Jul 28 13:57 mono/
-rwxrwxr-x   1 root  admin      303 Aug 31 18:01 patch_dylibs_to_be_relocatable*

Here's the weird thing though right... Why should it be looking for WebView, WebView.dylib and other non-standard Unity files inside Unity.app? Do I perhaps have some project setting or something somewhere that is resolving the directories to the wrong place? Or is there a compile step somewhere that I am missing that generates out the files missing above and puts them inside Unity.app?

LiamInJapan commented 7 years ago

More weirdness - when I build the project now, I get this:

Building Solution: ************* (Debug)

Building: Assembly-CSharp-firstpass (Debug)

Build started 9/19/2017 5:52:57 PM.
__________________________________________________
Project "/Users/***********/traveleresnoteunity/*************/Assembly-CSharp-firstpass.csproj" (Build target(s)):

    Target PrepareForBuild:
        Configuration: Debug Platform: AnyCPU

    Target GetFrameworkPaths:
/Applications/Unity/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).

    Target GetReferenceAssemblyPaths:
/Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/Microsoft.Common.targets:  warning : Unable to find framework corresponding to the target framework moniker '.NETFramework,Version=v4.6'. Framework assembly references will be resolved from the GAC, which might not be the intended behavior.

    Target ResolveAssemblyReferences:
/Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/Microsoft.Common.targets:  warning : Reference 'System.XML' not resolved
        For searchpath {CandidateAssemblyFiles}
        Warning: {CandidateAssemblyFiles} not supported currently
        For searchpath {HintPathFromItem}
        HintPath attribute not found
        For searchpath {TargetFrameworkDirectory}
        For searchpath {PkgConfig}
        Considered System.XML, but could not find in any pkg-config files.
        For searchpath {GAC}
        Considered System.XML, but could not find in the GAC.
        For searchpath {RawFileName}
        Considered '/Users/******_iMac4/traveleresnoteunity/*************/System.XML' as a file, but the file does not exist
        For searchpath Temp/bin/Debug/
        Considered '/Users/******_iMac4/traveleresnoteunity/*************/Temp/bin/Debug/System.XML' as a file, but the file does not exist
        Considered '/Users/******_iMac4/traveleresnoteunity/*************/Temp/bin/Debug/System.XML.exe' as a file, but the file does not exist
        Considered '/Users/******_iMac4/traveleresnoteunity/*************/Temp/bin/Debug/System.XML.dll' as a file, but the file does not exist

    Target GenerateSatelliteAssemblies:
    No input files were specified for target GenerateSatelliteAssemblies, skipping.

    Target GenerateTargetFrameworkMonikerAttribute:
    Skipping target "GenerateTargetFrameworkMonikerAttribute" because its outputs are up-to-date.

    Target CoreCompile:
        Tool /Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/mcs.exe execution started with arguments: /noconfig /debug:full /debug+ /optimize- /out:obj/Debug/Assembly-CSharp-firstpass.dll Assets/Plugins/UnityChannel/XiaomiSupport/AppStoreSettings.cs Assets/Plugins/UnityPurchasing/script/ComboBox.cs Assets/Plugins/UnityPurchasing/script/Demo/DemoInventory.cs Assets/Plugins/UnityPurchasing/script/IAPButton.cs Assets/Plugins/UnityPurchasing/script/IAPConfigurationHelper.cs Assets/Plugins/UnityPurchasing/script/IAPDemo.cs Assets/Plugins/UnityPurchasing/script/PurchasingCheck.cs Assets/Plugins/WebViewObject.cs /target:library /unsafe+ /define:"DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_1_1;UNITY_2017_1;UNITY_2017;PLATFORM_ARCH_64;UNITY_64;UNITY_PURCHASING;UNITY_ANALYTICS;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_VR;ENABLE_MODULAR_UNITYENGINE_ASSEMBLIES;ENABLE_CLUSTERINPUT;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE" /nowarn:0169 /langversion:6 /nostdlib /reference:/Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/Current/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll /reference:/Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/Current/lib/mono/gac/System.Runtime.Serialization/4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll /reference:/Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/Current/lib/mono/gac/System.Xml.Linq/4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll /reference:/Applications/Unity/Unity.app/Contents/Managed/UnityEngine.dll /reference:/Applications/Unity/Unity.app/Contents/Managed/UnityEditor.dll /reference:/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll /reference:/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll /reference:/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/TestRunner/UnityEngine.TestRunner.dll /reference:/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/TestRunner/net35/unity-custom/nunit.framework.dll /reference:/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Timeline/RuntimeEditor/UnityEngine.Timeline.dll /reference:/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll /reference:/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityHoloLens/RuntimeEditor/UnityEngine.HoloLens.dll /reference:/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityPurchasing/UnityEngine.Purchasing.dll /reference:/Users/******_iMac4/traveleresnoteunity/*************/Assets/Plugins/MsgPack.dll /reference:/Users/******_iMac4/traveleresnoteunity/*************/Assets/Plugins/UnityChannel/ChannelPurchase.dll /reference:/Users/******_iMac4/traveleresnoteunity/*************/Assets/Plugins/UnityChannel/UnityStore.dll /reference:/Users/******_iMac4/traveleresnoteunity/*************/Assets/Plugins/UnityPurchasing/Bin/Editor.dll /reference:/Users/******_iMac4/traveleresnoteunity/*************/Assets/Plugins/UnityPurchasing/Bin/Purchasing.Common.dll /reference:/Users/******_iMac4/traveleresnoteunity/*************/Assets/Plugins/UnityPurchasing/Bin/Stores.dll /reference:/Users/******_iMac4/traveleresnoteunity/*************/Assets/Plugins/UnityPurchasing/Bin/Apple/Apple.dll /reference:/Users/******_iMac4/traveleresnoteunity/*************/Assets/Plugins/UnityPurchasing/Bin/Facebook/FacebookStore.dll /reference:/Users/******_iMac4/traveleresnoteunity/*************/Assets/Plugins/UnityPurchasing/Bin/Security/live/Security.dll /reference:/Users/******_iMac4/traveleresnoteunity/*************/Assets/Plugins/UnityPurchasing/Bin/Tizen/Tizen.dll /reference:/Users/******_iMac4/traveleresnoteunity/*************/Assets/Plugins/UnityPurchasing/winrt/winrt.dll /reference:/Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/Current/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll /warn:4
CSC: error CS0518: The predefined type `System.Object' is not defined or imported
CSC: error CS0518: The predefined type `System.ValueType' is not defined or imported
CSC: error CS0518: The predefined type `System.Attribute' is not defined or imported
CSC: error CS0518: The predefined type `System.Int32' is not defined or imported
CSC: error CS0518: The predefined type `System.UInt32' is not defined or imported
CSC: error CS0518: The predefined type `System.Int64' is not defined or imported
CSC: error CS0518: The predefined type `System.UInt64' is not defined or imported
CSC: error CS0518: The predefined type `System.Single' is not defined or imported
CSC: error CS0518: The predefined type `System.Double' is not defined or imported
CSC: error CS0518: The predefined type `System.Char' is not defined or imported
CSC: error CS0518: The predefined type `System.Int16' is not defined or imported
CSC: error CS0518: The predefined type `System.Decimal' is not defined or imported
CSC: error CS0518: The predefined type `System.Boolean' is not defined or imported
CSC: error CS0518: The predefined type `System.SByte' is not defined or imported
CSC: error CS0518: The predefined type `System.Byte' is not defined or imported
CSC: error CS0518: The predefined type `System.UInt16' is not defined or imported
CSC: error CS0518: The predefined type `System.String' is not defined or imported
CSC: error CS0518: The predefined type `System.Enum' is not defined or imported
CSC: error CS0518: The predefined type `System.Delegate' is not defined or imported
CSC: error CS0518: The predefined type `System.MulticastDelegate' is not defined or imported
CSC: error CS0518: The predefined type `System.Void' is not defined or imported
CSC: error CS0518: The predefined type `System.Array' is not defined or imported
CSC: error CS0518: The predefined type `System.Type' is not defined or imported
CSC: error CS0518: The predefined type `System.Collections.IEnumerator' is not defined or imported
CSC: error CS0518: The predefined type `System.Collections.IEnumerable' is not defined or imported
CSC: error CS0518: The predefined type `System.IDisposable' is not defined or imported
CSC: error CS0518: The predefined type `System.IntPtr' is not defined or imported
CSC: error CS0518: The predefined type `System.UIntPtr' is not defined or imported
CSC: error CS0518: The predefined type `System.RuntimeFieldHandle' is not defined or imported
CSC: error CS0518: The predefined type `System.RuntimeTypeHandle' is not defined or imported
CSC: error CS0518: The predefined type `System.Exception' is not defined or imported
    Task "Csc" execution -- FAILED
    Done building target "CoreCompile" in project "/Users/******_iMac4/traveleresnoteunity/*************/Assembly-CSharp-firstpass.csproj".-- FAILED

Done building project "/Users/******_iMac4/traveleresnoteunity/*************/Assembly-CSharp-firstpass.csproj".-- FAILED

Build FAILED.

Warnings:

/Users/******_iMac4/traveleresnoteunity/*************/Assembly-CSharp-firstpass.csproj (Build) ->
/Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/Microsoft.Common.targets (GetFrameworkPaths target) ->

    /Applications/Unity/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).

/Users/******_iMac4/traveleresnoteunity/*************/Assembly-CSharp-firstpass.csproj (Build) ->
/Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/Microsoft.Common.targets (GetReferenceAssemblyPaths target) ->

    /Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/Microsoft.Common.targets:  warning : Unable to find framework corresponding to the target framework moniker '.NETFramework,Version=v4.6'. Framework assembly references will be resolved from the GAC, which might not be the intended behavior.

/Users/******_iMac4/traveleresnoteunity/*************/Assembly-CSharp-firstpass.csproj (Build) ->
/Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/Microsoft.Common.targets (ResolveAssemblyReferences target) ->

    /Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/Microsoft.Common.targets:  warning : Reference 'System.XML' not resolved

Errors:

/Users/******_iMac4/traveleresnoteunity/*************/Assembly-CSharp-firstpass.csproj (Build) ->
/Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/Microsoft.CSharp.targets (CoreCompile target) ->

    CSC: error CS0518: The predefined type `System.Object' is not defined or imported
    CSC: error CS0518: The predefined type `System.ValueType' is not defined or imported
    CSC: error CS0518: The predefined type `System.Attribute' is not defined or imported
    CSC: error CS0518: The predefined type `System.Int32' is not defined or imported
    CSC: error CS0518: The predefined type `System.UInt32' is not defined or imported
    CSC: error CS0518: The predefined type `System.Int64' is not defined or imported
    CSC: error CS0518: The predefined type `System.UInt64' is not defined or imported
    CSC: error CS0518: The predefined type `System.Single' is not defined or imported
    CSC: error CS0518: The predefined type `System.Double' is not defined or imported
    CSC: error CS0518: The predefined type `System.Char' is not defined or imported
    CSC: error CS0518: The predefined type `System.Int16' is not defined or imported
    CSC: error CS0518: The predefined type `System.Decimal' is not defined or imported
    CSC: error CS0518: The predefined type `System.Boolean' is not defined or imported
    CSC: error CS0518: The predefined type `System.SByte' is not defined or imported
    CSC: error CS0518: The predefined type `System.Byte' is not defined or imported
    CSC: error CS0518: The predefined type `System.UInt16' is not defined or imported
    CSC: error CS0518: The predefined type `System.String' is not defined or imported
    CSC: error CS0518: The predefined type `System.Enum' is not defined or imported
    CSC: error CS0518: The predefined type `System.Delegate' is not defined or imported
    CSC: error CS0518: The predefined type `System.MulticastDelegate' is not defined or imported
    CSC: error CS0518: The predefined type `System.Void' is not defined or imported
    CSC: error CS0518: The predefined type `System.Array' is not defined or imported
    CSC: error CS0518: The predefined type `System.Type' is not defined or imported
    CSC: error CS0518: The predefined type `System.Collections.IEnumerator' is not defined or imported
    CSC: error CS0518: The predefined type `System.Collections.IEnumerable' is not defined or imported
    CSC: error CS0518: The predefined type `System.IDisposable' is not defined or imported
    CSC: error CS0518: The predefined type `System.IntPtr' is not defined or imported
    CSC: error CS0518: The predefined type `System.UIntPtr' is not defined or imported
    CSC: error CS0518: The predefined type `System.RuntimeFieldHandle' is not defined or imported
    CSC: error CS0518: The predefined type `System.RuntimeTypeHandle' is not defined or imported
    CSC: error CS0518: The predefined type `System.Exception' is not defined or imported

     3 Warning(s)
     31 Error(s)

---------------------- Done ----------------------

Build: 31 errors, 3 warnings

So I don't know... I was using an old computer with an oooold version of Unity installed... And I updated it today to the newest version of Unity. But it feels like the installer isn't picking up on Mono pre-requisites or something? I'm not really sure, but now the whole project is unbuildable :/

LiamInJapan commented 7 years ago

It turns out if I go back to the editor and change the Player settings and turn Scripting Runtime Version to 3.5 from 4.6 this solves these problems. BUT it causes me problems in other ways (specifically with AesCryptoServiceProvider())...

KojiNakamaru commented 7 years ago

I've put an experimental support for 4.6: https://github.com/gree/unity-webview/pull/248 . It cannot be merged to the master for now but enables to run with the 4.6 runtime.

LiamInJapan commented 7 years ago

ありがとうございます! I'll try it shortly

LiamInJapan commented 7 years ago

Ok I spent all day trying to get the 4.6 patch working with no success..

I have rolled back to master, and .NET 3.5 but the webview is still crashing... (The metal->OpenGL commit has been applied as have the symbolic link ones)

I get no real clues in the log, just a hard OS crash every time it loads up. I've attached the OS generated crash report in case it gives any clues, but I'm really running out of leads to try with this... WebViewCrashReport.txt

Here are the steps I am taking to get to this point:

cd project/Assets/Plugins
rm WebView.bundle/ WebView.bundle.meta WebViewObject.cs...... And all the others
Close Unity
cd ../../..     (out of project)
git clone https://github.com/gree/unity-webview.git
cd unity-webview/dist

unzip the zip
drag the files over to the Assets directory
Delete the Library folder
Open Unity
Preferences->GI Cache->Clear cache (just in case...)
Run the project
Project hard crashes

Any help would be really appreciated, we've lost a couple of days with these issues... Thank you in advance!

KojiNakamaru commented 7 years ago
unzip the zip
drag the files over to the Assets directory

This part may delete unrelated files under Assets. As noted in https://github.com/gree/unity-webview/pull/248#issuecomment-330754401, the following steps are better:

cd your-project-folder
unzip /foo/bar/unity-webivew/dist/unity-webview.zip

In your WebViewCrashReport.txt, the crash occurs when UnitySendCallMessage() is called:

6   libsystem_platform.dylib        0x00007fffc1c76b3a _sigtramp + 26
7   ???                             000000000000000000 0 + 0
8   libmono.0.dylib                 0x000000015e666e17 mono_domain_get + 19
9   net.gree.unitywebview.WebView   0x00000001268890e8 UnitySendMessage(char const*, char const*, char const*) + 134

in which any of arguments for UnitySendMessage() seems null. Was the game object with WebViewObject correctly initialized? As you might confirm, the sample app in the master branch works without any crash so there should be some differences causing the issue. If you can send me a minimum project that reproduces the issue, I'll investigate it.

LiamInJapan commented 7 years ago

There's a few bits for me to chase up here, thanks for the help

LiamInJapan commented 7 years ago

You were correct, there was a couple of application level bugs at this point that were causing this crash. Thanks so much for your support @KojiNakamaru

KojiNakamaru commented 7 years ago

That's good!