5

I have the class A with the public function "go()" in the module_A,when I use the A a=new A() in the module_B, It work well.but when I call the function "a.go()",the android studio write the error message that you cannot access the package "xxxxxxxxx";

In the module_B,I have write the compile project(":module_A") in the build.gradle file;

Zoe
  • 27,060
  • 21
  • 118
  • 148
user6599705
  • 61
  • 1
  • 1
  • 2

2 Answers2

16

Rebuild your module. Then if it didn't work you can use Invalidate Caches/ Restart in File menu of Android Studio.

hadilq
  • 1,023
  • 11
  • 25
0

To fix this error you can try to do an 'invalidate caches / Restart' option from the File menu in android studio. Choose “Invalidate and restart option” and close Android Studio.

Additionally, check the answer here: https://stackoverflow.com/a/68736360/13794189

Miguel Tomás
  • 1,714
  • 1
  • 13
  • 23