Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to use object from library in AIDL interface

Tags:

android

I am creating an AIDL interface that uses an object type from an android library that is part of a different project. I can import and use the type fine in my service, but I can not import it in my AIDL interface.

package com.mysite.service;

import com.othersite.library.MyObject;

interface IMyService {
    int getPid();

    void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat,
        double aDouble, String aString);

    MyObject getObjects();

}

The error is:

couldn't find import for class com.othersite.library.MyObject

like image 884
Xample Avatar asked Nov 18 '25 06:11

Xample


1 Answers

You must create a separate .aidl file for each class you wish to use within your service that declares that class as parcelable.

There is a blog post about this issue here.

like image 124
Andrei Avatar answered Nov 19 '25 21:11

Andrei