Search code examples
javamavenintellij-ideaplayn

New generated Maven PlayN project displays errors on android screen


after hours and hours of search to get it running I'm stuck now. So what happened? I tried to dive into the PlayN framework to code my first game on android. With a little struggle I generated my first project with maven (because apparently some versions aren't available in the maven repo) so I used the newest version of the playn-archetype:

mvn archetype:generate -DarchetypeGroupId=com.googlecode.playn -DarchetypeArtifactId=playn-archetype -DarchetypeVersion=1.7.1

which generated my project neatly. Then I changed the Android SDK to 17 instead of the generated 11 and run the project. But instead of the background image which is in the assets project of PlayN I only get a black screen with a little box in the corner of my Phone which contains ERROR ERROR. Neither LogCat or any other Logging feature in IntelliJ-IDEA showed any exception or error so far. here is a picture of the screen

Has anyone encountered and fixed this problem? Thank you for your help!

Stuff I'm using:

  • Android SDK 17
  • Java Development Kit 7 update 25
  • IntelliJ IDEA 12

Solution

  • So I found a solution for this with the help of the guys on googlecode.

    first of I needed to set the Variables to the different things I use: (to complete the picture I will write all my variables I added)

    set %JAVA_HOME% to your Java folder (should be JDK 1.6) add to Path %JAVA_HOME%\bin

    set %ANDROID_HOME% to your Android SDK folder add to Path %ANDROID_HOME%\tools and %ANDROID_HOME%\platform-tools

    set %M2_HOME% to your Maven folder add to Path %M2_HOME%\bin

    let maven generate your project with the playn-archetype

    mvn archetype:generate -DarchetypeGroupId=com.googlecode.playn -DarchetypeArtifactId=playn-archetype -DarchetypeVersion=1.7.1

    then add to the top-level pom (MyGame\pom.xml) the following code (text in double star is the things you must add)

    <properties>
       <playn.version>1.7.1</playn.version>
       **<android.maven.version>3.6.0</android.maven.version>**
    </properties>
    

    and

    <modules>
       <module>assets</module>
       <module>core</module>
       **<module>android</module>**
    </modules>
    

    now you can run the project with

    mvn install -pl android -am

    and run it on your phone with

    mvn -f android\pom.xml android:run

    This should do the trick and if your phone is connected to the computer the android project with the background image should be visible on the display.