Environment setup

229 views
Skip to first unread message

Michael

unread,
May 27, 2010, 2:17:26 PM5/27/10
to AnkiDroid
Hey, sorry for asking, but this is driving me crazy. I have my
local.properties file set to my android sdk root, and when ant goes to
build the apk it appears to proceed correctly until it gets to the
zipalign stage. At that point, it can't find zipalign. That is, even
though I know it already executed other tools from the sdk tools
folder, it somehow stumbles over zipalign with this error:
/opt/android/platforms/android-4/ant/ant_rules_r2.xml:176: Execute
failed: java.io.IOException: Cannot run program "/Users/molson/Dropbox/
Eclipse/personal/Anki-Android/${sdk.dir}/tools/zipalign": error=2, No
such file or directory

Since it already ran tools from the android directory, I know the sdk
directory is set correctly. It looks like in the case of zipalign,
however, it's not getting expanded and it's instead using the root for
my code. Can someone more familiar with ant than me explain why I'm
getting this error? I've included a full session log here:
http://pastebin.com/pXn3j4Ap

Thanks,
- Michael

Nicolas Raoul

unread,
May 28, 2010, 1:01:05 AM5/28/10
to anki-a...@googlegroups.com
Hi Michael,

Indeed I get the same message:

Cannot run program
"/home/nico/src/ankidroid/${sdk.dir}/tools/zipalign":
java.io.IOException: error=2, No such file or directory

I just tried adding this line to my local.properties:
sdk.dir=../../programs/android-sdk
and it works.
But it depends on where people install their SDK, so not a good solution.

You might want to use this dirty solution, but we must find a real solution.

I did not this problem earlier because I mostly use Eclipse recently.
Do you have problems building with Eclipse instead of Ant?

I filed this bug:
http://code.google.com/p/ankidroid/issues/detail?id=110

Cheers!
Nicolas Raoul

Michael Olson

unread,
May 28, 2010, 2:14:12 PM5/28/10
to anki-a...@googlegroups.com
Hi Nicolas,

I can actually build just fine with Eclipse; I was testing the ant script because the wiki documentation made it look like that was the build process everyone was using.  If everyone else is using Eclipse too, I'll just skip it, although I also got it to work using relative paths (in my case, "sdk.dir=../../../../../../opt/android", a little silly).

Thanks for checking it.

- Michael



--
You received this message because you are subscribed to the Google Groups "AnkiDroid" group.
To post to this group, send an email to anki-a...@googlegroups.com.
To unsubscribe from this group, send email to anki-android...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/anki-android?hl=en-GB.


Jan

unread,
May 30, 2010, 7:30:33 PM5/30/10
to AnkiDroid
> Indeed I get the same message:
>
> Cannot run program
> "/home/nico/src/ankidroid/${sdk.dir}/tools/zipalign":
> java.io.IOException: error=2, No such file or directory
>
> I just tried adding this line to my local.properties:
> sdk.dir=../../programs/android-sdk
> and it works.
> But it depends on where people install their SDK, so not a good solution.

The "sdk-location" property got renamed to "sdk.dir" in a more recent
version of the SDK, but our build.xml still referred to sdk-location
so both need to be set. I fixed build.xml in
http://github.com/jberkel/Anki-Android/commit/835e01246362d590291a903344b13c5a9321c98e
so it will just use sdk.dir.

Also, you don't need to specify a relative path - an absolute path is
fine.

I've also updated the wiki to clarify that setting up ant is entirely
optional.

jan

jan

Nicolas Raoul

unread,
May 30, 2010, 10:27:53 PM5/30/10
to anki-a...@googlegroups.com
Thanks Jan :-)

It works. I have pushed to my master.

Cheers!
Nicolas

thurd

unread,
Jun 1, 2010, 2:59:37 AM6/1/10
to AnkiDroid
I've managed to setup the environment without major problems but now I
face a bigger one. Master branch from github builds and installs
correctly on both AVD and my phone (Samsung Spica @ 2.1) but on both
it doesn't work properly.

AVD (tried both 1.6 and 2.1):
AnkiDroid starts up, shows "No decks found." screen and thats it.
Every button on the emulator seems to be working except menu so I
can't do anything. After a while of furious clicking it also hangs up
randomly.

My phone:
AnkiDroid starts up, shows "Failed to load deck. ...." screen, shows
me menu correctly and I can navigate through all options without a
problem but after I change deck location in preferences it sometimes
hangs up. But the bigger problem here is not loading my deck from the
sd card correctly, I pick "Switch to another deck" and it shows my
deck under the location I've specified in preferences (so we know that
part works). But now he just says "Loading deck..." and goes on
forever without loading the deck. I've tested it on different decks,
with phone attached & detached from USB, nothing works.

Any ideas?

thurd

unread,
Jun 10, 2010, 9:57:20 AM6/10/10
to AnkiDroid
Anyone? I'm really confused about the nature of this problem. It
should happen to everyone that tries to work on Master branch (since I
just took the code from the repository without any changes) and yet
nobody seems to complain.

Nicolas Raoul

unread,
Jun 10, 2010, 8:39:45 PM6/10/10
to anki-a...@googlegroups.com
Hi Thurd,

Can you send me your deck? I will try here.
Does the country-capitals.anki deck works?

Cheers!
Nicolas

thurd

unread,
Jun 11, 2010, 8:21:42 AM6/11/10
to AnkiDroid
I'll send you my deck when I get home but for the record I tried other
decks (simple ones like public Amino acids) and nothing worked.

On AVD country-capitals isn't shown at all (AVD has a 1GB virtual SD
attached), I just get No decks available.
On my phone its the same but at least I can pick a deck from my SD, it
just doesn't load (keeps loading and doesn't do anything).

thurd

unread,
Jun 14, 2010, 10:35:40 AM6/14/10
to AnkiDroid
I manged to start up new-design branch and its working correctly on
both my AVD and phone. Since I like sync feature the most, I'll just
work on this version.

First stop is adding some progress bar during sync. I've seen Edu
wrote some of the wrappers already and I've managed to understand most
of the code behind it, so I should have something soon. New design
just rocks, looks like a much more mature application and only a few
details are left (at least from my perspective).

Nicolas Raoul

unread,
Jun 14, 2010, 10:26:39 PM6/14/10
to anki-a...@googlegroups.com
Hi thurd,

I could not reproduce the problem with the deck you sent me, using
Git's trunk. It works as expected.
Glad to know that switching to the new_design branch solves the problem :-)
When we merge new_design to trunk, please test again and let us know!

Cheers!
Nicolas

Reply all
Reply to author
Forward
0 new messages