0

I've got some AIDL files which I want to include in a project, however Eclipse seems to work differently on different projects.

I'm developing an SDK for an application, and in the SDK android project the AIDL file generates the correct .java file, but in the main application Eclipse is not even attempting to build it.

Update: I found a log file and it says this:

!ENTRY com.android.ide.eclipse.adt 4 0 2012-04-21 19:22:11.043
!MESSAGE Failed to run one of the source processor
!STACK 0
java.lang.NullPointerException
    at com.android.ide.eclipse.adt.internal.build.AidlProcessor.doCompileFiles(AidlProcessor.java:109)
(include rest of stack here...)

Joe

Joe Simpson
  • 2,546
  • 4
  • 30
  • 46

3 Answers3

1

I had this exact issue happen to me today. It turns out this happens when there are source folders in your project that do not actually exist.

So verify in your project Java Build Path that all source folders actually exist. After removing a dead source folder link from there my project once again compiled the aidl.

user931366
  • 674
  • 5
  • 9
0

From my experience you create the .aidl file in your project (make sure your included packages are correct - you will get an error if not). If the .aidl file is good a .java file will be created in the gen/ directory under the correct package name.

Next you must connect your java code to the interface using

<YourAidlClassName>.Stub myAidlInterface = new <YouAidlClassName>.Stub() {

    // Your AIDL interface methods will appear in here and can now be used
    // in your application as myAidlInterface.methodName();
}

Hope this helps.

jjNford
  • 5,170
  • 7
  • 40
  • 64
  • I'm using the same file copied from another which it attempts to compile, but in the main app it just doesn't even give an error. – Joe Simpson Apr 21 '12 at 20:34
  • copied from another? make sure the .aidl file has all the correct package names or it will not compile. – jjNford Apr 21 '12 at 21:08
  • Yeah, it's under the correct package name. It just doesn't even attempt to build it though :( – Joe Simpson Apr 21 '12 at 21:30
  • Usually it there will be an error - if not it should be build if its an android project. It will be in the gen/ folder under the correct package name. If should have the same class name as your .aidl file. Try to do a project->clean then right click the project and do android->fix project – jjNford Apr 21 '12 at 21:47
  • hmmm... you could try to delete your eclipse settings by removing the .metadata folder in the workspace location and restarting eclipse. maybe a setting was changed. – jjNford Apr 21 '12 at 22:36
  • I kind of already did this. I had the same issue on another machine. – Joe Simpson May 04 '12 at 21:29
0

Okay, I don't understand this but for some reason 12.04 of ubuntu flagged up an error.

On one project I could called the file IAPPNAMEConect.aidl but the other wanted it as IAPPNAMEService.aidl

I completely forgot about Java's strictness there

Joe Simpson
  • 2,546
  • 4
  • 30
  • 46