crashinvaders / gdx-texture-packer-gui

A simple way to pack and manage texture atlases for libGDX game framework.
Apache License 2.0
595 stars 73 forks source link

Can't installed CJK Font #153

Closed Fresh-SaltyFish closed 1 month ago

Fresh-SaltyFish commented 2 months ago

I want to change language to Chinese, but I found that there is no response after click 'install' under 'CJK Font' Item. Here is the log:

Version: 4.13.0
OS: Windows 10 10.0 amd64
JRE: 17.0.2 Oracle Corporation
GPU: NVIDIA GeForce RTX 2060/PCIe/SSE2
OpenGL vendor: NVIDIA Corporation
OpenGL version: 4.6.0 NVIDIA 551.61
[ExtensionModuleRepositoryService] Cached data is outdated.
[ExtensionModuleRepositoryService] Requesting new data from remote server.
[ConfigurationController] Incremental fonts are disabled
[GlobalShortcutHandler] Parsing shortcut file: hotkeys_default.txt
[GlobalShortcutHandler] Parsing shortcut file: .gdxtexturepackergui/hotkeys_user.txt
[CjkFontExtensionModule] A CJK locale is selected, but the CjkFontExtensionModule extension is not installed/activated. Switching to the default locale.
[SystemUtils] Recognized system configuration is Windows (x64)
[ExtensionModuleRepositoryService] Cached data is outdated.
[ExtensionModuleRepositoryService] Requesting new data from remote server.
[ExtensionModuleManagerService] Module cannot be installed
java.lang.IllegalStateException: Module repository doesn't have required revision: font-cjk 0
    at com.crashinvaders.texturepackergui.controllers.extensionmodules.ExtensionModuleManagerService.installModule(ExtensionModuleManagerService.java:102)
    at com.crashinvaders.texturepackergui.controllers.settings.ExtensionModuleSectionController$ModuleViewHolder.onInstallClicked(ExtensionModuleSectionController.java:151)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at com.badlogic.gdx.utils.reflect.Method.invoke(Method.java:108)
    at com.github.czyzby.kiwi.util.gdx.reflection.Reflection.invokeMethod(Reflection.java:130)
    at com.github.czyzby.lml.parser.impl.action.MethodActorConsumer.consume(MethodActorConsumer.java:38)
    at com.github.czyzby.lml.parser.impl.attribute.OnChangeLmlAttribute$1.changed(OnChangeLmlAttribute.java:29)
    at com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.handle(ChangeListener.java:28)
    at com.badlogic.gdx.scenes.scene2d.Actor.notify(Actor.java:188)
    at com.badlogic.gdx.scenes.scene2d.Actor.fire(Actor.java:152)
    at com.badlogic.gdx.scenes.scene2d.ui.Button.setChecked(Button.java:125)
    at com.badlogic.gdx.scenes.scene2d.ui.Button$1.clicked(Button.java:93)
    at com.badlogic.gdx.scenes.scene2d.utils.ClickListener.touchUp(ClickListener.java:88)
    at com.badlogic.gdx.scenes.scene2d.InputListener.handle(InputListener.java:71)
    at com.badlogic.gdx.scenes.scene2d.Stage.touchUp(Stage.java:354)
    at com.crashinvaders.common.PrioritizedInputMultiplexer$Wrapper.touchUp(PrioritizedInputMultiplexer.java:143)
    at com.crashinvaders.common.PrioritizedInputMultiplexer.touchUp(PrioritizedInputMultiplexer.java:83)
    at com.badlogic.gdx.InputEventQueue.drain(InputEventQueue.java:70)
    at com.badlogic.gdx.backends.lwjgl3.DefaultLwjgl3Input.update(DefaultLwjgl3Input.java:189)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:378)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:192)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:166)
    at com.crashinvaders.texturepackergui.desktop.ApplicationStarter.startGuiApp(ApplicationStarter.java:162)
    at com.crashinvaders.texturepackergui.desktop.ApplicationStarter.main(ApplicationStarter.java:75)
metaphore commented 2 months ago

Hello, and thanks for the report!

There seems to be something wrong with the extension module caching subsystem. Just for a quick fix, clean up the cache manually, and the app should re-download the required dependencies just fine.

Here are the steps:

  1. Locate the application data folder. On Windows it should be at C:\Users\<CurrentUserName>\.gdxtexturepackergui
  2. Delete the modules folder (from under the .gdxtexturepackergui dir).
  3. To reset cache lifetime, also delete the "last_module_repo_check" line from common.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
    <properties>
    ...
    <entry key="last_module_repo_check">...</entry>    <=== Delete this line
    ...
    </properties>

Please let me know if that helps at all.

Fresh-SaltyFish commented 2 months ago

Hello, and thanks for the report!

There seems to be something wrong with the extension module caching subsystem. Just for a quick fix, clean up the cache manually, and the app should re-download the required dependencies just fine.

Here are the steps:

  1. Locate the application data folder. On Windows it should be at C:\Users\<CurrentUserName>\.gdxtexturepackergui
  2. Delete the modules folder (from under the .gdxtexturepackergui dir).
  3. To reset cache lifetime, also delete the "last_module_repo_check" line from common.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
...
<entry key="last_module_repo_check">...</entry>    <=== Delete this line
...
</properties>

Please let me know if that helps at all.

Sadly, this didn't work. In fact, my folder modules is empty and the file common.xml doesn't have the "last_module_repo_check" line. So I can hardly make any changes according to your method.

metaphore commented 2 months ago

I see, thanks for trying it out.

Can you please check if any of those files is accessible from your machine? https://crashinvaders.github.io/gdx-texture-packer-gui/modules/modules.json https://crashinvaders.github.io/gdx-texture-packer-gui/modules/font-cjk0.zip

Also, can please collect the log? So maybe the error is silently swallowed but it could be catched in the full log. The steps should be:

  1. Start gdx-texture-packer-gui app.
  2. Go to the settings and try to download the CJK Font extension module.
  3. After it fails, close the app.
  4. Grab the very last log file from C:\Users\<CurrentUserName>\.gdxtexturepackergui\logs and post it here.

In case of emergency, here are all the required files for the C:\Users\<CurrentUserName>\.gdxtexturepackergui directory. Just unpack the archive there and start the app. The CJK module should be marked as installed in the settings. gdxtp-cjk-module-data.zip

Fresh-SaltyFish commented 2 months ago

Well, I can get both of files. I finally solved the problem using the final zip file you post. The log file before I made the change is as follows (in fact, it is exactly the same as the log I pasted at the beginning): 2407170428.log After the problem was solved, I tried to uninstall the module in the software and reinstall it. When I clicked "install", an error occurred:

[text-red]Connection reset[] java.net.SocketException: Connection reset at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:323) at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:350) at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:803) at java.base/java.net.Socket$SocketInputStream.read(Socket.java:966) at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:478) at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:472) at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:160) at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:111) at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1500) at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1415) at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:450) at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:421) at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:580) at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:183) at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1665) at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589) at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224) at java.base/java.net.URL.openStream(URL.java:1161) at com.crashinvaders.texturepackergui.utils.FileUtils.downloadFile(FileUtils.java:97) at com.crashinvaders.texturepackergui.controllers.extensionmodules.CjkFontExtensionModule$1.doInBackground(CjkFontExtensionModule.java:53) at com.crashinvaders.common.async.AsyncJobTask.executeInBackground(AsyncJobTask.java:52) at com.crashinvaders.common.async.AsyncJobTask.access$000(AsyncJobTask.java:11) at com.crashinvaders.common.async.AsyncJobTask$1.run(AsyncJobTask.java:45) at java.base/java.lang.Thread.run(Thread.java:833)

Well, this is all I can try. Thanks for your solution.