eclim + juno + android ... validation errors

196 views
Skip to first unread message

ahsan ziauddin

unread,
Jan 8, 2013, 4:42:19 AM1/8/13
to ecli...@googlegroups.com
Hello,

First off, Eric, thank you for a fantastic tool. I've been using it for over a year, on and off, and it's been a huge help in my occasional forays into Android development. Which is to say, eclim is not something I use fulltime, and Android development is not something I am hugely experienced with, but whenever I do have to dip my toes into those waters, eclim comes to the rescue.

With my n00bishness in mind, consider the following problem I'm having...

I have an Android project, it builds fine in eclipse (with some warnings): 


"Something" is the main project and as you can see, it relies on a few other libs (the other projects in that workspace are all dependencies which "Something" relies on).

When in MacVim, I can run ":ProjectProblems!" and eclim correctly reports zero errors: 


BUT, in MacVim, almost every single line gets highlighted with an error, with messages like "package android.os does not exist", or "package com.viewpagerindcator does not exist" or "cannot find symbol symbol : class FragmentPagerAdapterlocation: whatevs" even though the class exists elsewhere in the workspace: 


Now, I'm not sure if this is just an artifact of a weirdly setup Android project, but I can definitely say I've worked on 2-3 other extremely large and complicated Android projects in the past and eclim + Eclipse Juno never had this problem with any of the others. I am _not_ a Java/Android expert so perhaps this is just an artifact of Eclipse project misconfiguration.

Regardless, any light you can shed on the matter would be greatly appreciated.


Here is some other relevant information:

eclim   2.2.5
eclipse 4.2.1   



Thanks!
-az

Eric Van Dewoestine

unread,
Jan 9, 2013, 10:30:40 AM1/9/13
to ecli...@googlegroups.com
One possibility is that the configuration for your android sdk is not
setup or is pointing to an incorrect location.

Do you have eclim's android plugin installed? If so, can you run
':EclimSettings' in MacVim and open up the "Android" fold to see what
the value of 'com.android.ide.eclipse.adt.sdk' is? You can also write
that buffer (:w) and eclim will validate the location, providing an
error marker and associated error message if the location is
incorrect.

If you don't have eclim's android plugin installed, you'll need to
open up the eclipse gui and then open up the preferences dialog and
check the location in the "Android" section.

Another possibility could be that the project's configured android
target (version) is not installed in your sdk. I'm not sure how
eclipse adt handles that case, but you can check your project's
properties in the eclipse gui.

If you only notice this issue with the headless eclim daemon, then one
last thing to check is that eclimd is starting up with the workspace
location you expect. It'll print out the workspace directory while it
is starting up.

--
eric

ahsan ziauddin

unread,
Jan 9, 2013, 11:44:42 AM1/9/13
to ecli...@googlegroups.com
Hi Eric,

So I do have the Android plugin installed:

  com.android.ide.eclipse.adt.sdk=/Users/aziauddin/dev/android/tools/adt-bundle-mac/sdk/

This location is correct and writing to the buffer validates properly. 

As far as target SDK version, I have literally every SDK version installed, including the target version for my project.

Note also that ":ProjectProblems" works properly, it does manage to display exactly what is displayed in Eclipse. As well, autocomplete of objects (eg. FragmentTransaction) that are in the Android SDK, also works properly via supertab. Even ":JavaImport" is able to find the correct imports and insert them as expected.

As far as where the workspace is, eclimd on startup prints out this:

2013-01-08 05:50:45,954 INFO  [org.eclim.eclipse.EclimDaemon] Workspace: /Users/aziauddin/dev/android/ews

This is expected as well, that's where I have Eclipse pointed to. Though note that I usually use the "Import existing code into workspace" options so the actual source I'm working with does _not_ reside in the workspace. Eclim used to work fine this way before, I have never copied code into the workspace, I usually git clone my projects else where and then Eclipse just links to them w/o actually copying the cloned repositories into the workspace on the filesystem.

Is there any other debug information I can provide you? The earlier screen shots I provided also showed you the .classpath file for the project I'm using...

Thanks for your help here.

----
az

Eric Van Dewoestine

unread,
Jan 9, 2013, 9:10:15 PM1/9/13
to ecli...@googlegroups.com
On 2013-01-09 08:44:42, ahsan ziauddin wrote:
> Hi Eric,
>
> So I do have the Android plugin installed:
>
>
> com.android.ide.eclipse.adt.sdk=/Users/aziauddin/dev/android/tools/adt-bundle-mac/sdk/
>
> This location is correct and writing to the buffer validates properly.
>
> As far as target SDK version, I have literally every SDK version installed,
> including the target version for my project.
>
> Note also that ":ProjectProblems" works properly, it does manage to display
> exactly what is displayed in Eclipse. As well, autocomplete of objects (eg.
> FragmentTransaction) that are in the Android SDK, also works properly via
> supertab. Even ":JavaImport" is able to find the correct imports and insert
> them as expected.

Hmm, having completion and import working correctly are good
indicators that the validation should work as well. If you open up the
location list for one of these files (:lopen) what do the messages
say?
> --
> You received this message because you are subscribed to the Google Groups "eclim-dev" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/eclim-dev/-/d6qCNq-4Ko4J.
> To post to this group, send email to ecli...@googlegroups.com.
> To unsubscribe from this group, send email to eclim-dev+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/eclim-dev?hl=en.
>

--
eric

ahsan ziauddin

unread,
Jan 9, 2013, 11:35:36 PM1/9/13
to ecli...@googlegroups.com
Even :lopen returns only "warnings" as they appear in Eclipse's Problems view:


The cursor in the above screenshot is on a basic:

import android.app.AlertDialog;

statement (line 14 of the main editor view). And yet the red "error" indicator appears next to it, and the status line says:

"package android.app does not existimport android.app.Alertdialog;

The result of :lopen can be seen as well, and it only shows warnings, starting with a deprecation warning for line 148 of the given file.

Validation of Java files seems to work fine, it's just that additional spurious errors seem to show up when actually editing the file.

Also note that I am using:


At least for basic NERDTree, tagbar, ctrlp capabilities.

Thanks,
-az

Eric Van Dewoestine

unread,
Jan 9, 2013, 11:56:45 PM1/9/13
to ecli...@googlegroups.com
On 2013-01-09 23:35:36, ahsan ziauddin wrote:
> Even :lopen returns only "warnings" as they appear in Eclipse's Problems
> view:
>
> https://dl.dropbox.com/u/10565/lopen.png
>
> The cursor in the above screenshot is on a basic:
>
> import android.app.AlertDialog;
>
> statement (line 14 of the main editor view). And yet the red "error"
> indicator appears next to it, and the status line says:
>
> "package android.app does not existimport android.app.Alertdialog;
>
> The result of :lopen can be seen as well, and it only shows warnings,
> starting with a deprecation warning for line 148 of the given file.

That's odd. Perhaps some other plugin is injecting its own signs? That
running together of words in that message looks un-eclipse like as
well.

> Validation of Java files seems to work fine, it's just that additional
> spurious errors seem to show up when actually editing the file.
>
> Also note that I am using:
>
> https://github.com/carlhuda/janus
>
> At least for basic NERDTree, tagbar, ctrlp capabilities.
>
> Thanks,
> -az

At this point I'd bet that syntastic is the culprit. Looking at the
source tree on github, they have a javac syntax checker which isn't
going to know about any of the android classes or much of anything
else unless your project uses a maven pom.xml or you manually
configure syntastic.

Try running vim with just eclim loaded and see if the problem still
occurs:

$ vim -u NONE -U NONE --cmd \
"set nocp | sy on | filetype plugin indent on | ru plugin/eclim.vim"

Or just remove syntastic altogether and that'll probably resolve the
problem.
--
eric

ahsan ziauddin

unread,
Jan 10, 2013, 12:05:09 AM1/10/13
to ecli...@googlegroups.com
Yes! Fantastic! In my Janus ~/.vimrc.before, I did:

call janus#disable_plugin('syntastic', "I don't like it")

And that has completely solved my problem. Huge thanks for your help, I am embarrassed that it turned out to be a problem not with Eclim or Eclipse but just my heavily plugin'd VIM setup. 

Eclim is awesome, I hope you keep spending time on it, and once again thanks for the time you spent helping out on this issue.

:)

-az


Eric Van Dewoestine

unread,
Jan 10, 2013, 12:14:25 AM1/10/13
to ecli...@googlegroups.com
On 2013-01-10 00:05:09, ahsan ziauddin wrote:
> Yes! Fantastic! In my Janus ~/.vimrc.before, I did:
>
> call janus#disable_plugin('syntastic', "I don't like it")
>
> And that has completely solved my problem. Huge thanks for your help, I
> am embarrassed that it turned out to be a problem not with Eclim or Eclipse
> but just my heavily plugin'd VIM setup.
>
> Eclim is awesome, I hope you keep spending time on it, and once again
> thanks for the time you spent helping out on this issue.
>
> :)
>
> -az

Great to hear! I've actually had a note in my todo list for some time
now to look into how eclim behaves with syntastic installed. Looks
like I'll need to look into disabling syntastic for file types in
projects that eclim handles or toss up a warning/error indicating the
incompatibility.

Thank you for your patience in helping track down the problem.
Reply all
Reply to author
Forward
0 new messages