PlayN android dex issue after update to 1.7

42 views
Skip to first unread message

chen...@gmail.com

unread,
May 10, 2013, 5:26:28 AM5/10/13
to pl...@googlegroups.com
Hi!

I've recently updated a PlayN project I'm working on from 1.6 to 1.7. I've made the changes described in the migration wiki page and tested the Java build - which works fine.

I then tried deploying the project to my Nexus 7 (Android 4.2.2) but am seeing a NoSuchMethodError in AndroidGLContext.paint shortly after launch which crashes the app. After a hour or so tearing my hair out I noticed that the default-dex step of the android maven build was including both playn-core-1.6.jar and playn-core-1.7.jar in the build!

I've since trawled through all of the files in my project making sure that there are no remaining references to PlayN 1.6. I've also tried deleting the 1.6 folder from my local .m2 repo but found it was re-downloaded during the maven build.

My question is - where does the dex step get its configuration from and how do I go about removing the playn-core-1.6.jar from the deployment?

Any help will be very much appreciated :)

Michael Bayne

unread,
May 10, 2013, 10:39:24 AM5/10/13
to pl...@googlegroups.com
On Fri, May 10, 2013 at 2:26 AM, <chen...@gmail.com> wrote:
I've since trawled through all of the files in my project making sure that there are no remaining references to PlayN 1.6. I've also tried deleting the 1.6 folder from my local .m2 repo but found it was re-downloaded during the maven build.

My question is - where does the dex step get its configuration from and how do I go about removing the playn-core-1.6.jar from the deployment?

Run:

mvn clean package -Pandroid -X

and at some point in the massive wall of debug output, you'll see a block like this:

[DEBUG] com.googlecode.playn:playn-showcase-android:apk:1.0-SNAPSHOT
[DEBUG]    com.googlecode.playn:playn-showcase-core:jar:1.0-SNAPSHOT:compile
[DEBUG]       com.googlecode.playn:playn-jbox2d:jar:1.7:compile
[DEBUG]          org.jbox2d:jbox2d-library:jar:2.2.1.1:compile
[DEBUG]       com.googlecode.playn:playn-core:jar:1.7:compile
[DEBUG]          com.samskivert:pythagoras:jar:1.3.2:compile
[DEBUG]       com.threerings:tripleplay:jar:1.7:compile
[DEBUG]          com.threerings:react:jar:1.3.1:compile
[DEBUG]    com.googlecode.playn:playn-android:jar:1.7:compile
[DEBUG]       org.java-websocket:Java-WebSocket:jar:1.3.0:compile
[DEBUG]    com.googlecode.playn:playn-android-nativelib:so:1.0:runtime
[DEBUG]    com.google.android:android:jar:4.1.1.4:provided
[DEBUG]       commons-logging:commons-logging:jar:1.1.1:provided
[DEBUG]       org.apache.httpcomponents:httpclient:jar:4.0.1:provided
[DEBUG]          org.apache.httpcomponents:httpcore:jar:4.0.1:provided
[DEBUG]          commons-codec:commons-codec:jar:1.3:provided
[DEBUG]       org.khronos:opengl-api:jar:gl1.1-android-2.1_r1:provided
[DEBUG]       xerces:xmlParserAPIs:jar:2.6.2:provided
[DEBUG]       xpp3:xpp3:jar:1.1.4c:provided
[DEBUG]       org.json:json:jar:20080701:provided
[DEBUG]    junit:junit:jar:4.11:test
[DEBUG]       org.hamcrest:hamcrest-core:jar:1.3:test

Those are all of your APK dependencies, arranged in a hierarchy so that you can see what is bringing in what dependency. However, Maven automatically "resolves" conflicting dependencies on a library with the same groupId and artifactId but different version, so it would be *extremely* weird for you to end up with two copies of com.googlecode.playn:playn-core:jar.


chen...@gmail.com

unread,
May 10, 2013, 1:45:23 PM5/10/13
to pl...@googlegroups.com
Thanks Michael,

Using that command from the command line seems to work fine. My app even deploys and runs correctly on my Nexus when I add the install target to the command line. 

Running the maven build from within Intellij still results in both versions of playn being used in the default-dex target. Thats not PlayNs problem so I won't solve it here (though I'll post a solution here if I find one).

I'm back on track! Thanks very much for your help!
Reply all
Reply to author
Forward
0 new messages