AIDL Cannot Find Parcelable Class Definition

I have the following project structure.

enter image description here

My StockInfo.java excellent.

StockInfo.java (no error)

 package org.yccheok.jstock.engine; import android.os.Parcel; import android.os.Parcelable; public class StockInfo implements Parcelable { ... ... 

StockInfo.aidl (no errors)

 package org.yccheok.jstock.engine; parcelable StockInfo; 

StockInfoObserver.aidl (Error!)

 package org.yccheok.jstock.engine; interface StockInfoObserver { void update(StockInfo stockInfo); } 

AutoCompleteApi.aidl (Error!)

 package org.yccheok.jstock.engine; interface AutoCompleteApi { void handle(String string); void attachStockInfoObserver(StockInfoObserver stockInfoObserver); } 

However, Eclipse complains about StockInfoObserver.aidl (it also complains about AutoCompleteApi.aidl because it cannot handle StockInfoObserver.aidl )

parameter stockInfo (1) unknown type StockInfo

I tried for an hour, but still could not find out why in helpl, StockInfo not recognized, although I had

  • Courtesy of StockInfo.aidl
  • Courtesy of StockInfo.java

Any idea?

Here are the complete errors.

enter image description here

Note. AutoCompleteApi.aidl is very dependent on StockInfoObserver.aidl . That is why you will see an error.

I share the whole project for your reference purpose: https://www.dropbox.com/s/0k5pe75jolv5mtq/jstock-android.zip

+4
source share
1 answer

According to Android documentation You must include an import statement for each additional type not listed above, even if they are defined in the same package as your interface

Try adding this line to StockInfoObserver.aidl

 import org.yccheok.jstock.engine.StockInfo; 
+6
source

All Articles