Fresh generated maven PlayN project displays black screen on android device

294 views
Skip to first unread message

frederi...@gmail.com

unread,
Jun 19, 2013, 2:38:27 PM6/19/13
to pl...@googlegroups.com
Hello everyone,

so I'm testing PlayN right now to develope a game for android. I've tried some frameworks before but none of them got me to the point where I actually liked it. I hope PlayN will be different (but so far it doesn't do a good job).

I used maven to generate the PlayN project structure, which was frankly a pain in the a** because none of the archetype versions in the PlayN documentation are available in the maven repository (at least none of them worked), finally I found the 1.7.1 version which created me the project without building or downloading errors.

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

Now I imported it into IntelliJ IDEA and I've got some errors which weren't that complicated. The only error I've got was that the android SDK version 11 couldn't be found, which is understandable because I've got the 17 version installed.
Since there where no more Errors I tried it on my Galaxy S3 and all I got was this Screen. Since there is absolutely no error, exception or warning even logCat doesn't say anything and the building process is working fine, I'm pretty stuck on what to do now ....


Any Ideas?

I posted this on Stackoverflow but there is no Answer yet. So if you want you can leave me a Suggestion there

Brigt Vik

unread,
Jun 19, 2013, 3:31:16 PM6/19/13
to pl...@googlegroups.com, frederi...@gmail.com
As far as I can see your image is not included into the APK you generated. Try changing the Android settings in IDEA. You get there with Ctrl+Alt+Shift+S => Modules => [myproject]-android => Android.

If your game folder is /Homegrown/playN/mygame/, you probably have these settings there:

Manifest: /Homegrown/playN/mygame/android/AndroidManifest.xml
Resources: /Homegrown/playN/mygame/android/res
Assets: /Homegrown/playN/mygame/android/assets
Natives: /Homegrown/playN/mygame/android/libs

Change the Assets setting to /Homegrown/playN/mygame/assets/src/main/resources/assets. Rebuild your project and install on your device. If that doesn't work, unpack the APK (it's a zip file) somewhere and verify that your assets are actually in the APK.

Brigt Vik

unread,
Jun 19, 2013, 3:32:41 PM6/19/13
to pl...@googlegroups.com, frederi...@gmail.com
Oh and by the way, if you're developing on Windows like me, you should check for capitalization errors between your image file and the code loading the image. I spent several hours looking at those ERROR ERROR ERROR images due to that =(.

Daniel Gerson

unread,
Jun 19, 2013, 3:37:43 PM6/19/13
to pl...@googlegroups.com, frederi...@gmail.com
Try and see if you can install it from the command line with Maven.

May not be the same with IntelliJ, but sometimes there are all sorts of problems with Eclipse to behave itself in the same fashion as the default Maven tool.

Like Brigt said, it sounds like an asset missing problem, given that something does actually run.

I think you have to bear in mind that PlayN has to function on many different OSs, IDEs, target platforms & target hardware, and given that it is simply an opensource project... it's unlikely that you'll get commercial level experience out the box.

DMG :-)

frederi...@gmail.com

unread,
Jun 19, 2013, 4:30:30 PM6/19/13
to pl...@googlegroups.com, frederi...@gmail.com
Thank you for your reply and I tried it immediately but it didn't work.

But I've got a hint now since I got some missing libs in the Project Structure which are the mygame-core project,sources and javadoc jar. so I think I just need to build them before I install the android project on my phone.

So I tried the following:
1. run mvn android:install on the cmd like Daniel Gerson suggested but produced the same result
2. I added pre-launch maven goals (clean and package) to the run configuration which point to the mygame-core project to build the core project and hopefully get all necessary dependencies.
3. also added the path to the jars to the Project Structure -> Settings -> Libraries -> mygame-core
4. I removed the .m2 path and added the pathes in the target folder of the mygame-core project
still same result
5. changed the package goal to install and pointed the libraries in project structure to my m2 repo
and still the same result

Okay. I have no Idea what is wrong.
@Brigt Vik
I didn't even touched the code yet that is all generated.

Daniel Gerson

unread,
Jun 19, 2013, 4:57:50 PM6/19/13
to pl...@googlegroups.com, frederi...@gmail.com
So I loaded exactly the same archetype that you did. Loaded perfectly on my Nexus 7 from the command line.

Take a look at the log and the directory tree and see if you can find anything out of order with your setup.

DMG :-)
PlayN-installLog.txt
dirTree.txt

frederi...@gmail.com

unread,
Jun 19, 2013, 5:28:21 PM6/19/13
to pl...@googlegroups.com, frederi...@gmail.com
okay
- i dont have the assets folder in the android project
-  also all your stuff in C:\tmp\fresh\android\target ... ive got only generated sources

i will try to generate the project again and try to get it running without importing it into intelliJ

frederi...@gmail.com

unread,
Jun 19, 2013, 5:36:39 PM6/19/13
to pl...@googlegroups.com, frederi...@gmail.com
Freshly generated ...
mvn -Pandroid install
Build Failure on android project
ANDROID_HOME is set as var and in path var
I even tried -Dandroid.sdk.path=
...
nothing

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.280s
[INFO] Finished at: Wed Jun 19 23:34:09 CEST 2013
[INFO] Final Memory: 15M/436M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.0:generate-sources (default-generate-sources) on project DefendYourSheeps-android: Execution defaul
t-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.0:generate-sources failed: Could not find tool 'aapt'. Please provide a proper Android SDK directory pa
th as configuration parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an alternative, you may add the parameter to commandline: -Dandroid.sdk.path=... or set environment variabl
e ANDROID_HOME. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.0:generate-sources (default-generate-sources) on pr
oject DefendYourSheeps-android: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.0:generate-sources failed: Could not find tool 'aapt'.
Please provide a proper Android SDK directory path as configuration parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an alternative, you may add the parameter to commandline: -
Dandroid.sdk.path=... or set environment variable ANDROID_HOME.
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.0:generate-sources failed:
 Could not find tool 'aapt'. Please provide a proper Android SDK directory path as configuration parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an alternative, you may add th
e parameter to commandline: -Dandroid.sdk.path=... or set environment variable ANDROID_HOME.
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
Caused by: com.jayway.maven.plugins.android.InvalidSdkException: Could not find tool 'aapt'. Please provide a proper Android SDK directory path as configuration parameter <sdk><path>...</path></sdk> i
n the plugin <configuration/>. As an alternative, you may add the parameter to commandline: -Dandroid.sdk.path=... or set environment variable ANDROID_HOME.
        at com.jayway.maven.plugins.android.AndroidSdk.getPathForTool(AndroidSdk.java:196)
        at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:461)
        at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:193)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        ... 20 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command

Michael Bayne

unread,
Jun 19, 2013, 5:37:23 PM6/19/13
to pl...@googlegroups.com, frederi...@gmail.com

On Wed, Jun 19, 2013 at 2:36 PM, <frederi...@gmail.com> wrote:
Freshly generated ...
mvn -Pandroid install
Build Failure on android project
ANDROID_HOME is set as var and in path var
I even tried -Dandroid.sdk.path=

Brigt Vik

unread,
Jun 20, 2013, 2:49:06 AM6/20/13
to pl...@googlegroups.com, frederi...@gmail.com
I think following the instructions in Michael's link will make command line maven run correctly. For packaging in IDEA, probably not - it was at least not sufficient for me.

----------


"I didn't even touched the code yet that is all generated."
"i dont have the assets folder in the android project"

These are probably your problem with the lacking image when building with IDEA. The maven archetype would include a symbolic link from the android assets to the assets module if possible, but it cannot. So you need to do one of these:
* Create a symbolic link from android/assets to assets/src/main/resources/assets.
* Copy the contents of assets/src/main/resources/assets into android/assets. Not recommended, as you'll be adding more assets as you go and could forget to copy it at some point.
* Instruct IDEA about where your assets are, like I outlined in my previous post.

You did not state whether the APK generated through IDEA actually has the assets folder in it. You'll find it in android/target.

frederi...@gmail.com

unread,
Jun 20, 2013, 5:04:13 AM6/20/13
to pl...@googlegroups.com, frederi...@gmail.com
So I tried some ways to fix this problem but nothing actually worked

My Env. vars:
ANDROID_HOME = E:\Media\Programming\Tools\AndroidSDK\sdk
JAVA_HOME = C:\Program Files\Java\jdk1.7.0_25
M2 = %M2_HOME%\bin
M2_HOME = E:\Media\Programming\Tools\Maven
PATH = %M2%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;

1. tried to run in with these settings -> same error that I need to specify the sdk path
2. modified the mygame/pom.xml and added the profile for the android sdk -> new error (couldn't recognise the activeprofile tag which I deleted and tried again -> same error)
3. tried it with mvn -Pandroid install -Dandroid.sdk.path=E:\Media\Programming\Tools\AndroidSDK\sdk -> same error

I have no Idea or hint anymore what could be wrong the ANDROID_HOME var should work but it does not ...

Daniel Gerson

unread,
Jun 20, 2013, 6:01:30 AM6/20/13
to pl...@googlegroups.com, frederi...@gmail.com
You don't mention in the ways you tried that you actually tried the method from Michael's link


I.e. Did you try editing? C:\Users\USERNAME\.m2\settings.xml

with

  <profiles>
   
<profile>
     
<id>android-sdk</id>
     
<properties>
       
<android.sdk.path>
          PATH / TO / THE / ANDROID / SDK
       
</android.sdk.path>
     
</properties>
   
</profile>
 
</profiles>

 
<activeProfiles>
   
<activeProfile>android-sdk</activeProfile>
 
</activeProfiles>
</settings>

Daniel Gerson

unread,
Jun 20, 2013, 6:04:26 AM6/20/13
to pl...@googlegroups.com, frederi...@gmail.com
I understand that it should be the same as -D, but you never know... it's maven... :-/

frederi...@gmail.com

unread,
Jun 20, 2013, 6:18:12 AM6/20/13
to pl...@googlegroups.com, frederi...@gmail.com
since i don't have the settings.xml in my m2 directory i created it and copied the code and used my sdk path ... still same error.

Setting up a Ubuntu VM to get this sh*t working now ... i hope linux isn't letting me down like the other times

frederi...@gmail.com

unread,
Jun 20, 2013, 5:55:11 PM6/20/13
to pl...@googlegroups.com, frederi...@gmail.com
Okay after some struggle with setting it all up on ubuntu I'm now finished.


[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.0:generate-sources (default-generate-sources) on project DefendYourSheeps-android: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.0:generate-sources failed: Could not find tool 'aapt'. Please provide a proper Android SDK directory path as configuration parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an alternative, you may add the parameter to commandline: -Dandroid.sdk.path=... or set environment variable ANDROID_HOME. -> [Help 1]

still get the same error
  • sdk is set in the maven settings.xml
  • export JAVA_HOME=/usr/lib/jvm/java-7-oracle
  • export ANDROID_HOME=/home/daraku/Programming/Tools/AndroidSDK/sdk
  • export PATH=${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${PATH}

and it still doesn't want to build, but why?

Daniel Gerson

unread,
Jun 20, 2013, 6:22:29 PM6/20/13
to pl...@googlegroups.com, frederi...@gmail.com
Don't know if this will help.

There isn't a more simple helloworld.
So perhaps you can compare and see, might give clues? It uses a different version of the android maven plugin...

DMG

frederi...@gmail.com

unread,
Jun 21, 2013, 7:00:02 AM6/21/13
to pl...@googlegroups.com, frederi...@gmail.com
still didn't help it seems that my maven got some problem with the android plugin. That is at least the thing I found out the last hours. Even though Android_home is set and everything in the PATH env Var is how it should be. Ubuntu VM doesn't work either because of crappy usability of the USB Port stuff. Now setting up a Windows 7 development VM which hopefully will run.

But I just can't understand it. all Env. Vars are set correctly and still maven doesn't know what android is...

Daniel Gerson

unread,
Jun 21, 2013, 7:10:26 AM6/21/13
to pl...@googlegroups.com, frederi...@gmail.com
It is weird that you got into exactly the same issue on both linux and windows. Bug in new release perhaps?
Just so you know this is the version of Maven I'm running. 

C:\Users\Daniel>mvn -v
Apache Maven 3.0.4 (r1232337; 2012-01-17 10:44:56+0200)
Maven home: C:\Managed\apache-maven-3.0.4
Java version: 1.6.0_25, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_25\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

frederi...@gmail.com

unread,
Jun 21, 2013, 7:17:43 AM6/21/13
to pl...@googlegroups.com, frederi...@gmail.com
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 14:51:28+0100)
Maven home: E:\Media\Programming\Tools\Maven
Java version: 1.7.0_25, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_25\jre
Default locale: de_DE, platform encoding: Cp1252

OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

Daniel Gerson

unread,
Jun 21, 2013, 7:25:14 AM6/21/13
to pl...@googlegroups.com, frederi...@gmail.com
Java 1.7 might be your problem. Try using 1.6
http://stackoverflow.com/questions/15848332/does-adt-support-java-7-api

Haven't even tried to use the 1.7 jdk, so maybe it's still possible to work... but I'd look there.

frederi...@gmail.com

unread,
Jun 21, 2013, 2:24:50 PM6/21/13
to pl...@googlegroups.com, frederi...@gmail.com
so ... now I'm pretty confused. Since my laptop just crashed I recovered him and setup a fresh development environment.
  1. installed Java JDK 1.6 u45 and set JAVA_HOME and appended to the Path variable %JAVA_HOME%\bin
  2. I installed the android SDK and set the ANDROID_HOME and appended to the Path variable %ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
  3. then I installed IntelliJ (which isn't really important right now)
  4. I downloaded maven 3.0.5 and set M2_HOME and appended to the Path variable %M2_HOME%\bin
  5. then I generated the project with mvn archetype:generate 
  6. I followed your suggestion with http://androidcookbook.com/Recipe.seam?recipeId=4137
  7. mvn clean install worked fine it run everything and a window opened with the background image (yay)
  8. then I did the mvn android:deploy and the only thing I get is the error I always get
ERROR] No plugin found for prefix 'android' in the current project and in the plugin groups [org.apache.maven.plugins,
org.codehaus.mojo] available from the repositories [local (C:\Users\Daraku\.m2\repository), codehaus.snapshots (http://s
napshots.repository.codehaus.org/), central (http://repo.maven.apache.org/maven2)] -> [Help 1]
  1.  so I remembered to do something with the settings.xml and set my android sdk path there.

Still same error.

here is the full stacktrace

[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] DefendYourSheepsGame Metaproject
[INFO] DefendYourSheepsGame Assets
[INFO] DefendYourSheepsGame Core
[INFO] DefendYourSheepsGame Java
[WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifec
ycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.
m2e:lifecycle-mapping:jar:1.0.0
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloading: http://snapshots.repository.codehaus.org/org/codehaus/mojo/maven-metadata.xml
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading: http://snapshots.repository.codehaus.org/org/apache/maven/plugins/maven-metadata.xml
Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (22 KB at 83.8 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml (11 KB at 41.1 KB/sec)
Downloaded: http://snapshots.repository.codehaus.org/org/codehaus/mojo/maven-metadata.xml (18 KB at 26.6 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] DefendYourSheepsGame Metaproject .................. SKIPPED
[INFO] DefendYourSheepsGame Assets ....................... SKIPPED
[INFO] DefendYourSheepsGame Core ......................... SKIPPED
[INFO] DefendYourSheepsGame Java ......................... SKIPPED


[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

[INFO] Total time: 2.100s
[INFO] Finished at: Fri Jun 21 11:21:58 CEST 2013
[INFO] Final Memory: 6M/90M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'android' in the current project and in the plugin groups [org.apache.maven.plugins,
org.codehaus.mojo] available from the repositories [local (C:\Users\Daraku\.m2\repository), codehaus.snapshots (http://s
napshots.repository.codehaus.org/), central (http://repo.maven.apache.org/maven2)] -> [Help 1]
org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: No plugin found for prefix 'android' in the current proj
ect and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Us
ers\Daraku\.m2\repository), codehaus.snapshots (http://snapshots.repository.codehaus.org/), central (http://repo.maven.a
pache.org/maven2)]
        at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolve(DefaultPluginPrefixResolver.java:94)
        at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.findPluginForPrefix(MojoDescriptorCreator.java:262)
        at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:222)
        at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:106)
        at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:86)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:98)


        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)


        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.


[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:

and here is my configuration, java versions and stuff that might be interesting.

Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 14:51:28+0100)
Maven home: D:\programming\tools\apache-maven-3.0.5
Java version: 1.6.0_45, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_45\jre

Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

Daniel Gerson

unread,
Jun 21, 2013, 2:52:04 PM6/21/13
to pl...@googlegroups.com, frederi...@gmail.com

  1. then I generated the project with mvn archetype:generate 
  2. I followed your suggestion with http://androidcookbook.com/Recipe.seam?recipeId=4137
  3. mvn clean install worked fine it run everything and a window opened with the background image (yay)
So I'm guessing you weren't even getting the background image in Java before? 
  1. then I did the mvn android:deploy and the only thing I get is the error I always get
ERROR] No plugin found for prefix 'android' in the current project and in the plugin groups [org.apache.maven.plugins,
org.codehaus.mojo] available from the repositories [local (C:\Users\Daraku\.m2\repository), codehaus.snapshots (http://s
napshots.repository.codehaus.org/), central (http://repo.maven.apache.org/maven2)] -> [Help 1]
  1.  so I remembered to do something with the settings.xml and set my android sdk path there.

Still same error.

 You can't deploy it from the top directory. Android plugin is only known by the pom in the android directory.
Try something like this from the top directory:

mvn install -pl android -am
mvn -f android/pom.xml android:run

The second command will use the android pom and hence know about the android plugin.

I'm feeling like a Maven King today (which I'm not). Levelling up.

DMG :-)

frederi...@gmail.com

unread,
Jun 21, 2013, 3:24:48 PM6/21/13
to pl...@googlegroups.com, frederi...@gmail.com
okay I tested your suggestions and it just don't work

shortly after sending the answer I tried to run the android project I got

[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.0:deploy (default-c
li) on project DefendYourSheeps-android: Execution default-cli of goal com.jayway.maven.plugins.android.generation2:andr
oid-maven-plugin:3.5.0:deploy failed: Could not find tool 'aapt'. Please provide a proper Android SDK directory path as

configuration parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an alternative, you may add the p
arameter to commandline: -Dandroid.sdk.path=... or set environment variable ANDROID_HOME. -> [Help 1]

still I got it everywhere set and it still doesn't work. Don't know why.

your commands produce the following.

mvn install -pl android -am -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[ERROR] Could not find the selected project in the reactor: android -> [Help 1]
org.apache.maven.MavenExecutionException: Could not find the selected project in the reactor: android
        at org.apache.maven.DefaultMaven.trimSelectedProjects(DefaultMaven.java:749)
        at org.apache.maven.DefaultMaven.createDependencyGraph(DefaultMaven.java:703)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:290)

        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:

mvn -f android/pom.xml android:run
well this works, kind of at least the project gets on my phone but instead of the background image I get the black screen with the errors.

so all the work to get back to the initial error xD

Daniel Gerson

unread,
Jun 21, 2013, 4:16:13 PM6/21/13
to pl...@googlegroups.com, frederi...@gmail.com


On Friday, June 21, 2013 9:24:48 PM UTC+2, frederi...@gmail.com wrote:


still I got it everywhere set and it still doesn't work. Don't know why.

your commands produce the following.

mvn install -pl android -am -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...

 The second command doesn't work properly because the first one failed.
Those commands are how we execute maven, but you have to enable android as a module in the parent pom.xml like so:
  <modules>
    <module>assets</module>
    <module>core</module>
    <module>android</module>
  </modules>

...we did it this way for easy compilation of only android.

DMG

frederi...@gmail.com

unread,
Jun 21, 2013, 4:44:10 PM6/21/13
to pl...@googlegroups.com, frederi...@gmail.com
wow playn-archetype didn't added this as module. well doesn't work either

[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.0:generate-sources
(default-generate-sources) on project DefendYourSheeps-android: Execution default-generate-sources of goal com.jayway.ma
ven.plugins.android.generation2:android-maven-plugin:3.5.0:generate-sources failed: Could not find tool 'aapt'. Please p

rovide a proper Android SDK directory path as configuration parameter <sdk><path>...</path></sdk> in the plugin <configu
ration/>. As an alternative, you may add the parameter to commandline: -Dandroid.sdk.path=... or set environment variabl
e ANDROID_HOME. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.jayway.maven.plugins.android.generati

on2:android-maven-plugin:3.5.0:generate-sources (default-generate-sources) on project DefendYourSheeps-android: Executio
n default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.0:generate-sour
ces failed: Could not find tool 'aapt'. Please provide a proper Android SDK directory path as configuration parameter <s

dk><path>...</path></sdk> in the plugin <configuration/>. As an alternative, you may add the parameter to commandline: -
Dandroid.sdk.path=... or set environment variable ANDROID_HOME.
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-generate-sources of goal com.jayway.maven
.plugins.android.generation2:android-maven-plugin:3.5.0:generate-sources failed: Could not find tool 'aapt'. Please prov

ide a proper Android SDK directory path as configuration parameter <sdk><path>...</path></sdk> in the plugin <configurat
ion/>. As an alternative, you may add the parameter to commandline: -Dandroid.sdk.path=... or set environment variable A
NDROID_HOME.

        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
Caused by: com.jayway.maven.plugins.android.InvalidSdkException: Could not find tool 'aapt'. Please provide a proper And

roid SDK directory path as configuration parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an alt
ernative, you may add the parameter to commandline: -Dandroid.sdk.path=... or set environment variable ANDROID_HOME.
        at com.jayway.maven.plugins.android.AndroidSdk.getPathForTool(AndroidSdk.java:196)
        at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.jav

a:461)
        at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:
193)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        ... 20 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :DefendYourSheeps-android

Michael Bayne

unread,
Jun 21, 2013, 4:45:24 PM6/21/13
to pl...@googlegroups.com, frederi...@gmail.com
On Fri, Jun 21, 2013 at 1:44 PM, <frederi...@gmail.com> wrote:
ces failed: Could not find tool 'aapt'. Please provide a proper Android SDK directory path as configuration parameter <s

This is because of a recent update to the Android SDK. You need to add:

  <properties>
    <android.maven.version>3.6.0</android.maven.version>
  </properties>

to your top-level POM, or use the latest 1.8-SNAPSHOT as built from github.com/threerings/playn.

-- m...@samskivert.com

frederi...@gmail.com

unread,
Jun 21, 2013, 5:20:49 PM6/21/13
to pl...@googlegroups.com, frederi...@gmail.com
no way ... its actually working ... I'm speechless now I only need to get it in IntelliJ working and then I can die in peace ... :)

frederi...@gmail.com

unread,
Jun 21, 2013, 5:24:47 PM6/21/13
to pl...@googlegroups.com, frederi...@gmail.com
okay everything is working ... woho thank you guys you were a big help. Thank you so much
Reply all
Reply to author
Forward
0 new messages