我試圖從其他模塊訪問接口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.
您必須將其他模塊聲明爲庫,並將其作爲庫添加到您的應用程序模塊 –
@小我已經做過 –