jmzorko
jmzorko

Reputation: 51

Android:Eclipse won't recognize AIDL file

I've looked and looked, but Eclipse (3.6, with the 2.2 Android SDK) just won't do anything with the AIDL file I created. The AIDL file is in the same place as the other source, following the Java style. I've read that Eclipse should just generate the stub for the interface declared in the AIDL file, but it doesn't appear in the gen folder, nor anywhere else i've seen, and the project doesn't build because the interface specified in the AIDL isn't found. I suspect i'm doing something silly or not understanding something, but as much as i've looked and tried, I still don't get it and Eclipse still fails.

My AIDL:

package com.example.helloandroid;

interface HOSPlayerInterface { public void playURL(String url); public boolean pause(); public boolean resume(); public void stop(); }

... and said AIDL lives in the com/example/helloandroid directory. Eclipse isn't recognizing it, highlighting syntax, running AIDL, etc. I'm at a loss. The Android plugin is installed and working, as i'm able to build and run simple Android projects that don't require AIDL. Any help would be appreciated.

Upvotes: 4

Views: 3763

Answers (2)

qinyu
qinyu

Reputation: 1071

Just remove all "public" access modifier before method declaration. The following code works in my project.

package com.example.helloandroid;

interface HOSPlayerInterface { 
    void playURL(String url); 
    boolean pause(); 
    boolean resume(); 
    void stop(); 
}

If the aidl file can not get compiling in Eclipse, delete "gen" folder and rebuild the project.

Upvotes: 2

mach
mach

Reputation: 8395

Any build errors? The IDE might exit prior to compiling your .aidl-file due to parse errors in XML or similar.

Upvotes: 1

Related Questions