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

Game crash on starting new game after deleting mod #11506

Closed
1 task done
Muro81 opened this issue Apr 22, 2024 · 20 comments · Fixed by #11508
Closed
1 task done

Game crash on starting new game after deleting mod #11506

Muro81 opened this issue Apr 22, 2024 · 20 comments · Fixed by #11508
Assignees
Labels

Comments

@Muro81
Copy link

Muro81 commented Apr 22, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Game Version

4.11.5

Describe the bug

I deleted ancient total war mod, which I didnt use at all. When I go to create new game I get a crash report. The last selected play option was a mod Fantasia that worked fine.
Crash report:
Platform: Android
Version: 4.11.5 (Build 988)
Rulesets: [Civ V - Vanilla, RekMOD, Civ V - Gods & Kings, DeCiv Redux, Epic of Fantasy, Barbarian xp farm, Civ6 Tileset, Fantasia]
Last Screen: com.unciv.ui.screens.mainmenuscreen.MainMenuScreen


Device Model: M2101K6G
API Level: 33
System Memory: 5570 MB
Available (used by Kernel): 1995 MB
System Low Memory state: false
Java heap limit: 512 MB
Java heap free: 19 MB


Message:

kotlin.UninitializedPropertyAccessException: lateinit property baseRuleset has not been initialized
	at com.unciv.ui.screens.newgamescreen.ModCheckboxTable.deselectIncompatibleMods(ModCheckboxTable.kt:199)
	at com.unciv.ui.screens.newgamescreen.ModCheckboxTable.updateSelection(ModCheckboxTable.kt:79)
	at com.unciv.ui.screens.newgamescreen.GameOptionsTable.update(GameOptionsTable.kt:77)
	at com.unciv.ui.screens.newgamescreen.GameOptionsTable.<init>(GameOptionsTable.kt:70)
	at com.unciv.ui.screens.newgamescreen.NewGameScreen.<init>(NewGameScreen.kt:77)
	at com.unciv.ui.screens.newgamescreen.NewGameScreen.<init>(NewGameScreen.kt:50)
	at com.unciv.ui.screens.mainmenuscreen.MainMenuScreen$newGameButton$1.invoke(MainMenuScreen.kt:150)
	at com.unciv.ui.screens.mainmenuscreen.MainMenuScreen$newGameButton$1.invoke(MainMenuScreen.kt:149)
	at com.unciv.ui.screens.mainmenuscreen.MainMenuScreen$getMenuButton$1.invoke(MainMenuScreen.kt:103)
	at com.unciv.ui.screens.mainmenuscreen.MainMenuScreen$getMenuButton$1.invoke(MainMenuScreen.kt:101)
	at com.unciv.ui.components.input.ActivationActionMap.activate(ActivationActionMap.kt:56)
	at com.unciv.ui.components.input.ActorAttachments.activate(ActorAttachments.kt:42)
	at com.unciv.ui.components.input.ActivationExtensionsKt.activate(ActivationExtensions.kt:17)
	at com.unciv.ui.components.input.ActivationListener.tap(ActivationListener.kt:15)
	at com.badlogic.gdx.scenes.scene2d.utils.ActorGestureListener$1.tap(ActorGestureListener.java:52)
	at com.badlogic.gdx.input.GestureDetector.touchUp(GestureDetector.java:206)
	at com.badlogic.gdx.scenes.scene2d.utils.ActorGestureListener.handle(ActorGestureListener.java:125)
	at com.badlogic.gdx.scenes.scene2d.Stage.touchUp(Stage.java:354)
	at com.unciv.ui.screens.basescreen.UncivStage.access$touchUp$s80204510(UncivStage.kt:17)
	at com.unciv.ui.screens.basescreen.UncivStage$touchUp$1.invoke(UncivStage.kt:87)
	at com.unciv.ui.screens.basescreen.UncivStage$touchUp$1.invoke(UncivStage.kt:87)
	at com.unciv.ui.crashhandling.CrashHandlingExtensionsKt$wrapCrashHandling$1.invoke(CrashHandlingExtensions.kt:17)
	at com.unciv.ui.screens.basescreen.UncivStage.touchUp(UncivStage.kt:87)
	at com.badlogic.gdx.backends.android.DefaultAndroidInput.processEvents(DefaultAndroidInput.java:423)
	at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame(AndroidGraphics.java:503)
	at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1590)
	at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1272)

Able to provide any additional info needed.

Steps to Reproduce

  1. Install ancient total war mod.
  2. Don't use it.
  3. Also have fantasia installed.
  4. Make new game of Fantasia mod.
  5. Delete ancient total war.
  6. Go to new game
  7. Crash

Screenshots

No response

Link to save file

No response

Operating System

Android

Additional Information

No response

@Muro81 Muro81 added the bug label Apr 22, 2024
@Muro81
Copy link
Author

Muro81 commented Apr 22, 2024

Deleting the map that was in the mod, solved it.

@SomeTroglodyte
Copy link
Collaborator

Deleting the map that was in the mod, solved it.

What? How do you delete a mod without also deleting its maps?

@Muro81
Copy link
Author

Muro81 commented Apr 22, 2024

Not sure, I pressed from mods menu delete mod. And I go to maps editor screen, load map, and delete the map that was leftover. Should the game handle this scenario or the modders?

@SomeTroglodyte
Copy link
Collaborator

From the trace, clear enough.

But you must have re-saved the map in map editor before mod deletion, which makes a copy in your maps folder, otherwise it would have been gone. Must be. Better check myself...

@SomeTroglodyte SomeTroglodyte self-assigned this Apr 22, 2024
@SomeTroglodyte
Copy link
Collaborator

Or - wait - one mod comes with maps that require another mod - could be - I've already thought about preventing that sort of thing... We'll see.

@Muro81
Copy link
Author

Muro81 commented Apr 22, 2024

I never touched the map in map editor tho, only time i viewed it was in the star game screen.

@SomeTroglodyte
Copy link
Collaborator

... or Android bungled the delete. That OS's file security concepts are degrading more rapidly than butter on the surface of the sun...
You don't happen to have a root file manager or adb-based one?

Waaaiiittt.... What was up with that perverse copying of the entire mods folder structure on startup? That could be the culprit of the map still being around!

That fix PR is valid anyway, but someone should investigate how all internal/local/external folders really look after mod deletion... And I am lazy.

@Muro81
Copy link
Author

Muro81 commented Apr 22, 2024

Not sure about the file manager, I have one that came with phone.

@SomeTroglodyte
Copy link
Collaborator

Not sure about the file manager, I have one that came with phone.

Sorry, I was using too technical language. You can't normally see files private to an app except via how that app presents them. And I'd like to see what really became of the folder of a deleted mod. People with not-out-of-the-box tools could go and look, but normally you can't. And those tools are either a "rooted" OS (meaning you must have unlocked the device's loader partitions - either through a vendor feature or hacking) or a programmer's debugger.

On desktop, your steps do not reproduce any problem - which is fine as the patch closes a mistake that needed closing anyway.

@Muro81
Copy link
Author

Muro81 commented Apr 22, 2024

Ive got android studio, could probably look up the files and folders created if you want me to.

@SomeTroglodyte
Copy link
Collaborator

android studio

"Device Explorer", then look for mod remnants (of the ancient thingy mod) under /data/data/com.unciv.app/files/mods and /sdcard/Android/data/com.unciv.app/files/mods ...

@Muro81
Copy link
Author

Muro81 commented Apr 22, 2024

Yeah device explorer, but in like an hour or two.

@Muro81
Copy link
Author

Muro81 commented Apr 22, 2024

I tried this but I cant access any files under the com.unciv.app, run as: package not debuggable, Is what it says.

@SomeTroglodyte
Copy link
Collaborator

Oh well, adb is a science in itself. Maybe it needs some more config, like activating developer mode and then some setting in the dev options... So gotta test that myself, only I got no API level 33 device or AVD in sight... Too resource-hungry and -wasteful...

@Muro81
Copy link
Author

Muro81 commented Apr 23, 2024

Its possible to view debuggable aps, but id need to build it in debug mode on my phone to view that. Should it be possible if I git clone the project?

@SomeTroglodyte
Copy link
Collaborator

Remotely possible - though if so, it's likely a security feature comparing signatures. My Studio can look into all the apps's /data/data/packagename/files, no matter whether built myself or not, but then I have LineageOS and LOS may change these rules. adb bypassing Linux owner/group permissions always sounded to me like a feature marshalled by the system, not using the root hack to make the su binaries available...

@Muro81
Copy link
Author

Muro81 commented Apr 23, 2024

Wel I have some apps that were built by myself on Windows machines. I can acces the debug ones but not the release ones that were signed? Or it could be the shrinking or minifying of resources as well I guess?

@AdityaMH
Copy link
Contributor

Also editing base ruleset even just add "a" will lead you permanent crash.

@SomeTroglodyte
Copy link
Collaborator

SomeTroglodyte commented Apr 23, 2024

No, just tested - mod deletion is clean, and the offer to copy mods from /sdcard/Android/data/com.unciv.app/files/mods is just that - an offer to be able to mod on Android, it only copies in one direction, no download leftover loaded from there. So that fix just merged should be enough... Tested, it does uncrash what was crashing.

@SomeTroglodyte
Copy link
Collaborator

... what the patch didn't fix is this: Start a new game with a base ruleset mod, then delete it, then try "Quickstart". No crash and the message is perfectly clear, but it could revert to vanilla instead - with message.... No priority.

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

Successfully merging a pull request may close this issue.

3 participants