Search code examples
androidgoogle-app-engineeclipse-pluginruntimeexception

App Engine Connected Android Wizard stops at a RuntimeException


I'm following the https://developers.google.com/eclipse/docs/appengine_connected_android tutorial, and my Eclipse stops at RuntimeException (log below) when I click the "Say Hello" button.

Tools

Windows 7 64bits
eclipse indigo SR2
android-sdk rev 19
android 2.3.3 API 10
app engine sdk 1.6.5
gwt 2.4.0
jdk1.7.0_04
EDIT Solution: use Java 6

Log

05-05 02:32:48.501: W/dalvikvm(523): threadid=9: thread exiting with uncaught exception (group=0x40015560)
05-05 02:32:48.501: E/AndroidRuntime(523): FATAL EXCEPTION: AsyncTask #1
05-05 02:32:48.501: E/AndroidRuntime(523): java.lang.RuntimeException: An error occured while executing doInBackground()
05-05 02:32:48.501: E/AndroidRuntime(523):  at android.os.AsyncTask$3.done(AsyncTask.java:200)
05-05 02:32:48.501: E/AndroidRuntime(523):  at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
05-05 02:32:48.501: E/AndroidRuntime(523):  at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
05-05 02:32:48.501: E/AndroidRuntime(523):  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
05-05 02:32:48.501: E/AndroidRuntime(523):  at java.util.concurrent.FutureTask.run(FutureTask.java:138)
05-05 02:32:48.501: E/AndroidRuntime(523):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
05-05 02:32:48.501: E/AndroidRuntime(523):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
05-05 02:32:48.501: E/AndroidRuntime(523):  at java.lang.Thread.run(Thread.java:1019)
05-05 02:32:48.501: E/AndroidRuntime(523): Caused by: java.lang.RuntimeException: The RequestFactory ValidationTool must be run for the com.MyApp.client.MyRequestFactory RequestFactory type
05-05 02:32:48.501: E/AndroidRuntime(523):  at com.google.web.bindery.requestfactory.vm.impl.Deobfuscator$Builder.load(Deobfuscator.java:59)
05-05 02:32:48.501: E/AndroidRuntime(523):  at com.google.web.bindery.requestfactory.vm.InProcessRequestFactory.<init>(InProcessRequestFactory.java:80)
05-05 02:32:48.501: E/AndroidRuntime(523):  at com.google.web.bindery.requestfactory.vm.RequestFactorySource.create(RequestFactorySource.java:43)
05-05 02:32:48.501: E/AndroidRuntime(523):  at com.MyApp.Util.getRequestFactory(Util.java:158)
05-05 02:32:48.501: E/AndroidRuntime(523):  at com.MyApp.MyAppActivity$2$1.doInBackground(MyAppActivity.java:144)
05-05 02:32:48.501: E/AndroidRuntime(523):  at com.MyApp.MyAppActivity$2$1.doInBackground(MyAppActivity.java:1)
05-05 02:32:48.501: E/AndroidRuntime(523):  at android.os.AsyncTask$2.call(AsyncTask.java:185)
05-05 02:32:48.501: E/AndroidRuntime(523):  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
05-05 02:32:48.501: E/AndroidRuntime(523):  ... 4 more

I've tried

  • Googling around for solutions.
  • Doing the hacks described in the tutorial (e.g. proguard.cfg hack, renaming 'lib' to 'libs' hack)
  • Doing the hacks described in http://code.google.com/p/google-web-toolkit/wiki/RequestFactoryInterfaceValidation , but they were already set by default.
  • Doing the non-sense stuff programmers do when they are desperate (reinstalling the tools, rebooting the machine, moving directories around, etc)

Rant

I'm seriously disappointed with Google for providing such a unhelpful tool, I've seen that it's common for people to have problems with this particular wizard. It's a simple "Hello World" wizard, working just out of the box would be the least to expect.

As a side question, is there any other good resource/example to help learn how to sync data between the App Engine and an Android App? If there is no simple solution to make this "Hello World" work, then it's nothing but a waste of time.

EDIT Solved. When the sample project is up and running, it's actually quite nice.


Solution

  • As you discribed you have attached the requestfactory-apt.jar to Java Compiler/annotation processing/factory path in the Android App.

    • Update to App Engine SDK 1.6.5.1 if you not allready have the newest Version.

    • Make Project Clean... on your Project.

    • Use Java 6, App Enginge doesn't support Java 7 yet.