Android studio cannot find helper interface for use in class

I have an interface defined in helpl, but I cannot extend or find it. The ideal just tells me: Cannot resolve the "KeyEventListener" character Any idea how to fix this?

Additional Information:

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

I know that android studio is something like pre-alfa, but I really like it and will be very happy if someone can stop me on this!

enter image description here

+6
source share
3 answers

You should probably take a look at the Gradle Plugin for Android User Guide .

Gradle, by default, requires a specific directory structure. If you want to use Gradle with the directory structure that most Android developers are used to, you will need to put the following (from the above link) inside the android block.

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

Once you have done this, do a cleanup and rebuild to be safe.

Personally, I just adapt my projects in accordance with the new agreement.

+11
source

In my case, the Clean and Rebuild project solved my problem.

+9
source

The helpl directory is created under src / main.

Then she created a new helpl file package structure and moved the aidl file to it.

Restored, and everything was done.

I followed this post

0
source

Source: https://habr.com/ru/post/945197/


All Articles