xamarin / urho

Code to integrate with the Urho3D engine
Other
463 stars 122 forks source link

UrhoSharp on Xamarin.Forms 1.1.120 - need better error checking #141

Open MichalPetryk opened 8 years ago

MichalPetryk commented 8 years ago

I just updated "FormsSample"project to latest stable version of Urho.Forms (1.1.120). Application crashes when i back to StartPage from UrhoPage and again click "Launch sample" to PushAsync UrhoPage.

Here is stacktrace for reference:

Stacktrace: 08-03 11:06:17.137 E/mono-rt ( 6453): 08-03 11:06:17.137 E/mono-rt ( 6453): 08-03 11:06:17.137 E/mono-rt ( 6453): Attempting native Android stacktrace: 08-03 11:06:17.137 E/mono-rt ( 6453): Thread started: #8 08-03 11:06:17.148 D/UrhoSharp( 6453): ProxyStop 08-03 11:06:17.150 D/Mono ( 6453): DllImport searching in: 'mono-urho' ('/storage/emulated/0/Android/data/FormsSample.Droid/files/.__override__/libmono-urho.so'). 08-03 11:06:17.150 D/Mono ( 6453): Searching for 'urho_unsubscribe'. 08-03 11:06:17.150 D/Mono ( 6453): Probing 'urho_unsubscribe'. 08-03 11:06:17.150 D/Mono ( 6453): Found as 'urho_unsubscribe'. 08-03 11:06:17.152 D/UrhoSharp( 6453): ProxyStop: Runtime.Cleanup 08-03 11:06:17.175 E/mono-rt ( 6453): at ???+50312 [0x6689c488] 08-03 11:06:17.175 E/mono-rt ( 6453): at glDrawElements+712 [0x6689f254] 08-03 11:06:17.175 E/mono-rt ( 6453): at ???+52531 [0x40ee0d33] 08-03 11:06:17.175 E/mono-rt ( 6453): at ???+52557 [0x40ee0d4d] 08-03 11:06:17.175 E/mono-rt ( 6453): at ???+52765 [0x40ee0e1d] 08-03 11:06:17.175 E/mono-rt ( 6453): at ???+110453 [0x40eeef75] 08-03 11:06:17.175 E/mono-rt ( 6453): at ???+71747 [0x40ee5843] 08-03 11:06:17.175 E/mono-rt ( 6453): at ???+115963 [0x40ef04fb] 08-03 11:06:17.175 E/mono-rt ( 6453): at ???+71633 [0x40ee57d1] 08-03 11:06:17.175 E/mono-rt ( 6453): at ???+115963 [0x40ef04fb] 08-03 11:06:17.175 E/mono-rt ( 6453): at ???+71633 [0x40ee57d1] 08-03 11:06:17.175 E/mono-rt ( 6453): at ???+115963 [0x40ef04fb] 08-03 11:06:17.175 E/mono-rt ( 6453): at ???+71633 [0x40ee57d1] 08-03 11:06:17.175 E/mono-rt ( 6453): at ???+115963 [0x40ef04fb] 08-03 11:06:17.175 E/mono-rt ( 6453): at ???+71633 [0x40ee57d1] 08-03 11:06:17.175 E/mono-rt ( 6453): at ???+115963 [0x40ef04fb] 08-03 11:06:17.175 E/mono-rt ( 6453): at ???+71633 [0x40ee57d1] 08-03 11:06:17.175 E/mono-rt ( 6453): at ???+115963 [0x40ef04fb] 08-03 11:06:17.175 E/mono-rt ( 6453): at ???+71633 [0x40ee57d1] 08-03 11:06:17.175 E/mono-rt ( 6453): at ???+115963 [0x40ef04fb] 08-03 11:06:17.176 E/mono-rt ( 6453): at ???+71633 [0x40ee57d1] 08-03 11:06:17.176 E/mono-rt ( 6453): at ???+115963 [0x40ef04fb] 08-03 11:06:17.176 E/mono-rt ( 6453): at ???+71633 [0x40ee57d1] 08-03 11:06:17.176 E/mono-rt ( 6453): at ???+115963 [0x40ef04fb] 08-03 11:06:17.176 E/mono-rt ( 6453): at ???+71633 [0x40ee57d1] 08-03 11:06:17.176 E/mono-rt ( 6453): at ???+115963 [0x40ef04fb] 08-03 11:06:17.176 E/mono-rt ( 6453): at ???+71633 [0x40ee57d1] 08-03 11:06:17.176 E/mono-rt ( 6453): at ???+115963 [0x40ef04fb] 08-03 11:06:17.176 E/mono-rt ( 6453): at ???+404019 [0x401d4a33] 08-03 11:06:17.176 E/mono-rt ( 6453): at dvmPlatformInvoke+112 [0x40b4d610] 08-03 11:06:17.176 E/mono-rt ( 6453): at dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+500 [0x40b7cf59] 08-03 11:06:17.176 E/mono-rt ( 6453): at ???+162272 [0x40b569e0] 08-03 11:06:17.176 E/mono-rt ( 6453): at dvmInterpret(Thread*, Method const*, JValue*)+180 [0x40b5a92c] 08-03 11:06:17.176 E/mono-rt ( 6453): at dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool)+374 [0x40b9065f] 08-03 11:06:17.176 E/mono-rt ( 6453): at ???+431609 [0x40b985f9] 08-03 11:06:17.176 E/mono-rt ( 6453): at ???+162272 [0x40b569e0] 08-03 11:06:17.176 E/mono-rt ( 6453): at dvmInterpret(Thread*, Method const*, JValue*)+180 [0x40b5a92c] 08-03 11:06:17.176 E/mono-rt ( 6453): at dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+272 [0x40b90339] 08-03 11:06:17.176 E/mono-rt ( 6453): at ???+303665 [0x40b79231] 08-03 11:06:17.176 E/mono-rt ( 6453): at ???+315745 [0x401bf161] 08-03 11:06:17.176 E/mono-rt ( 6453): at android::AndroidRuntime::start(char const*, char const*)+400 [0x401bff05] 08-03 11:06:17.176 E/mono-rt ( 6453): at ???+3511 [0x40038db7] 08-03 11:06:17.176 E/mono-rt ( 6453): at __libc_init+64 [0x4007bd98] 08-03 11:06:17.176 E/mono-rt ( 6453): at ???+2792 [0x40038ae8] 08-03 11:06:17.176 E/mono-rt ( 6453): 08-03 11:06:17.176 E/mono-rt ( 6453): ================================================================= 08-03 11:06:17.176 E/mono-rt ( 6453): Got a SIGSEGV while executing native code. This usually indicates 08-03 11:06:17.176 E/mono-rt ( 6453): a fatal error in the mono runtime or one of the native libraries 08-03 11:06:17.176 E/mono-rt ( 6453): used by your application. 08-03 11:06:17.176 E/mono-rt ( 6453): ================================================================= 08-03 11:06:17.176 E/mono-rt ( 6453): 08-03 11:06:17.176 F/libc ( 6453): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 6453 (rmsSample.Droid) 08-03 11:06:17.190 D/Mono ( 6453): DllImport searching in: 'mono-urho' ('/storage/emulated/0/Android/data/FormsSample.Droid/files/.__override__/libmono-urho.so'). 08-03 11:06:17.190 D/Mono ( 6453): Searching for 'TryDeleteRefCounted'. 08-03 11:06:17.190 D/Mono ( 6453): Probing 'TryDeleteRefCounted'. 08-03 11:06:17.190 D/Mono ( 6453): Found as 'TryDeleteRefCounted'. 08-03 11:06:17.212 W/UrhoSharp( 6453): RefCountedCache objects alive: 1

After update Urho.Graphics contains method TakeScreenShot, but I get a black picture when trying to display the saved screenshot.

MichalPetryk commented 8 years ago

After update to Urho.Forms 1.1.125 nothing has changed, still the same problem.

EgorBo commented 8 years ago

@MichalPetryk the problem is - when you leave a page with Urho - you should close it (app.Exit()) before. The sample doesn't do it, I'll fix it later.

migueldeicaza commented 8 years ago

Is this a condition we could detect and provide a better user error message?

MichalPetryk commented 8 years ago

@EgorBo now it works correctly. Thanks for help!