7

I tried deploying Libgdx to html using gradle. I copied the content

html/build/dist

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

Using the superdev I can open it in the browser, i see where it says drag this button but can't play it. there's 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 on I see Can't find any GWT Modules on this page.

If I build it normally, I see some warnings about depreciated methods, it builds successfully.

enter image description here

Assets aren't being loaded by html

Lynob
  • 5,059
  • 15
  • 64
  • 114

1 Answers1

5

I've few links that may be help you :

How to start Super Dev mode in GWT

Also check this thread https://stackoverflow.com/a/24265470/3445320

EDIT

I've tested on Android Studio with MacOS

Steps :

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

  • On Android Studio Terminal I run ./gradlew html:superDev command
  • I got The code server is ready at http://127.0.0.1:9876/ on terminal
  • Then I open Google Chrome, View -> Always Show Bookmarks Bar
  • I typed http://127.0.0.1:9876/ in adress field -> enter
  • I got a page having Dev Mode On and Dev Mode Off, two buttons
  • Drag Dev Mode On to bookmarks bar, that is below my Address bar
  • Done! now I search http://localhost:8080/html/ , I got my game in browser
  • Press Dev Mode On button that is in bookmarks bar, I got option for compile

Now I need to deploy my html project

I run ./gradlew html:dist in Android Studio Terminal

I got BUILD SUCCESSFUL in Terminal then I find dist folder inside my html module.

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

I copied dist folder and deployed to my server.

EDIT 2

Make sure badlogic.jpg is in your assets folder of android module

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

Somehow program not able to write in assets folder

  • Check what programs have the file/s open
  • Check permissions and administrative rights
  • Delete the cache files, run "gradlew html:clean html:superDev" for every new run of superDev.
  • Check any anti-virus software, they can flag some of GWT's behaviour as suspicious
Abhishek Aryan
  • 19,936
  • 8
  • 46
  • 65
  • the first link for eclipse, im using android studio – Lynob May 26 '17 at 14:53
  • try to run blank Libgdx project, that ensure you've some configuration problem or gwt API problem because All java Api not supported on GWT. – Abhishek Aryan May 26 '17 at 15:01
  • run `./gradlew html:superDev` on Android Studio Terminal – Abhishek Aryan May 26 '17 at 15:05
  • when I compile, I still get badlogic.png file not found, the last picture in my question – Lynob May 26 '17 at 16:26
  • have you cleaned your project ? – Abhishek Aryan May 26 '17 at 16:27
  • There is `assets.txt` file inside `html module->war->assets` folder that having entry of all of your resources that is in inside `android module assets` folder. – Abhishek Aryan May 26 '17 at 16:42
  • what should I do to it? delete it? or go through all my assets and put them in that file? lengthy process – Lynob May 26 '17 at 16:44
  • i restored the badlogic image, im on linux so no anti virus, I ran using sudo just to make sure I have all rights, now what i see is badlogic image with a red background so not the real game, what i see is like what u see when u first run libgdx..... cant find badlogic.jpg in assets.txt – Lynob May 28 '17 at 22:11