8

I have an interface defined in the aidl but I can't extend it or find it any way. The ide just tells me: Can not resolve symbol 'KeyEventListener' Any idea how to fix this?

Additional infos:

  • KeyEventListener is the name of the interface defined in KeyEventListener.aidl
  • KeyEventListenerImpl is the class which extends the interface Stub
  • KeyEventListener just contains one method named 'void doIt();' and is well formatted;

I know android-studio is some thing like a pre-alfa but like it very much and would be very happy if some one could halp me out on this!

enter image description here

4

3 回答 3

14

就我而言CleanRebuild项目解决了我的问题。

于 2014-11-12T09:23:41.383 回答
12

你可能最好看看The Gradle Plugin User Guide for Android。

默认情况下,Gradle 需要特定的目录结构。如果您想将 Gradle 与大多数 Android 开发人员习惯的目录结构一起使用,您需要将以下内容(来自上述链接)放在“android”块中。

sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        resources.srcDirs = ['src']
        aidl.srcDirs = ['src']
        renderscript.srcDirs = ['src']
        res.srcDirs = ['res']
        assets.srcDirs = ['assets']
    }
}

完成此操作后,请进行清洁和重建以确保安全。

就个人而言,我只是调整我的项目以适应新的惯例。

于 2013-05-19T10:16:47.933 回答
3

在 src/main 下创建了一个目录aidl。

然后创建新的aidl文件包结构并将aidl文件移入其中。

重建并完成。

我关注了这篇文章

于 2015-06-18T02:28:14.610 回答