Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.6.3, 3.5.2] Dragonbones error & "animationPose" is undefined on Android platform #13467

Closed
mrtzd opened this issue Nov 21, 2022 · 4 comments
Closed
Assignees
Labels
Bug Env: Android Env: Native General issue on all native platforms including iOS, Android, MacOS, Windows

Comments

@mrtzd
Copy link
Contributor

mrtzd commented Nov 21, 2022

Cocos Creator version

3.6.3, 3.5.2

System information

Windows 10 Editor

Issue description

I have a 2D game where the character has an idle animation and the user controls the character which can shoot arrows using a bow. This works perfectly when the game is running in the browser without any errors:

Video.mp4

But running the game on an Android device and then trying to shoot an arrow I get errors in the log and the animation is broken. Here is part of the code that causes this error (line 154 of 'Player.ts' script in demo):

this.aimArm.offset.x = this.aimArmX - (this.aimArm.origin.x + this.aimArm.animationPose.x);
this.aimArm.offset.y = this.aimArmY + this.aimArm.origin.y + this.aimArm.animationPose.y;

this.aimArm.invalidUpdate();

Also I've noticed that on Android the value of "animationPose" of any bone is always undefined and so I can't use it but even without using the "animationPose" the same error happens.

Relevant error log output

This was the log output running on an Android device (v3.6.2):

D/Cocos: 22:45:05 [DEBUG]: D/ JS: [ERROR]: TypeError: Cannot read property 'x' of undefined
    TypeError: Cannot read property 'x' of undefined
        at Player.animateArms (assets/main/index.js:636:99)
        at Player.updateCharacter (assets/main/index.js:714:18)
        at Player.lateUpdate (assets/main/index.js:733:18)
        at eval (eval at createInvokeImplJit (src/cocos-js/cc.js:34062:40), <anonymous>:3:65)
        at ReusableInvoker._invoke (src/cocos-js/cc.js:34069:19)
        at ReusableInvoker.invoke (src/cocos-js/cc.js:34051:22)
        at ComponentSc

This is the same error log for the v3.5.2 of this demo:

D/jswrapper: JS: [ERROR]: TypeError: Cannot read property 'x' of undefined
    TypeError: Cannot read property 'x' of undefined
        at Player.animateArms (assets/main/index.js:636:99)
        at Player.updateCharacter (assets/main/index.js:714:18)
        at Player.lateUpdate (assets/main/index.js:733:18)
        at eval (eval at createInvokeImplJit (src/cocos-js/cc.js:47540:40), <anonymous>:3:65)
        at ReusableInvoker._invoke (src/cocos-js/cc.js:47547:19)
        at ReusableInvoker.invoke (src/cocos-js/cc.js:47529:22)
        at ComponentScheduler.lateUpdatePhase (src/cocos-js/cc.js:47683:40)
        at Director.tick (src/cocos-js/cc.js:51632:41)
        at callback (src/cocos-js/cc.js:51058:30)
        at tick (jsb-adapter/jsb-builtin.js:601:7)

Steps to reproduce

Simply run the attached demo project on an Android device and then swipe on the screen to see the error (by swiping you pull the string of the bow).

Minimal reproduction project

@mrtzd mrtzd added Bug Needs Triage Needs to be assigned by the team labels Nov 21, 2022
@minggo minggo added Env: Native General issue on all native platforms including iOS, Android, MacOS, Windows Env: Android and removed Needs Triage Needs to be assigned by the team labels Nov 22, 2022
@zhakesi
Copy link
Contributor

zhakesi commented Nov 23, 2022

native Transform animationPose not export to js

@mrtzd
Copy link
Contributor Author

mrtzd commented Nov 29, 2022

native Transform animationPose not export to js

Sorry to bother you, so will this issue get fixed in the next release? I was getting ready to finish my game and release it in the near future but this is a major blocking issue and I'm not aware of any workarounds.

@mrtzd mrtzd changed the title [3.6.2, 3.5.2] Dragonbones error & "animationPose" is undefined on Android platform [3.6.3, 3.5.2] Dragonbones error & "animationPose" is undefined on Android platform Feb 6, 2023
@mrtzd
Copy link
Contributor Author

mrtzd commented Feb 8, 2023

@zhakesi I've tested this issue again and seems like it is fixed in v3.7.0 since "animationPose" is no longer undefined on Android. I don't know which pull request was responsible for this fix so I'll leave it open. Anyway thanks for fixing this!

@mrtzd
Copy link
Contributor Author

mrtzd commented Mar 1, 2023

Fixed by #12410

@mrtzd mrtzd closed this as completed Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Env: Android Env: Native General issue on all native platforms including iOS, Android, MacOS, Windows
Projects
None yet
Development

No branches or pull requests

3 participants