Clinton Dsouza
Clinton Dsouza

Reputation: 328

Android Studio cannot find symbol error

I'm sorry if this is a noob question but I have recently moved from Eclipse to Android Studio and have never used Gradle before. I have imported one project from eclipse which depends on 3 libraries (UIL,androidBootStrap,androidLockpattern).The libraries can be seen under the root directory of my android studio project,but when i click build i keep getting the following errors

G:\AndroidstudioProjects\P3 Authentication\p3Authentication\src\main\java\com\p3authentication\Captcha_Verfication.java
Error:(11, 45) error: cannot find symbol class Settings
Error:(25, 18) error: cannot find symbol variable MATRIX_WIDTH
Error:(27, 11) error: package Settings does not exist
Error:(28, 49) error: cannot find symbol variable ACTION_VERIFY_CAPTCHA
Error:(47, 28) error: cannot find symbol variable RESULT_FAILED
Error:(58, 25) error: cannot find symbol variable EXTRA_RETRY_COUNT
G:\AndroidstudioProjects\P3 Authentication\p3Authentication\src\main\java\com\p3authentication\Compare_Pattern.java
Error:(35, 18) error: cannot find symbol variable MATRIX_WIDTH
Error:(37, 49) error: cannot find symbol variable ACTION_COMPARE_PATTERN
Error:(39, 38) error: cannot find symbol variable EXTRA_PATTERN
Error:(70, 28) error: cannot find symbol variable RESULT_FAILED
Error:(75, 28) error: cannot find symbol variable RESULT_FORGOT_PATTERN
Error:(86, 25) error: cannot find symbol variable EXTRA_RETRY_COUNT
G:\AndroidstudioProjects\P3 Authentication\p3Authentication\src\main\java\com\p3authentication\Create_Pattern.java
Error:(26, 18) error: cannot find symbol variable MATRIX_WIDTH
Error:(28, 49) error: cannot find symbol variable ACTION_CREATE_PATTERN
Error:(41, 45) error: cannot find symbol variable EXTRA_PATTERN
G:\AndroidstudioProjects\P3 Authentication\p3Authentication\src\main\java\com\p3authentication\Pattern_Captcha.java
Error:(12, 45) error: cannot find symbol class Settings
Error:(23, 11) error: package Settings does not exist
Error:(24, 49) error: cannot find symbol variable ACTION_VERIFY_CAPTCHA
Error:(57, 28) error: cannot find symbol variable RESULT_FAILED
Error:(68, 25) error: cannot find symbol variable EXTRA_RETRY_COUNT
Note: G:\AndroidstudioProjects\P3 Authentication\p3Authentication\src\main\java\com\p3authentication\LockerService.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Error:Execution failed for task ':p3Authentication:compileDebugJava'.
> Compilation failed; see the compiler error output for details.

I know all these classes and Variables exist because when i run my application from eclipse it runs perfectly without any problems. Any idea how to overcome this is gratefully accepted

Upvotes: 0

Views: 8080

Answers (1)

loosebazooka
loosebazooka

Reputation: 2433

One source of this problem is that if you're using library modules, you need need to use the plugin "android-library" for them to be packaged and available to your application. IF you're using gradle to build your libraries and have dependencies on them using the compile project(":UIL") this might be your problem.

Mutliproject setup with libraries :

In the build file for each of your libraries, you should probably have the line:

apply plugin: "android-library"

I think it might ask you to correct this from android-library to com.android.library

Upvotes: 1

Related Questions