6

I am not able to create an "App Engine Connected Android Project" by wizard in Eclipse anymore. When I click the "Finish" button, the following error message appears:

Creation of element failed.

com.android.ide.eclipse.adt.internal.project.AndroidNature.setupProjectNatures(Lorg/eclipse/core/resources/IProject;Lorg/eclipse/core/runtime/IProgressMonitor;)V

I use:

  • Windows 7 (x64)
  • Eclipse Juno 4.2
  • jre7
  • Google App Engine SDK 1.8.0.
  • Android SDK API 8 and 17

It's a fresh installation. Before new install of Eclipse it worked. I have also inserted correct values for "Project Number" and "API Key".

The wizard only creates one file named ".project" with following content:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>Test</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
    </buildSpec>
    <natures>
    </natures>
</projectDescription>

Exception Stack Trace:

java.lang.reflect.InvocationTargetException
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421)
    at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1028)
    at org.eclipse.jdt.internal.ui.wizards.NewElementWizard.performFinish(NewElementWizard.java:134)
    at com.google.gdt.eclipse.mobile.android.wizards.NewAndroidCloudProjectWizard.performFinish(NewAndroidCloudProjectWizard.java:111)
    at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:827)
    at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:432)
    at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
    at org.eclipse.jface.window.Window.open(Window.java:801)
    at org.eclipse.ui.internal.handlers.WizardHandler$New.executeHandler(WizardHandler.java:259)
    at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:279)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:290)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:76)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:231)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:212)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:131)
    at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:171)
    at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:515)
    at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:157)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1053)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Caused by: java.lang.NoSuchMethodError: com.android.ide.eclipse.adt.internal.project.AndroidNature.setupProjectNatures(Lorg/eclipse/core/resources/IProject;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    at com.google.gdt.eclipse.mobile.android.wizards.helpers.AndroidProjectCreator.create(AndroidProjectCreator.java:121)
    at com.google.gdt.eclipse.mobile.android.wizards.NewAndroidCloudProjectWizard.finishPage(NewAndroidCloudProjectWizard.java:170)
    at org.eclipse.jdt.internal.ui.wizards.NewElementWizard$2.run(NewElementWizard.java:118)
    at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39)
    at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:5204)
    at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:106)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Root exception:
java.lang.NoSuchMethodError: com.android.ide.eclipse.adt.internal.project.AndroidNature.setupProjectNatures(Lorg/eclipse/core/resources/IProject;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    at com.google.gdt.eclipse.mobile.android.wizards.helpers.AndroidProjectCreator.create(AndroidProjectCreator.java:121)
    at com.google.gdt.eclipse.mobile.android.wizards.NewAndroidCloudProjectWizard.finishPage(NewAndroidCloudProjectWizard.java:170)
    at org.eclipse.jdt.internal.ui.wizards.NewElementWizard$2.run(NewElementWizard.java:118)
    at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39)
    at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:5204)
    at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:106)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

Session Data:

eclipse.buildId=M20130204-1200
java.version=1.7.0
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product
tshepang
  • 10,772
  • 21
  • 84
  • 127
  • having the exact same problem :( – sharath May 19 '13 at 05:49
  • I have also tried on Linux... same error... –  May 19 '13 at 09:18
  • I am using App Engine 1.8.0, on MAC. No luck :( – sharath May 19 '13 at 20:14
  • 1
    @paypalcomp: If you don't place value on the pre-generated GCM messaging stuff, you can just create a normal Android application and then generate a GAE backend from this (right click on project -> Google -> Generate App Engine Backend...). But you have to execute the Android app at least once before generating the backend, otherwise it won't work. –  May 19 '13 at 21:10
  • 1
    Turns out there was a change in the android ADT for AndroidNature.setupProjectNatures function (added a third parameter), so there's a mismatch between the ADT and GPE tools. As @Gargamel says, you can create an android project and then add a GAE backend. I don't know why it wouldn't work without executing the android application first. What's different is that you have to change the main activity to launch the "RegisterActivity" (these instruction should be in the comments of RegisterActivity.java) after you generate the backend. – loosebazooka May 23 '13 at 17:35
  • I just upgraded eclipse appengine 1.8 and now am having the same problem. I am using mac osx mountain lion with juno. Basically my work is on hold. – Konsol Labapen Jun 05 '13 at 03:22

1 Answers1

0

I have the same problem too. I updated the android sdk and from that moment I no longer was able to compile my project because of the error "R can not be resolved." I tried to create a new connected project but I get the error we're talking about in this thread.

@Gargamel: If I create a new Android project using the wizard I get the error "R can not be resolved."

I have to deliver this project within 20 days and does not work anymore. I believe that returning to the old version of the SDK you can solve the problem, but I have not yet had the opportunity to try...

  • 1
    I tried but it did not work. To fix I had to install the "Android SDK Build-tools" from the Android SDK Manager. Now everything seems to work! – Alberto Nuti May 20 '13 at 14:54
  • I installed the build tool. It's not working. Did you do something specific beyond the build tool installation? – Konsol Labapen Jun 05 '13 at 03:24