Skip to content

Fix Android native build#533

Merged
iProgramMC merged 3 commits intomasterfrom
native-android-fix
Mar 1, 2026
Merged

Fix Android native build#533
iProgramMC merged 3 commits intomasterfrom
native-android-fix

Conversation

@iProgramMC
Copy link
Member

NOTE: Seems like globally initialized objects are broken, because only making AppPlatform_android a pointer in main.cpp fixed a crash issue regarding AppPlatform::m_singleton seemingly being cleared.

For some reason, it seems like libnbcraft.so is loaded twice? Didn't happen in the last PR.
image

I hope we aren't using any more globally initialized classes, because it seems they're broken! (reset to 0 because the app loads nbcraft TWICE!! before android_app_entry gets a chance to run)
@iProgramMC iProgramMC changed the title Fix Android native build. Fix Android native build Mar 1, 2026
Yeah turns out `= nullptr;` is a whole ahh static initialization with a function in .init_array instead of just clearing the value to 0
@iProgramMC
Copy link
Member Author

This PR is now ready. I can now compile an android APK for NBCraft with this project.

@iProgramMC iProgramMC merged commit 4e4a38e into master Mar 1, 2026
13 checks passed
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.

1 participant