Deploy libgdx in html

I tried using libgdx for html using gradle. I copied the contents

html/build/dist

and all that I see in the browser is a bad image with a red background (what would you see, just created a project) Why?

Using superdev, I can open it in a browser, I see where it says drag this button, but cannot play it. there is nothing

 The code server is ready at http://127.0.0.1:9876/ GET /clean/html Cleaning disk caches. Cleaned in 29ms. GET /superdev.html [WARN] ignored get request: /superdev.html [WARN] not handled: /superdev.html > Building 91% > :html:superDev^C% 

enter image description here

turning the dev mod into i see Can't find any GWT Modules on this page.

If I build it normally, I see some warnings about depreciated methods, it is being built successfully.

enter image description here

Attributes not loading html

+5
source share
1 answer

I have some links that may help you:

How to start Super Dev Mode in GWT

Also check out this topic fooobar.com/questions/1195793 / ...

EDIT

I tested on Android Studio with MacOS

Steps:

Run ./gradlew html:clean to clean your html module

  • In the Android Studio terminal, I run the command ./gradlew html:superDev
  • I got The code server is ready at http://127.0.0.1:9876/ on the terminal
  • Then I open Google Chrome, View → Always show bookmarks bar
  • I typed http://127.0.0.1:9876/ in the address field -> enter
  • I have a page with Dev Mode On and Dev Mode Off , two buttons
  • Drag Dev Mode On to the bookmarks bar, which is below my address bar
  • Done! now I'm looking for http: // localhost: 8080 / html / , I got my game in the browser
  • Click the Dev Mode On button, which is located in the bookmarks bar, I have an option to compile

Now I need to deploy my html project

I am running ./gradlew html:dist in Android Studio Terminal

I got a BUILD SUCCESSFUL in the terminal, then I found the dist folder inside my html module.

dist is inside the html module -> build -> dist

I copied the dist folder and deployed it to my server.

EDIT 2

Make sure that badlogic.jpg is in the folder with your resources in the Android module

Check the entry in the assets.txt file and find badlogic.jpg inside the html module->war->assets . If the file or record does not exist.

Somehow the program cannot write to the resource folder

  • Check which programs open the / s file
  • Check access rights and administrator rights
  • Delete the cache files, run "gradlew html: clean html: superDev" for each new launch of superDev.
  • Check antivirus software, they may indicate GWT behavior as suspicious
+3
source

Source: https://habr.com/ru/post/1267330/


All Articles