【发布时间】:2016-04-25 22:15:12
【问题描述】:
我正在尝试从 android studio 中的其他模块访问接口,我的项目结构如下所示
projectRoot-folder
app-main-module //this is main app which i run
com.mypackage.files
MyClass.java
build.gradle
other-library-module //this is library module which i added
com.package.files
InterfaceFile.java
build.gradle
build.gradle
settings.gradle
我正在为 MyClass.java 实现接口,并且工作正常,没有编译错误,但是当我按下运行时,它给出了以下错误,任何人都可以解释为什么会这样吗?感谢任何帮助,谢谢。
Error:(5, 32) error: cannot find symbol class InterfaceFile
Error:(10, 52) error: cannot find symbol class InterfaceFile
Error:(11, 5) error: method does not override or implement a method from a supertype
Error:(16, 5) error: method does not override or implement a method from a supertype
Error:Execution failed for task ':app:compileDebugJava'.
> Compilation failed; see the compiler error output for details.
【问题讨论】:
-
您必须将另一个模块声明为库并将其作为库添加到您的应用模块中
-
@Little 我已经做了
标签: java android android-studio interface