Friday, November 25, 2011

Ouch! The pains of a new installation

If you read my previous post, you'll discover I'm not a fan of Dell.  Given the poor customer support from Dell, I switched companies opted for an ASUS G53S laptop.  This has been working nicely so far.  The intent has been to get a portable machine that satiates my gaming needs as well as works for dev efforts... I bring my laptop to work and work on personal stuff over the lunch hour.

Well, starting yesterday I began working on getting the laptop loaded up with my project and the necessary tools to build my game, DB42.  Oi!  What pain!  I've finally got things working and thought I'd post my experiences here for future reference and in the event it might help someone else out.

A bit of background first.  I'm using Eclipse and the Android SDK.  I've forked the libgdx project into my own distribution with a couple of tweaks here and there.  I also don't have to worry completely about relying on a specific nightly build since I've got a snapshot of things.  This means that I also have the support tools for *that* installed -- the Android NDK, MinGW for compiling, Cygwin & ant for building.

So, the first thing I did was install the latest and greatest Eclipse 3.7.1 (codenamed Indigo).  This went off fine.  Next up was TortoiseHG 2.2 so I could pull my repo from the hosting site I'm using.  First problem encountered.  After installing this, I noticed that the icon overlays were missing on the root directory folders.  WTF. Even a reboot did not correct this.  The sub-directories seemed to be ok, but there was no indication on the root as to "no change" or "modifications".  So, I downgraded to 2.1.4.  This cleared up that problem.

Next up was the installation of Android SDK r15.  Downloading as a snap.  Installing the ADT was pretty simple as well (done from within Eclipse). 

After getting all of that going (which took a while -- installing the various Android components results in a pretty big download), I ran into a snag.  I first cloned my repo to my hard drive.  Then, I tried to import the various components.  Instead of giving me a source folder and sub-packages, Eclipse showed everything as a package.  For example, instead of the hierarchy of "src" with "com.gushikustudios.db42lite" as a package, I saw the package "".  I don't know what was up with that, but it hosed the build.  To correct that, all you have to do is right-click on the project > New > Source Folder > src.  For whatever reason, that corrected the layout.

Next up were errors with the project.  I have no clue why, but my project settings were missing.  I had to right-click on the project > properties > Java Build Path.  Here I had to do several things: Add Library > JRE System Lib (which was missing for whatever reason.)  Project references were missing.  Recall that I've got my own build of libgdx, so I reference the project instead of  things like gdx.jar.  My lib settings were also missing, so I had to reference a lib that I have copied in my libs dir.


After correcting all of that, I tried to build my Android project and get an .apk file.  Nothing.  No apk file or anything produced in the bin/ sub-directory.  It turns out that this behavior is the new default for the latest ADT.  To 'fix' this, in Eclipse go to Window > Preferences > Android > Build > deselect the 'Skip packaging' check box.  I also changed build output from 'silent' to normal.  That fixed that problem and I was able to produce an .apk file.

Next up was the desktop build of gdx.  I failed to realize that the resulting gdx.dll that I created referenced other dlls that I didn't have installed on my new laptop.  Oh no, of course when you try to execute, the JVM doesn't give you any sort of error that is helpful in any way.  I kept getting "UnsatisfiedLinkError" / "Can't find dependent libraries" errors.  Great -- which dependent libraries can't you find?  I mean, throw me a bone here.  After poking around in the gdx.dll, it turned out that there were dynamic references to some build dlls: libstdc++-6.dll & libgcc_s_dw2-1.dll.  Oops.  Of course, I didn't discover this until after a couple of hours troubleshooting.

All I had to do was install MinGW and reboot and all was fine.  Very frustrating, but things are finally starting to work.

No comments:

Post a Comment