Android : Android studio unable to locate project library

on Thursday, October 30, 2014


I'm using Android Studio 0.8.9


Recently, I in the process of migrating Eclipse project into Android studio project. I begun with File -> Import Project...


I encounter a very strange problem, where Android studio unable to compile my main project, due to cannot find symbol. Those symbols suppose to found in one of my library projects : https://code.google.com/p/android-lockpattern/ (version 3.0.1)


These is one of the error messages



C:\projects\xxx.java:4: error: cannot find symbol
import group.pals.android.lib.ui.lockpattern.prefs.DisplayPrefs;


These are my strange observation


I can confirm no error while building androidlockpattern



:androidlockpattern:compileLint
:androidlockpattern:copyReleaseLint UP-TO-DATE
:androidlockpattern:preBuild
:androidlockpattern:preReleaseBuild
:androidlockpattern:checkReleaseManifest
:androidlockpattern:preDebugBuild
:androidlockpattern:preDebugTestBuild
:androidlockpattern:prepareComActionbarsherlockActionbarsherlock440Library UP-TO-DATE
:androidlockpattern:prepareReleaseDependencies
:androidlockpattern:compileReleaseAidl UP-TO-DATE
:androidlockpattern:compileReleaseRenderscript UP-TO-DATE
:androidlockpattern:generateReleaseBuildConfig UP-TO-DATE
:androidlockpattern:generateReleaseAssets UP-TO-DATE
:androidlockpattern:mergeReleaseAssets UP-TO-DATE
:androidlockpattern:generateReleaseResValues UP-TO-DATE
:androidlockpattern:generateReleaseResources UP-TO-DATE
:androidlockpattern:mergeReleaseResources UP-TO-DATE
:androidlockpattern:processReleaseManifest UP-TO-DATE
:androidlockpattern:processReleaseResources UP-TO-DATE
:androidlockpattern:generateReleaseSources UP-TO-DATE
:androidlockpattern:compileReleaseJava UP-TO-DATE
:androidlockpattern:proguardRelease UP-TO-DATE
:androidlockpattern:mergeReleaseProguardFiles UP-TO-DATE
:androidlockpattern:compileReleaseNdk UP-TO-DATE
:androidlockpattern:packageReleaseJniLibs UP-TO-DATE
:androidlockpattern:packageReleaseRenderscript UP-TO-DATE
:androidlockpattern:packageReleaseResources UP-TO-DATE
:androidlockpattern:bundleRelease


My main project does include androidlockpattern as module



dependencies {
compile project(':androidlockpattern')
...


Android studio editor can recognize androidlockpattern. No red line highlighted


enter image description here


I have other library projects. They all compiled together well with my main project. The only error so far is androidlockpattern.


Here's are the detailed error message



C:\projects\xxx.java:4: error: cannot find symbol
import group.pals.android.lib.ui.lockpattern.prefs.DisplayPrefs;
^
symbol: class DisplayPrefs
location: package group.pals.android.lib.ui.lockpattern.prefs
C:\projects\xxx.java:195: error: cannot find symbol
Intent intent = new Intent(LockPatternActivity.ACTION_COMPARE_PATTERN, null,
^
symbol: variable ACTION_COMPARE_PATTERN
location: class LockPatternActivity
C:\projects\xxx.java:198: error: cannot find symbol
DisplayPrefs.setMaxRetry(this, Integer.MAX_VALUE);
^
symbol: variable DisplayPrefs
location: class JStockFragmentActivity
C:\projects\xxx.java:199: error: cannot find symbol
intent.putExtra(LockPatternActivity.EXTRA_PATTERN, startupLockPattern);
^
symbol: variable EXTRA_PATTERN
location: class LockPatternActivity
C:\projects\xxx.java:1239: error: cannot find symbol
case LockPatternActivity.RESULT_FAILED:


Here's my project settings. Seems fine to me.


enter image description here


Any idea what other steps I can take, to diagnostic the root cause?


0 comments:

Post a Comment