It is currently 19 Apr 2024, 15:04
   
Text Size

Running Forge App from Eclipse

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Running Forge App from Eclipse

Postby Joril » 09 Jul 2014, 22:17

Hi everyone!
I'm trying to run the new Android Forge App from Eclipse (inside an AVD of course). I imported the Maven projects and I get no errors inside the "Problems" tab, but when I launch the app I get a "Forge has stopped" and LogCat shows this:

Code: Select all
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{forge.app/forge.app.Main}: java.lang.ClassNotFoundException: forge.app.Main
I think I'm missing something obvious... :/
Many thanks!

(Eclipse 4.4 with OpenJDK 7 on Lubuntu 14.04)
Joril
 
Posts: 21
Joined: 14 Jul 2013, 19:42
Has thanked: 14 times
Been thanked: 0 time

Re: Running Forge App from Eclipse

Postby drdev » 10 Jul 2014, 03:40

You can't run forge-gui-android straight from Eclipse unfortunately due to its complex dependencies. If you want to just test something quick, you can run forge-gui-mobile-dev instead to open the app in a window on your desktop computer. Otherwise you'll need to run forge-gui-android as a Maven application with the following goals to build the .apk and deploy to your connected device or emulator:

-U -B clean -P android-debug install android:undeploy android:deploy

Note that you may need to first do a mvn clean install on the other modules in order to see their changes in effect on the deployed app.
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Running Forge App from Eclipse

Postby Joril » 10 Jul 2014, 19:18

Ok, so I did a "Run as maven clean" on every project and then "Run as maven build" specifying as "goals"
Code: Select all
-U -B clean -P android-debug install android:undeploy android:deploy
and here's what I get:
Code: Select all
[INFO] Scanning for projects...
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-gui-android/1.5.22-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml
[INFO] Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml (617 B at 3.0 KB/sec)
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Forge Android 1.5.22-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-core/1.5.22-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-game/1.5.22-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-game/1.5.22-SNAPSHOT/forge-game-1.5.22-SNAPSHOT.pom
[WARNING] The POM for forge:forge-game:jar:1.5.22-SNAPSHOT is missing, no dependency information available
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-ai/1.5.22-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-ai/1.5.22-SNAPSHOT/forge-ai-1.5.22-SNAPSHOT.pom
[WARNING] The POM for forge:forge-ai:jar:1.5.22-SNAPSHOT is missing, no dependency information available
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-net/1.5.22-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-net/1.5.22-SNAPSHOT/forge-net-1.5.22-SNAPSHOT.pom
[WARNING] The POM for forge:forge-net:jar:1.5.22-SNAPSHOT is missing, no dependency information available
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-gui/1.5.22-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-gui/1.5.22-SNAPSHOT/forge-gui-1.5.22-SNAPSHOT.pom
[WARNING] The POM for forge:forge-gui:jar:1.5.22-SNAPSHOT is missing, no dependency information available
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-gui-mobile/1.5.22-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-gui-mobile/1.5.22-SNAPSHOT/forge-gui-mobile-1.5.22-SNAPSHOT.pom
[WARNING] The POM for forge:forge-gui-mobile:jar:1.5.22-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for com.badlogicgames.gdx:gdx-backend-android:jar:1.2.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-game/1.5.22-SNAPSHOT/forge-game-1.5.22-SNAPSHOT.jar
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-ai/1.5.22-SNAPSHOT/forge-ai-1.5.22-SNAPSHOT.jar
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-net/1.5.22-SNAPSHOT/forge-net-1.5.22-SNAPSHOT.jar
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-gui/1.5.22-SNAPSHOT/forge-gui-1.5.22-SNAPSHOT.jar
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-gui-mobile/1.5.22-SNAPSHOT/forge-gui-mobile-1.5.22-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.582 s
[INFO] Finished at: 2014-07-10T21:13:31+01:00
[INFO] Final Memory: 17M/179M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project forge-gui-android: Could not resolve dependencies for project forge:forge-gui-android:apk:1.5.22-SNAPSHOT: The following artifacts could not be resolved: forge:forge-game:jar:1.5.22-SNAPSHOT, forge:forge-ai:jar:1.5.22-SNAPSHOT, forge:forge-net:jar:1.5.22-SNAPSHOT, forge:forge-gui:jar:1.5.22-SNAPSHOT, forge:forge-gui-mobile:jar:1.5.22-SNAPSHOT: Could not find artifact forge:forge-game:jar:1.5.22-SNAPSHOT in arcane-maven-repo (http://arcane.googlecode.com/svn/trunk/repository) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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/DependencyResolutionException
Sorry if I'm missing something obvious but I'm not familiar with Maven :(
Joril
 
Posts: 21
Joined: 14 Jul 2013, 19:42
Has thanked: 14 times
Been thanked: 0 time

Re: Running Forge App from Eclipse

Postby Joril » 10 Jul 2014, 19:55

I've made some progress... I did a "maven clean install" on the ForgeLocal project and it compiled everything successfully. Then I did the "android-debug" command above and now I get

Code: Select all
[INFO] Scanning for projects...
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-gui-android/1.5.22-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml
[INFO] Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml (617 B at 0.1 KB/sec)
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Forge Android 1.5.22-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-core/1.5.22-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-game/1.5.22-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-ai/1.5.22-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-net/1.5.22-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-gui/1.5.22-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-gui-mobile/1.5.22-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-gui-mobile/1.5.22-SNAPSHOT/forge-gui-mobile-1.5.22-SNAPSHOT.pom
[WARNING] The POM for forge:forge-gui-mobile:jar:1.5.22-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for com.badlogicgames.gdx:gdx-backend-android:jar:1.2.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO] Downloading: http://arcane.googlecode.com/svn/trunk/repository/forge/forge-gui-mobile/1.5.22-SNAPSHOT/forge-gui-mobile-1.5.22-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.368 s
[INFO] Finished at: 2014-07-10T21:53:26+01:00
[INFO] Final Memory: 17M/179M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project forge-gui-android: Could not resolve dependencies for project forge:forge-gui-android:apk:1.5.22-SNAPSHOT: Could not find artifact forge:forge-gui-mobile:jar:1.5.22-SNAPSHOT in arcane-maven-repo (http://arcane.googlecode.com/svn/trunk/repository) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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/DependencyResolutionException
Joril
 
Posts: 21
Joined: 14 Jul 2013, 19:42
Has thanked: 14 times
Been thanked: 0 time

Re: Running Forge App from Eclipse

Postby Joril » 10 Jul 2014, 20:04

Looks like I had to add "forge-gui-mobile" to the ForgeLocal pom.xml... Now I'm getting a "No Android SDK path could be found" but I think this will be easier to fix :D Thanks for your patience!
Joril
 
Posts: 21
Joined: 14 Jul 2013, 19:42
Has thanked: 14 times
Been thanked: 0 time

Re: Running Forge App from Eclipse

Postby Joril » 10 Jul 2014, 20:25

After adding a "android.sdk.path" property to the forge-gui-android pom.xml, deploying to the AVD works :)
Joril
 
Posts: 21
Joined: 14 Jul 2013, 19:42
Has thanked: 14 times
Been thanked: 0 time


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 46 guests


Who is online

In total there are 46 users online :: 0 registered, 0 hidden and 46 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 46 guests

Login Form