Imported jar in gradle, compiles, but not recognized by Android Studio (0.2.10) -


this annoying one. have simple project structure based on gradle, similar other projects have. project has these imports:

dependencies {     compile 'com.android.support:support-v4:13.0.+'     compile files('libs/jackson-annotations-2.1.0.jar')     compile files('libs/jackson-core-2.1.0.jar')     compile files('libs/jackson-databind-2.1.0.jar')     compile files('libs/zip4j_1.3.1.jar')     compile files('libs/httpclient-4.1.3.jar')     compile files('libs/httpclient-cache-4.1.3.jar')     compile files('libs/httpcore-4.1.4.jar')     compile files('libs/httpmime-4.1.3.jar')     compile project(":grid_lib") } 

which works well.

the problem android studio not recognize classes, in red , have no intel. very annoying!

i've been banging head against wall long, i'm trying here now. guys? ideas?

thanks :-)

edit

i've answered own questions, find same problem.

well, answer own question...

sometimes android studio's gradle goes haywire, , found simple fix:

  1. restart android studio
  2. create new project (doesn't matter or name)
  3. wait finish downloading gradle stuff
  4. restart android studio

for other gradle problems, additional step may required, copying gradle wrapper (gradlew files, , gradle folder, not .gradle folder) newly created project own project, , re-import project.

you can delete new project... of course.

edit:

gradle's version keep changing. if still having trouble, try this-

  1. edit gradle/wrapper/gradle-wrapper.properties file, , update distribution url's version. should 1.8, may change in future. can use "new project" find out version should be. example: distributionurl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip

  2. edit build.gradle file, , change minimum version 0.6.+ - , again may change in future. example current versions: classpath 'com.android.tools.build:gradle:0.6.+'

  3. restart android studio , recompile.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -