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

Fix the crash issue on the Android platform caused by an invalid context. #18036

Merged
merged 3 commits into from
Dec 17, 2024

Conversation

bofeng-song
Copy link
Contributor

Re: #
#17910

Changelog


Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

Copy link

github-actions bot commented Dec 13, 2024

✅ Package size is not changed

Interface Check Report

This pull request does not change any public interfaces !

@dumganhar
Copy link
Contributor

@cocos-robot run test cases

Copy link

@bofeng-song, Please check the result of run test cases:

Task Details

Platform build boot runned crashScene FailScene
web-mobile PASS PASS FAIL particle-color particle-color
ios PASS PASS FAIL LoadSpine LoadSpine
mac PASS PASS FAIL particle-2d-position-type-change keyboard-event,BuildTimeConstantsTest,particle-2d-normal

Copy link

@bofeng-song, Please check the result of run test cases:

Task Details

Platform build boot runned crashScene FailScene
windows PASS PASS FAIL keyboard-event,BuildTimeConstantsTest
android PASS PASS FAIL particle-trail2,BuildTimeConstantsTest
wechatgame PASS FAIL FAIL

@@ -104,7 +104,7 @@ bool ADPFManager::initializePowerManager() {
#endif

JNIEnv *env = cc::JniHelper::getEnv();
auto *javaGameActivity = cc::JniHelper::getActivity();
auto *javaGameActivity = cc::JniHelper::getContext();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we also rename the variable name to auto *javaContext ?

@dumganhar dumganhar marked this pull request as draft December 16, 2024 07:57
@dumganhar dumganhar marked this pull request as ready for review December 16, 2024 08:58
@dumganhar
Copy link
Contributor

@cocos-robot run test cases

Copy link

@bofeng-song, Please check the result of run test cases:

Task Details

Platform build boot runned crashScene FailScene
web-mobile PASS PASS FAIL anim-widget
ios PASS PASS PASS
mac PASS PASS FAIL keyboard-event,particle-2d-normal

Copy link

@bofeng-song, Please check the result of run test cases:

Task Details

Platform build boot runned crashScene FailScene
windows PASS PASS FAIL keyboard-event,BuildTimeConstantsTest
android PASS PASS FAIL BuildTimeConstantsTest
wechatgame PASS FAIL FAIL

@minggo minggo merged commit 815c595 into cocos:v3.8.6 Dec 17, 2024
25 checks passed
@finscn
Copy link
Contributor

finscn commented Dec 20, 2024

看了下pr内容. 感觉这个bug是底层最初设计就有问题. 该用application context的地方, 错误的使用了Activity. 如果是这样, 那这个bug岂不是已经存在好几年了, 从cocos支持安卓开始就有? 之前没人反馈过吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants