Android Intellij IDEA 12 AIDL

3

我正在尝试使用AIDL在Android上创建远程IPC服务。我找到了一些文档,讲解如何在Eclipse中创建此类服务,但没有一个解释在InteliJ IDEA上创建过程的文档。

我注意到IntelliJ中有这个功能,位于File>New>Android Component>Remote Interface,我使用它来创建了一个名为IRemoteService.aidl的文件,并具有以下内容:

package MyApp.Android.RemoteServices;
/**
 * Created with IntelliJ IDEA.
 * Máxima Sistemas de Informática S.A.
 * User: regis.oliveira
 * Date: 27/03/13
 * Time: 23:26
 * To change this template use File | Settings | File Templates.
 */
/** Example service interface */
interface IRemoteService {
    /** Request the process ID of this service, to do evil things with it. */
    int getPid();

    /** Demonstrates some basic types that you can use as parameters
     * and return values in AIDL.
     */
    void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat,
            double aDouble, String aString);
}

但是,当我尝试编译该项目时,出现以下错误:
android-idl-compiler: D:\Docs\Programming\MyApp.Android.RemoteServices\IRemoteService.aidl:10 interface IRemoteService should be declared in a file called MyApp\Android\RemoteServices\IRemoteService.aidl.

有没有在IntelliJ中已经实现过这个功能的人?是否有任何文档显示如何在其中使用此功能?

谢谢


我已经这么做了,没问题。请分享一个示例项目以重现问题。 - CrazyCoder
嗨,@CrazyCoder。经过几次尝试,我意识到问题是由Eclipse引起的,它与IntelliJ同时打开。因此,在关闭Eclipse并重新启动IntelliJ后,一切都按预期工作了。 - regisxp
1个回答

4

经过多次尝试,我意识到问题是由Eclipse引起的,因为它与Intellij同时打开。因此,在关闭Eclipse并重新启动IntelliJ后,一切都按预期工作。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接