4

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 stands with Ukraine
  • 25,310
  • 18
  • 114
  • 149
user6599705
  • 51
  • 1
  • 2

2 Answers2

15

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

hadilq
  • 973
  • 10
  • 24
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,187
  • 1
  • 7
  • 18