khangnhfuky / hotween

Automatically exported from code.google.com/p/hotween
0 stars 0 forks source link

Fail when running on Windows Store App #79

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Simply adding a Tween and do something.
Compile project with Hotween micro.
The project builds without issues.

Deploy the project in Visual Studio.

Run the project. When Tween is referenced an error is reported:

This is shown in the Results of Visual Studio.
Primera excepción del tipo 'System.MissingMethodException' en HOTween.DLL
Primera excepción en 0x76D91D4D en Template.exe: excepción de Microsoft C++: 
EEMessageException en la ubicación de memoria 0x066EE340.
Primera excepción en 0x76D91D4D en Template.exe: excepción de Microsoft C++: 
[rethrow] en la ubicación de memoria 0x00000000.

In developers console in the own game this is reported:

Holoville.HOTween.TweenParms.InitializeObject(Tweener p_tweenObj, Object 
p_target)
at Holoville.HOTween.Tweener..ctor(Object p_target, Single p_duration, 
TweenParms p_parms)
at Holoville.HOTween.Tweener.To(Object p_target, Single p_duration, TweenParms 
p_parms)
 at UnityEngine.Internal.$MethodUtility.$invoke42(int64 instance, Int64* args)
at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64* 
args, InPtr method)

MissingMethodException: Method not found '?'.

I have to hand write the error, so if there is some typo, sorry, but focus on 
the main issue.

Thank you very much.

I'm building in Visual Studio 2013 Update 2, with last updates.

Original issue reported on code.google.com by nospam...@gmail.com on 22 Jul 2014 at 3:31

GoogleCodeExporter commented 9 years ago
I'm starting to hate Windows Store: throwing exceptions is bad, but a "?" for a 
"Method not found" is horrible.

The only things that could cause a "Method not found" exception in 
InitializeObject are GetProperty and GetField, which were causing the previous 
issue 75 which was solved by the latest Unity patch. So apparently not 
everything was solved. Are you using also the patches indicated here? 
http://docs.unity3d.com/Manual/windowsstore-gettingstarted.html

Original comment by daniele....@gmail.com on 22 Jul 2014 at 4:32

GoogleCodeExporter commented 9 years ago
Yes, totally agree with you. It is a nightmare. Even the WACK process is 
PASSED, but the part of the game we've got affected with tweens got some 
problem. As I told you in the #75 we just released our game Minimonsters Crush 
( don't want to do SPAM ) but as I remembered I told you we were in the 
submission phase and it was the truth :) You can get it in the Google Play 
Store, and Windows Phone by the way. It is still in review in iOS and MacOSX. 
Our code is exactly the same for all of them. Maybe some minor differences 
between mobile and desktop version in NGUI plugin, but the rest is the same. We 
built Windows Phone release with HOTween micro as suggested, and everything 
went ok. So we guess there is some issue that doesn't fail this time in Unity 
Editor, or building the project in Unity. No errors in that phase. No errors in 
Visual Studio 2013 Update 2 compilation.
Just when running.

Thanks.

Original comment by nospam...@gmail.com on 22 Jul 2014 at 4:47

GoogleCodeExporter commented 9 years ago
That game looks very nice, my complimentes :)

I'm gonna reopen that issue with Unity, since I believe it must definitely be 
tied to GetField and GetProperty being still broken. Before doing that, a 
couple questions:

- do you have an idea of what you're tweening there? A float? A Vector3? 
Something else?
- I can't build for Windows Store directly, so I don't know how the runtime log 
works: does that log happen as soon as the first tween plays? Are there no 
other log files hidden around?
- can you confirm about those patches I linked in #1?

Original comment by daniele....@gmail.com on 22 Jul 2014 at 5:01

GoogleCodeExporter commented 9 years ago
I think in my case Windows 8.1 N does not apply. We're using Windows 8.1 
Professional. Our machine was able to built the same code but targeted for 
Windows Phone, with the same HOTween micro library. I think this is something 
completely depending on a relationship between Unity and WinRT.

In our case it happens just in the moment we run the first line of Tween code. 
Here is:

    void SetHealthPoint(float point){
        if (point<0f) endGame=true;
        if (point>1f) point = 1f;
        TweenParms parms = new TweenParms().Prop("sliderValue", point).Ease(EaseType.EaseOutQuart);
        HOTween.To(hpBar, 0.1f, parms );
        healthPoint = point;
    }

As soon as gameplay begins, and you receive the first hit we update the health 
points of the minimonster and as a result we decrease the health points Bar. It 
is an sprite object.

Original comment by nospam...@gmail.com on 22 Jul 2014 at 5:08

GoogleCodeExporter commented 9 years ago
Mhmm then I'm afraid it's 100% that GetField/Property bug. I'm opening a new 
bug report with Unity immediately, and I hope they will solve it soon.

In the meantime I'm thinking of a possible "quick" solution, but since it's 
that broken Reflection issue again, I can't do nothing. Still... how many 
tweens do you have? I've completed HOTween v2 and am testing and optimizing it 
more, but if you want to try, I could give you access to it so you could 
implement that instead. It uses no Reflection at all (so those 
GetField/Property issues would be moot), but the API is somehow different, so 
you'd have to rewrite some of your code. Plus obviously it's still alpha. So:
Cons:
- alpha
- will need to rewrite some code
- not yet tested on any platform other than Windows (though in theory it should 
work everywhere, without different Micro versions)
- path plugin not yet implemented, so if you're using it somewhere it's a no-go
Pro:
- much much more efficient and faster
- no more Windows Store issues (in theory, but you would need to make a test - 
if you want I can prepare a quick package for you to try)

Let me know

Original comment by daniele....@gmail.com on 22 Jul 2014 at 6:33

GoogleCodeExporter commented 9 years ago
Another thing: I want to push the Unity guys on this, so I would need a hand to 
create a sample project and verify it, since I don't have direct access to 
Windows Store testing.
Can you:
1. create a sample barebone project, without HOTween, that just uses Reflection 
and calls the GetField and GetProperty methods at Start? 
2. build it and verify that you're still getting that error
3. either directly send that project via the Unity Bug Reporter, or attach it 
here so I can send it myself?

Original comment by daniele....@gmail.com on 22 Jul 2014 at 6:54

GoogleCodeExporter commented 9 years ago
Ok. Well I use it for 3 things basically. All of them, movement. Not Path. Just 
controlled move. Swap tiles. And nothing else than that.

I think NGUI is using Reflection so I can create a project using Reflection. 
But I'm aware that NGUI developer guy uses a class that converts the 
GetProperty and GetField calls. I think in that way he protects of this kind of 
crashes.

Original comment by nospam...@gmail.com on 22 Jul 2014 at 6:58

GoogleCodeExporter commented 9 years ago
I'm thinking I'm only using two tweens programmed. The others have been 
generated by the editor.

Original comment by nospam...@gmail.com on 22 Jul 2014 at 7:03

GoogleCodeExporter commented 9 years ago
Ouch, ok than if you're using the Editor it's another no-go: HOTween v2 has no 
editor yet.

About NGUI, it probably uses conditional compilation to switch GetField to 
GetRuntimeField in case of Windows Store, but that's a thing I can't do because 
I'm using a DLL instead than lose scripts (so I need to use regular NET 3.5 and 
not the "mixup" version that Unity implements).

Let me create the project I was talking about and attach it, so you can test it 
out and verify the error. I'll finish a piece of code I'm working on and 
prepare it within one hour

Original comment by daniele....@gmail.com on 22 Jul 2014 at 7:09

GoogleCodeExporter commented 9 years ago
Great Daniel, thanks for this effort. This windows store release is the
last we habe to send to the store. We,re two days delayed but it is quite
important to send it before friday. I go on holidays then and all reviews
of the game should be ready with links to all platforms. Thank you very
much.

El martes, 22 de julio de 2014, <hotween@googlecode.com> escribió:

Original comment by nospam...@gmail.com on 22 Jul 2014 at 7:12

GoogleCodeExporter commented 9 years ago
Great Daniel, thanks for this effort. This windows store release is the last we 
habe to send to the store. We,re two days delayed but it is quite important to 
send it before friday. I go on holidays then and all reviews of the game should 
be ready with links to all platforms. Thank you very much.

Original comment by nospam...@gmail.com on 22 Jul 2014 at 7:14

GoogleCodeExporter commented 9 years ago
Here is the test package attached. Just set the Test scene to build, and when 
built for Windows Store it should generate that error as soon as it's played. 
Let me know.

Original comment by daniele....@gmail.com on 22 Jul 2014 at 7:21

Attachments:

GoogleCodeExporter commented 9 years ago
Well I can run in the Editor and I get this:

FieldInfo: System.Single someFloat - PropertyInfo: UnityEngine.Vector3 position
UnityEngine.Debug:Log(Object)
TestScript:Start() (at Assets/TestScript.cs:14)

If I try to build it for Windows Store it says:

Assets\TestScript.cs(11,36): error CS1061: 'System.Type' does not contain a 
definition for 'GetField' and no extension method 'GetField' accepting a first 
argument of type 'System.Type' could be found (are you missing a using 
directive or an assembly reference?)

Assets\TestScript.cs(12,49): error CS1061: 'System.Type' does not contain a 
definition for 'GetProperty' and no extension method 'GetProperty' accepting a 
first argument of type 'System.Type' could be found (are you missing a using 
directive or an assembly reference?)

If I try to build it for Windows Phone 8 it works without any issue.

Best regards.

Original comment by nospam...@gmail.com on 22 Jul 2014 at 7:33

GoogleCodeExporter commented 9 years ago
Forgot to tell you I tried to build it using Unity 4.5.2p1. It means the last 
patch Unity published to fix this :)

Original comment by nospam...@gmail.com on 22 Jul 2014 at 7:34

GoogleCodeExporter commented 9 years ago
Woah. When Graham said that portable class libraries could use GetField now, I 
assumed it meant that also lose scripts could do that. Instead apparently 
making a DLL has some advantages (except for the fact that gameplay is broken, 
ugh). Gonna submit the bug report immediately.

Original comment by daniele....@gmail.com on 22 Jul 2014 at 9:20

GoogleCodeExporter commented 9 years ago
Thank you.

Original comment by nospam...@gmail.com on 22 Jul 2014 at 10:02

GoogleCodeExporter commented 9 years ago
Hi Daniele, any news from Unity guys? It will be a new patch next days?

Original comment by nospam...@gmail.com on 23 Jul 2014 at 4:05

GoogleCodeExporter commented 9 years ago
No news yet. I would recommend you too to write support to push them (tell them 
about the bug again and that it's already been reported as bug n. 621496)

Original comment by daniele....@gmail.com on 23 Jul 2014 at 4:13

GoogleCodeExporter commented 9 years ago
Hey, I still got no news from Unity, but Paul from issue #75 made me noticec 
that everything works with Unity 4.5.1, just in case you want to revert to that 
version while waiting for a fix

Original comment by daniele....@gmail.com on 30 Jul 2014 at 8:13

GoogleCodeExporter commented 9 years ago
I tried to rebuild our game using 4.5.2p3, but still fails.

Original comment by nospam...@gmail.com on 5 Aug 2014 at 9:35

GoogleCodeExporter commented 9 years ago
I just wrote them again. Did you write them too? Can you link your bug report 
eventually so I can post that too?

Original comment by daniele....@gmail.com on 5 Aug 2014 at 10:17

GoogleCodeExporter commented 9 years ago
Hey I attached a new test project on issue #75. Can you test it too and confirm 
me you're getting the same exception as this issue (it's similar to the test I 
attached previously, but uses a DLL instead than lose scripts)

Original comment by daniele....@gmail.com on 5 Aug 2014 at 4:46

GoogleCodeExporter commented 9 years ago
Sorry I'm in vacation, and I'm not always connected. I'm out of the office
and I can not do the test. I will be back on August, 15th.

2014-08-05 17:46 GMT+01:00 <hotween@googlecode.com>:

Original comment by nospam...@gmail.com on 7 Aug 2014 at 8:47

GoogleCodeExporter commented 9 years ago
Sure. Let me know when you do, and have a nice vacation.

Original comment by daniele....@gmail.com on 8 Aug 2014 at 7:03

GoogleCodeExporter commented 9 years ago
Can not make it work with 4.5.3p1

Damm. This issue is not going to be fixed never by Unity? I don't understand 
what's happening here. Any idea?

Thank you.

Original comment by nospam...@gmail.com on 15 Aug 2014 at 5:27

GoogleCodeExporter commented 9 years ago
Don't know what to do. Our submission to the store is stop by this issue. Is 
there any workaround. Only fails on runtime.

I attach an image.

Original comment by nospam...@gmail.com on 15 Aug 2014 at 5:34

Attachments:

GoogleCodeExporter commented 9 years ago
Open an issue in the Unity forum. Try to complete the info from your side 
Daniel.
http://forum.unity3d.com/threads/issue-still-fails-since-4-5-2.262643/

Thank you.

Original comment by nospam...@gmail.com on 16 Aug 2014 at 10:23

GoogleCodeExporter commented 9 years ago
I just saw Tautvydas replied you with a possible solution, and the promise the 
issue will be fixed in the next patch. That is finally good news.

Original comment by daniele....@gmail.com on 16 Aug 2014 at 2:40

GoogleCodeExporter commented 9 years ago
Workaround suggested by Unity guys works!!!.
Great :)

Original comment by nospam...@gmail.com on 16 Aug 2014 at 3:36

GoogleCodeExporter commented 9 years ago
Finally!!! Kudos to Tautvydas then :) And this also means the next patch will 
truly fix the issue.

Original comment by daniele....@gmail.com on 16 Aug 2014 at 5:48