我试图从其他模块访问接口android的工作室,我的项目结构看起来像这样无法访问界面的Android
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.
您必须将其他模块声明为库,并将其作为库添加到您的应用程序模块 –
@小我已经做过 –