Why can't I resolve the imports and compile sketch ?

I tried to blink an LED using an arduino ADK and a sony ericsson xperia play running android 2.3.4 following the simple tutorial found here Android ADK: How To Blink an LED Code and Explanation on the android side everything is ok but I get these errors on compiling the sketch:

D:\arduino-0023\libraries\AndroidAccessory/AndroidAccessory.h:37: error: ‘EP_RECORD’ does not name a type
D:\arduino-0023\libraries\AndroidAccessory/AndroidAccessory.h:50: error: ‘EP_RECORD’ has not been declared
D:\arduino-0023\libraries\AndroidAccessory/AndroidAccessory.h:50: error: ‘EP_RECORD’ has not been declared
D:\arduino-0023\libraries\AndroidAccessory/AndroidAccessory.h:64: error: ‘USB_NAK_LIMIT’ was not declared in this scope

I imported all the libraries and I tried compiling on arduino IDE version 0022, 0023 and 1.0 with the same results. Please help me! :frowning:

Are they absolutely the only errors you get? Scroll back up and see if there are more. A Google for "error: 'EP_RECORD' does not name a type" returns quite a few matches.

I was also getting WProgram.h not found error but then I found this edit which resolved that error :

#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif

I had to edit the AndroidAccessory.h

Looks like its a library bug, you have to manually #include <Usb.h> before the #include <AndroidAccessory.h> since the latter depends on the former but doesn't do its own #include.

I tried importing everything and importing AndroidAccessories.h the last and I get the same errors

#include <address.h>
#include <adk.h>
#include <avrpins.h>
#include <cdcacm.h>
#include <cdcftdi.h>
#include <cdcprolific.h>
#include <confdescparser.h>
#include <hexdump.h>
#include <hid.h>
#include <hidboot.h>
#include <hidescriptorparser.h>
#include <hiduniversal.h>
#include <hidusagestr.h>
#include <max3421e.h>
#include <max_LCD.h>
#include <message.h>
#include <parsetools.h>
#include <printhex.h>
#include <Usb.h>
#include <usbhost.h>
#include <usbhub.h>
#include <usb_ch9.h>
#include <AndroidAccessory.h>