Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AIDL unable to find the definition of a Parcelable class

I have the following project structure.

enter image description here

My StockInfo.java is perfectly fine.

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 error)

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 in StockInfoObserver.aidl (It does complain AutoCompleteApi.aidl too, as it cannot process StockInfoObserver.aidl),

parameter stockInfo (1) unknown type StockInfo

I tried for an hour, but still not able to find out, why in aidl, StockInfo is not being recognized although I had

  1. Provided StockInfo.aidl
  2. Provided StockInfo.java

Any idea?

Here are the complete errors.

enter image description here

Note, AutoCompleteApi.aidl is very much dependent on StockInfoObserver.aidl. That's why you will see the error.

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

like image 319
Cheok Yan Cheng Avatar asked Jan 10 '13 16:01

Cheok Yan Cheng


1 Answers

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 to add this line to StockInfoObserver.aidl

import org.yccheok.jstock.engine.StockInfo;
like image 185
Vladimir Mironov Avatar answered Sep 26 '22 02:09

Vladimir Mironov