Android SDK 21 ignore imports in AIDL?

I am maintaining a project that uses the old and unsupported pcgod Mumble client library. It contains this AIDL file:

package org.pcgod.mumbleclient.service;

import org.pcgod.mumbleclient.service.model.User;
import org.pcgod.mumbleclient.service.model.Message;
import org.pcgod.mumbleclient.service.model.Channel;

interface IServiceObserver {
    void onChannelAdded(in Channel channel);
    void onChannelRemoved(in Channel channel);
    void onChannelUpdated(in Channel channel);

    void onCurrentChannelChanged();

    void onCurrentUserUpdated();

    void onUserAdded(in User user);
    void onUserRemoved(in User user);
    void onUserUpdated(in User user);

    void onMessageReceived(in Message msg);
    void onMessageSent(in Message msg);

    /**
     * Called when the connection state changes.
     */
    void onConnectionStateChanged(int state);
}

      

The project is built fine with SDK 19. But after upgrading to SDK 21 it ignores imports Message

and generates onMessageReceived(android.os.Message)

instead onMessageReceived(org.pcgod.mumbleclient.service.model.Message)

. Naturally, this destroys all the code that uses it. I fixed the problem by using the fully qualified class name in the method specification.

I don't know anything about AIDL. Is this a bug in SDK 21 or was the AIDL file buggy all along and SDK 21 got stricter?

+3


source to share


2 answers


Based on my experience, any custom classes imported in the AIDL interface must exist in the same package as the interface itself.



As for how this has worked in the past, I'm not sure, but if you've recently updated the Build Tools package then for some reason it may now apply or be more stringent by this requirement.

+1


source


Check the build path and make sure the pcclod class is at the top.

project properties java build path order and export



When you qualify an object directly, you might be blocking the build path.

0


source







All Articles