Page 1 of 1
Unity Windows Phone 8 Build Error in Smartfox
Posted: 12 Nov 2014, 08:34
by Eser Telekom
Unity v. : 4.5.5f1
Smartfox client v. :1.5.3.0
When i try to build for Windows Phone 8 in Unity, Error is occured. This problem smartfox v1.4.0 'in there
**Error building Player: Exception: Error: type `System.Timers.Timer` doesn't exist in target framework. It is referenced from SmartFox2X.dll at Sfs2X.SmartFox.**
Is it bug or What is my fault?
Re: Unity Windows Phone 8 Build Error in Smartfox
Posted: 12 Nov 2014, 15:36
by Bax
Please read the Unity paragraph on this page:
http://docs2x.smartfoxserver.com/Gettin ... harp#unity
Also read the text on this page:
http://docs.unity3d.com/Manual/wp8-plugins.html
Let us know if something is not clear.
Re: Unity Windows Phone 8 Build Error in Smartfox
Posted: 12 Nov 2014, 15:46
by Eser Telekom
Unity v : 4.5.5f1
Smartfox Unity v.: 1.5.3.0
Smartfox Windows Phone (native) v : 1.5.3.0
Getting this error now :
Error building Player: Exception: Error: type `Windows.UI.Xaml.DispatcherTimer` doesn't exist in target framework. It is referenced from SmartFox2X.dll at Sfs2X.SmartFox.
I checked this :
http://forum.unity3d.com/threads/build- ... -5.250889/
Re: Unity Windows Phone 8 Build Error in Smartfox
Posted: 13 Nov 2014, 09:29
by Bax
We could confirm the error you reported and fixed it.
Please download version 1.5.4 of the C# API at this url:
http://www.smartfoxserver.com/download/sfs2x#p=client
Re: Unity Windows Phone 8 Build Error in Smartfox
Posted: 13 Nov 2014, 10:00
by Eser Telekom
I confirm that it is fixed.
Thank you.
Re: Unity Windows Phone 8 Build Error in Smartfox
Posted: 13 Nov 2014, 13:45
by ShawnHuss
thanks,
i downloaded the version 1.5.4 of the C# API and fixed the same error too.
But when i add the code to a empty project a new error is appered.
my code is:
Code: Select all
private SmartFox smartFox;
void Awake(){
smartFox = new SmartFox (true);
}
the error is:
Code: Select all
Internal compiler error. See the console log for more information. output was:
Unhandled Exception: System.TypeLoadException: Could not load type 'Sfs2X.SmartFox' from assembly 'SmartFox2X, Version=1.5.4.0, Culture=neutral, PublicKeyToken=null'.
at (wrapper managed-to-native) System.MonoType:GetMethodsByName (string,System.Reflection.BindingFlags,bool,System.Type)
at System.MonoType.GetMethods (BindingFlags bindingAttr) [0x00000] in <filename unknown>:0
at Mono.CSharp.MemberCache.AddMethods (BindingFlags bf, System.Type type) [0x00000] in <filename unknown>:0
at Mono.CSharp.MemberCache.AddMethods (System.Type type) [0x00000] in <filename unknown>:0
at Mono.CSharp.MemberCache..ctor (IMemberContainer container) [0x00000] in <filename unknown>:0
i upload the project.
please help me found the mistake,thank you very much.
Re: Unity Windows Phone 8 Build Error in Smartfox
Posted: 13 Nov 2014, 13:58
by Eser Telekom
Please read the Unity paragraph on this page:
http://docs2x.smartfoxserver.com/Gettin ... harp#unity
Also read the text on this page:
http://docs.unity3d.com/Manual/wp8-plugins.html
You have to put "Smartfox Windows Phone
Native Plugin to Assets/Plugins/WP8 folder inside -> this is real dll
You also put Smartfox Unity Plugin to Unity Project folder (inside Assets folder , I recommend Assets/Plugin folders.) -> This fake dl.
Finally your project must have 2 smartfox.dll , one is real, other is fake
Re: Unity Windows Phone 8 Build Error in Smartfox
Posted: 13 Nov 2014, 15:21
by Bax
I'm not sure what is going on in your project. Actually I can't even run it in
Visual Studio Express 2012 for Windows Phone, as it can't locate the dependancies.
Anyway I did a similar test: i created a new project in Unity, added the two SmartFox2X.dll libraries and attached the following script to the main scene:
Code: Select all
using UnityEngine;
using System.Collections;
using Sfs2X;
public class MainScript : MonoBehaviour {
// Use this for initialization
void Start () {
var smartFox = new SmartFox (true);
Debug.Log ("This is the SmartFox instance: " + smartFox.ToString ());
}
// Update is called once per frame
void Update () {
}
}
The code runs fine in Unity and I can build for Windows Phone 8. I can also open the resulting project in Visual Studio and run it in the Windows Phone emulator without issues. I can send you my test project if you like, just send an email to the website's
info mailbox requesting it.
Re: Unity Windows Phone 8 Build Error in Smartfox
Posted: 07 Feb 2015, 12:03
by ShawnHuss
i am so sorry for reply too late.i fix it by this way:
put the SmartFox2X.dll for wp8 to the "Plugin/WP8" folder of Unity.
put the SmartFox2X.dll for Unity to the "Plugin" folder of Unity.
then all is ok.
thans Bax, thanks Eser Telekom.