简体   繁体   中英

Unable to import in Android Studio: Cannot resolve symbol

I have a multi-modular project and I want to import those modules to use their classes in another module's class but when I try to import it in a new class, it can't seem to find the module and shows the error: Cannot resolve symbol 'module_name':

import com.package.name.module_name // Cannot resolve symbol 'module_name'

What do I do?

I found my way around it!

  1. Right Click on the module you want to import other modules in the Project pane and click Open Module Settings.
  2. Go to Dependencies tab.
  3. Add the little '+' icon at the bottom or press Cmd + N or Ctrl + N .
  4. Select Module Dependency.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM