Math2d - Crash on device

Hi Ed,

 

Repeat of end of other thread,  thought I would start a new one following your recommendation to save confusion.

 

Issue: When I install your samples (tried “math2d_01_basics” and “math2d_03_segmentCircle”) on my Android device I get a Runtime error, 

Plugin: Math2d (paid Version)

Corona SDK version: 2992

Mac: Sierra 10.12.1

Device: S7 (SM-930F)

Android Version: 6.0.1

 

 

 

Cheers,

 

Craig

Craig,
 
Well I’m stymied.  I just…

 
A> Downloaded the   math2d plugin tests:  http://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2016/11/math2d.zip

B> Built : ~/math2d/tests/math2d_03_segmentCircle for Android

C> Installed and ran.

Corona SDK: 2016.2992

Built twice:

  • OS X 10.11.6
  • Windows 10

Installed on Samsung Tab 4 (SM-T320NU; running Android 4.4.2)

( Note: I don’t have any Android 6 test devices. )

… and it worked both times.

Request

Can you please use adb logcat to get a better idea of what is going wrong?  Screenshots of errors probably don’t tell the whole picture (no pun intended).

https://docs.coronalabs.com/guide/basics/debugging/index.html#device-debugging-android

If this continues I may have to implement these in Lua and add them to SSK 2.

Request 2

Can you provide a download link for your APK?  I’ll install it on my device and see if it works in Android 4.4.2

If it does, then this may mean a Android 6.0 issue.

If it does not work, that will indicate a problem with the build process.

Meanwhile, try my build: 

http://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2016/11/math2d_03_segmentCircle.apk

@Craig,

I’m going off-line for several hours, so if you post soon, be aware I’m not ignoring you.  I’m simply not here.

@all,

If anyone else is reading this and feels like helping, it would be super awesome if you could download my APK and install it on your device to test it.

http://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2016/11/math2d_03_segmentCircle.apk

Then, post back here with a ‘worked’/‘crashed’ note and the details on your device:

  • device type / Android version.

Especially looking for Andrid 5 and 6 users!

Hi Ed,

No stress - different time zones and all…  This was an install from your apk,  I just wanted to take my comp out of the equation.

Platform: SM-G930F / ARM Neon / 6.0.1 / Mali-T880 / OpenGL ES 3.2 v1.r12p1-00dev0.60546d7cd0bfd82d0ba92ca3bb825c75 / 2016.2992 / English | NZ | en\_NZ | en SM-G930F: ERROR: Runtime error SM-G930F: error loading module 'plugin.math2d' from file '/data/app/com.gmail.emaurina.math2d\_03\_segmentCircle-1/lib/arm/libplugin.math2d.so': SM-G930F: dlopen failed: cannot locate symbol "\_\_aeabi\_memclr8" referenced by "/data/app/com.gmail.emaurina.math2d\_03\_segmentCircle-1/lib/arm/libplugin.math2d.so"... SM-G930F: stack traceback: SM-G930F: [C]: ? SM-G930F: [C]: in function 'require' SM-G930F: /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:853: in function 'require' SM-G930F: X:\Work\00\_CurentProjects\Corona\RG\_FreeStuff\AskEd\2016\11\math2d\tests\math2d\_03\_segmentCircle\main.lua:25: in main chunk SM-G930F: FATAL EXCEPTION: main SM-G930F: Process: com.gmail.emaurina.math2d\_03\_segmentCircle, PID: 24097 SM-G930F: java.lang.RuntimeException: error loading module 'plugin.math2d' from file '/data/app/com.gmail.emaurina.math2d\_03\_segmentCircle-1/lib/arm/libplugin.math2d.so': SM-G930F: dlopen failed: cannot locate symbol "\_\_aeabi\_memclr8" referenced by "/data/app/com.gmail.emaurina.math2d\_03\_segmentCircle-1/lib/arm/libplugin.math2d.so"... SM-G930F: stack traceback: SM-G930F: [C]: ? SM-G930F: [C]: ? SM-G930F: [C]: in function 'require' SM-G930F: /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:853: in function 'require' SM-G930F: X:\Work\00\_CurentProjects\Corona\RG\_FreeStuff\AskEd\2016\11\math2d\tests\math2d\_03\_segmentCircle\main.lua:25: in main chunk SM-G930F: Force finishing activity com.gmail.emaurina.math2d\_03\_segmentCircle/com.ansca.corona.CoronaActivity SM-G930F: Activity pause timeout for ActivityRecord{cac5696 u0 com.gmail.emaurina.math2d\_03\_segmentCircle/com.ansca.corona.CoronaActivity t7203 f}

Cheers,

Craig

Craig,

This may take a while.

In the interim, you can download this file,

https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2016/11/math2d_lua_update.zip

which contains a pure-lua math2d.lua module and samples showing how to use it.  

This module

https://raw.githubusercontent.com/roaminggamer/RG_FreeStuff/master/AskEd/2016/11/math2d_lua_update/math2d.lua

implements these functions:

  • add
  • angle2Vector
  • cartesian2Screen
  • cross
  • diff
  • dot
  • length
  • length2
  • lineLineIntersect
  • midPoint
  • normalize
  • normals
  • rotateTo
  • scale
  • screen2Cartesian
  • segmentCircleIntersect
  • segmentSegmentIntersect
  • sub
  • vector2Angle

This should get your over the hump for now.  I’ll write back when I have a better solution.

Hi, 

I am having crash reports on this problem from Android 6.0.1 users, I wish I could have known this earlier :( 

I will change the library to Lua version but I am really afraid of performance problems, I will be really glad if you could suggest me  another way to fix this.

Thank you in advance.

Here is an example crash report;

Package: com.\*\*\*\*\*\*\*\*\* Version Code: 2 Version Name: 2.1.19 Android: 6.0.1 Manufacturer: samsung Model: SAMSUNG-SM-G900A CrashReporter Key: A139483F-B704-18E6-A5DA-AF7C5FB31524A6268C4B Date: Mon Jan 09 17:45:52 PST 2017 java.lang.RuntimeException: /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/composer/composer.lua:1451: error loading module 'plugin.math2d' from file '/data/app/com.\*\*\*\*\*\*\*\*\*/lib/arm/libplugin.math2d.so': &nbsp;&nbsp;&nbsp;&nbsp;dlopen failed: cannot locate symbol "\_\_aeabi\_memclr8" referenced by "/data/app/com.\*\*\*\*\*\*\*\*\*-1/lib/arm/libplugin.math2d.so"... stack traceback: &nbsp;&nbsp;&nbsp;&nbsp;[C]: ? &nbsp;&nbsp;&nbsp;&nbsp;[C]: in function 'error' &nbsp;&nbsp;&nbsp;&nbsp;/Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/composer/composer.lua:1451: in function 'gotoScene' &nbsp;&nbsp;&nbsp;&nbsp;?: in function '\_onRelease' &nbsp;&nbsp;&nbsp;&nbsp;/Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/widget/widgetLibrary/widget\_button.lua:90: in function 'manageButtonTouch' &nbsp;&nbsp;&nbsp;&nbsp;/Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/widget/widgetLibrary/widget\_button.lua:658: in function 'method' &nbsp;&nbsp;&nbsp;&nbsp;/Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:203: in function \</Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:172\>

Posting you build.settings would be a good idea

Hello all!  This is a valid issue and the fault is entirely mine.

I’m looking into it now, but I have yet to determine the cause.

Note: Debug is slowed somewhat because I don’t have an Android 6.0 device.  

Thanks for your patience.

@roamminggamer you could use android simulator

Here is a logcat dump from Android 6.0.1 using the apk above:

01-11 09:02:05.254 &nbsp; 698 &nbsp;1245 I ActivityManager: Start proc 6392:com.gmail.emaurina.math2d\_03\_segmentCircle/u0a107 for activity com.gmail.emaurina.math2d\_03\_segmentCircle/com.ansca.corona.CoronaActivity 01-11 09:02:05.265 &nbsp;1372 &nbsp;2477 I MicroRecognitionRunner: Detection finished 01-11 09:02:05.303 &nbsp; 698 &nbsp;1529 I ActivityManager: Config changes=480 {1.0 ?mcc?mnc en\_US ldltr sw600dp w600dp h888dp 320dpi lrg port finger -keyb/v/h -nav/h s.9} 01-11 09:02:05.304 &nbsp; 242 &nbsp; 242 D hwcomposer: Setting display 0 transform: 0 01-11 09:02:05.304 &nbsp; 242 &nbsp; 242 D hwcomposer: Display 0 device size is 1200 x 1920 01-11 09:02:05.304 &nbsp; 242 &nbsp; 242 D hwcomposer: Display 0 device clip is (0, 0, 1200, 1920) 01-11 09:02:05.314 &nbsp; 698 &nbsp; 743 I InputReader: Reconfiguring input devices. &nbsp;changes=0x00000004 01-11 09:02:05.314 &nbsp; 698 &nbsp; 743 I InputReader: Device reconfigured: id=1, name='touch', size 1200x1920, orientation 0, mode 1, source 0x1002, display id 0 01-11 09:02:05.315 &nbsp; 698 &nbsp; 743 I InputReader: Setting mTouchBlackoutEnabled from property to 1 01-11 09:02:05.315 &nbsp; 698 &nbsp; 743 I InputReader: Setting mExtendBlackoutWhilePointersDown from property to 1 01-11 09:02:05.315 &nbsp; 698 &nbsp; 743 I InputReader: Setting mIIRLowPassFactor from property to 1.000000 01-11 09:02:05.315 &nbsp; 698 &nbsp; 743 I InputReader: Setting mPressureEBC from property to 0.900000 01-11 09:02:05.315 &nbsp; 698 &nbsp; 743 I InputReader: Setting mToolSwitchTime from property to 400 ms 01-11 09:02:05.315 &nbsp; 698 &nbsp; 743 I InputReader: Setting mToolSwitchRange from property to 200 01-11 09:02:05.315 &nbsp; 698 &nbsp; 743 I InputReader: Setting mEraserLatchRange from property to 10 01-11 09:02:05.315 &nbsp; 698 &nbsp; 743 I InputReader: Setting mEraserDelayTime from property to 250 ms 01-11 09:02:05.315 &nbsp; 698 &nbsp; 743 I InputReader: Setting mPinchToZoomTime from property to 1000 ms 01-11 09:02:05.315 &nbsp; 698 &nbsp; 743 I InputReader: Setting mPinchToZoomRange from property to 1100 01-11 09:02:05.315 &nbsp; 698 &nbsp; 743 I InputReader: Setting mPinchToZoomRectangleX from property to 800 01-11 09:02:05.315 &nbsp; 698 &nbsp; 743 I InputReader: Setting mPinchToZoomRectangleY from property to 1400 01-11 09:02:05.315 &nbsp; 698 &nbsp; 743 I InputReader: Setting mPinchToZoomRectangleCenterX from property to 600 01-11 09:02:05.315 &nbsp; 698 &nbsp; 743 I InputReader: Setting mPinchToZoomRectangleCenterY from property to 960 01-11 09:02:05.315 &nbsp; 698 &nbsp; 743 I InputReader: Setting mEdgeRemapMarginLeft from property to 10 01-11 09:02:05.315 &nbsp; 698 &nbsp; 743 I InputReader: Setting mEdgeRemapMarginTop from property to 5 01-11 09:02:05.315 &nbsp; 698 &nbsp; 743 I InputReader: Setting mEdgeRemapMarginRight from property to 15 01-11 09:02:05.315 &nbsp; 698 &nbsp; 743 I InputReader: Setting mEdgeRemapMarginBottom from property to 5 01-11 09:02:05.351 &nbsp;1138 &nbsp;1531 W Delight4Decoder: removePredictionEngine() : Unknown engine abo@d44749d 01-11 09:02:05.367 &nbsp;1884 &nbsp;1884 D QuickMenuService: IsTopFullScreen: true 01-11 09:02:05.368 &nbsp;1205 &nbsp;1205 D LayoutAdjusterObject: 0.63125 0.18020834 0.6983333 0.0 01-11 09:02:05.373 &nbsp;1205 &nbsp;1205 D LayoutAdjusterObject: 0.0 0.6875 0.8 0.0 01-11 09:02:05.442 &nbsp;6392 &nbsp;6392 I MultiDex: VM with version 2.1.0 has multidex support 01-11 09:02:05.442 &nbsp;6392 &nbsp;6392 I MultiDex: install 01-11 09:02:05.442 &nbsp;6392 &nbsp;6392 I MultiDex: VM has multidex support, MultiDex support library is disabled. 01-11 09:02:05.470 &nbsp;6392 &nbsp;6392 I art &nbsp; &nbsp; : Thread[1,tid=6392,Native,Thread\*=0xb444a500,peer=0x7449f3b0,"main"] recursive attempt to load library "/data/app/com.gmail.emaurina.math2d\_03\_segmentCircle-1/lib/arm/libjnlua5.1.so" 01-11 09:02:05.476 &nbsp;6392 &nbsp;6392 I OpenAL\_SLES: alc\_opensles\_init 01-11 09:02:05.842 &nbsp;6392 &nbsp;6415 D OpenGLRenderer: Use EGL\_SWAP\_BEHAVIOR\_PRESERVED: true 01-11 09:02:05.861 &nbsp;1151 &nbsp;1151 D RSMouse : mFeatureEnabled=true &nbsp;mPackageEnabled=true 01-11 09:02:05.894 &nbsp;6392 &nbsp;6415 I OpenGLRenderer: Initialized EGL, version 1.4 01-11 09:02:05.977 &nbsp;6392 &nbsp;6410 V GLSurfaceView: glGetString(7937) returns NVIDIA Tegra; 01-11 09:02:05.984 &nbsp; 698 &nbsp; 716 V WindowManager: Layouts looping: On entry to LockedInner, mPendingLayoutChanges = 0x1 01-11 09:02:05.984 &nbsp; 698 &nbsp; 716 V WindowManager: Layouts looping: after finishPostLayoutPolicyLw, mPendingLayoutChanges = 0x0 01-11 09:02:05.984 &nbsp; 698 &nbsp; 716 V WindowManager: Layouts looping: mLayoutNeeded, mPendingLayoutChanges = 0x1 01-11 09:02:05.984 &nbsp; 698 &nbsp; 716 V WindowManager: Layouts looping: On entry to LockedInner, mPendingLayoutChanges = 0x1 01-11 09:02:05.984 &nbsp; 698 &nbsp; 716 V WindowManager: Layouts looping: after finishPostLayoutPolicyLw, mPendingLayoutChanges = 0x0 01-11 09:02:05.985 &nbsp; 698 &nbsp; 716 V WindowManager: Layouts looping: mLayoutNeeded, mPendingLayoutChanges = 0x1 01-11 09:02:05.985 &nbsp; 698 &nbsp; 716 E WindowManager: Performed 6 layouts in a row. Skipping 01-11 09:02:05.993 &nbsp; 698 &nbsp; 716 I ActivityManager: Displayed com.gmail.emaurina.math2d\_03\_segmentCircle/com.ansca.corona.CoronaActivity: +760ms 01-11 09:02:06.006 &nbsp;6392 &nbsp;6410 V Corona &nbsp;: \> Class.forName: network.LuaLoader 01-11 09:02:06.006 &nbsp;6392 &nbsp;6410 V Corona &nbsp;: \< Class.forName: network.LuaLoader 01-11 09:02:06.007 &nbsp;6392 &nbsp;6410 V Corona &nbsp;: Loading via reflection: network.LuaLoader 01-11 09:02:06.010 &nbsp; 274 &nbsp; 274 D Raydium\_ts\_main: ## Report rate in 10 seconds =1281 01-11 09:02:06.015 &nbsp;6392 &nbsp;6410 I Corona &nbsp;: Platform: SHIELD Tablet K1 / ARM Neon / 6.0.1 / NVIDIA Tegra / OpenGL ES 3.2 NVIDIA 361.00 / 2016.2992 / English | US | en\_US | en 01-11 09:02:06.034 &nbsp; 698 &nbsp; 716 I WindowManager: Screen frozen for +750ms due to Window{ff4c8dd u0 Starting com.gmail.emaurina.math2d\_03\_segmentCircle} 01-11 09:02:06.047 &nbsp;6392 &nbsp;6410 E linker &nbsp;: readlink('/proc/self/fd/40') failed: Permission denied [fd=40] 01-11 09:02:06.047 &nbsp;6392 &nbsp;6410 E linker &nbsp;: warning: unable to get realpath for the library "/data/app/com.gmail.emaurina.math2d\_03\_segmentCircle-1/lib/arm/liblicensing.so". Will use given name. 01-11 09:02:06.049 &nbsp;6392 &nbsp;6410 V Corona &nbsp;: \> Class.forName: CoronaProvider.licensing.google.LuaLoader 01-11 09:02:06.049 &nbsp;6392 &nbsp;6410 V Corona &nbsp;: \< Class.forName: CoronaProvider.licensing.google.LuaLoader 01-11 09:02:06.054 &nbsp;6392 &nbsp;6410 V Corona &nbsp;: Loading via reflection: CoronaProvider.licensing.google.LuaLoader 01-11 09:02:06.058 &nbsp;6392 &nbsp;6410 E linker &nbsp;: readlink('/proc/self/fd/40') failed: Permission denied [fd=40] 01-11 09:02:06.058 &nbsp;6392 &nbsp;6410 E linker &nbsp;: warning: unable to get realpath for the library "/data/app/com.gmail.emaurina.math2d\_03\_segmentCircle-1/lib/arm/libplugin.math2d.so". Will use given name. 01-11 09:02:06.058 &nbsp;6392 &nbsp;6410 I Corona &nbsp;: ERROR: Runtime error 01-11 09:02:06.058 &nbsp;6392 &nbsp;6410 I Corona &nbsp;: error loading module 'plugin.math2d' from file '/data/app/com.gmail.emaurina.math2d\_03\_segmentCircle-1/lib/arm/libplugin.math2d.so': 01-11 09:02:06.058 &nbsp;6392 &nbsp;6410 I Corona &nbsp;: dlopen failed: cannot locate symbol "\_\_aeabi\_memclr8" referenced by "/data/app/com.gmail.emaurina.math2d\_03\_segmentCircle-1/lib/arm/libplugin.math2d.so"... 01-11 09:02:06.058 &nbsp;6392 &nbsp;6410 I Corona &nbsp;: stack traceback: 01-11 09:02:06.058 &nbsp;6392 &nbsp;6410 I Corona &nbsp;: [C]: ? 01-11 09:02:06.058 &nbsp;6392 &nbsp;6410 I Corona &nbsp;: [C]: in function 'require' 01-11 09:02:06.058 &nbsp;6392 &nbsp;6410 I Corona &nbsp;: /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:853: in function 'require' 01-11 09:02:06.058 &nbsp;6392 &nbsp;6410 I Corona &nbsp;: X:\Work\00\_CurentProjects\Corona\RG\_FreeStuff\AskEd\2016\11\math2d\tests\math2d\_03\_segmentCircle\main.lua:25: in main chunk 01-11 09:02:06.086 &nbsp;1151 &nbsp;1151 D RSMouse : mFeatureEnabled=true &nbsp;mPackageEnabled=true 01-11 09:02:06.956 &nbsp;6392 &nbsp;6392 I Choreographer: Skipped 51 frames! &nbsp;The application may be doing too much work on its main thread. 01-11 09:02:08.039 &nbsp; 698 &nbsp; 716 I art &nbsp; &nbsp; : Starting a blocking GC Explicit 01-11 09:02:08.150 &nbsp; 698 &nbsp; 716 I art &nbsp; &nbsp; : Explicit concurrent mark sweep GC freed 16889(1001KB) AllocSpace objects, 0(0B) LOS objects, 23% free, 13MB/17MB, paused 1.024ms total 110.819ms

Am testing in simulator.   Blech… simulating ARM so… slow.

Hi Scott,

Sorry for late reply, here is the build settings. Besides I have contacted roaminggamer (plugin owner) and he has already started working on the issue.

Thank you

 plugins = { ["plugin.math2d"] = { publisherId = "com.roaminggamer" }, ["plugin.google.play.services"] = { publisherId = "com.coronalabs", supportedPlatforms = {iphone=true, android=true } }, ["plugin.hockey"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true } }, ["plugin.openudid"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true }, }, ["plugin.googleAnalytics"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true } }, ["plugin.iCloud"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, appletvos=true, osx=true } }, ["plugin.facebook.v4"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true} }, ["CoronaProvider.native.popup.social"] = { publisherId = "com.coronalabs" }, ["CoronaProvider.native.popup.activity"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true } }, }, 

Updated:

https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2016/11/math2d_lua_update.zip

With fix for LUA files till I work out the problem with the binary and Android 6. (Thanks Bulent!).

Hi Ed,  

I just bought SSK2 Pro and was wondering what I should for now,  should I use the math2d that comes with SSK2 or the one you pointed me to earlier??

Thanks,

Craig

Craig,
 
Use the one in SSK2, but be sure you are using version 2017.006 (released just today) or after.
 
Cheers,
Ed
 
PS - New and updated in 2017.006:

  • lite & PRO
    • Critical fix to ssk.math2d - Added two missing functions/dependencies.
    • Added ssk.misc.addSmartTouch( obj, params ) - Adds a touch handler that will work in all setups.
    • Added ssk.misc.addSmartDrag( obj, params ) - Adds a touch handler that gives the object a drag-n-drop ability.
    • Added ssk.misc.addPhysicsDrag( obj, params ) - Adds a touch handler that gives the object a drag-n-drop ability using physics.

Hey Ed,

Any update on this??  Getting very close to releasing my first game (he says with slight nervousness) and any speed increase can only be a good thing.

Cheers,

Craig

I have had no luck so far, and testing this is a nightmare for me, as:

  • My plugin is not set up with a test bench and I’m unclear how to add that to the build process.
    • Implication: I have to build, add it to the official release, wait 1+ hours, test.
  • I don’t have a Android 6 or higher device
    • Implication: I have to use a simulated device which is DOG SLOW.

I’m considering giving this plugin to another author or finding another way to get this supported.  

So, many apologies for the wait.  It has simply come down to a question of time and priorities for me. i.e. I have to work to pay bills before doing this and this keeps losing.  

All is not lost however.  I’ll see if one of the other plugin developers can assist me with this.