Got stuck with Android dev environment setup.

Code junkies hangout here

Moderators: ChrisThornett, LXF moderators

Got stuck with Android dev environment setup.

Postby leke » Wed May 04, 2011 6:18 pm

Hi, I'm trying to get an Android development environment up and running. I'm following this guide and everything went smoothly until I got here...
At this point we need to install platforms and optional additional plug-ins or sample codes. Start Android SDK manager:
android-sdk-linux_86/tools/android

So I ran it like this...
asdf@asdf-laptop /opt/android-sdk-linux_x86/tools $ sudo bash android
SWT folder '/opt/android-sdk-linux_x86/tools/lib/#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0xb6f45dbc, pid=6396, tid=3067009904
#
# JRE version: 6.0_24-b07
# Java VM: Java HotSpot(TM) Client VM (19.1-b02 mixed mode, sharing linux-x86 )
# Problematic frame:
# V [libjvm.so+0x231dbc]
#
# An error report file with more information is saved as:
# /opt/android-sdk-linux_x86/tools/hs_err_pid6396.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#' does not exist.
Please export ANDROID_SWT to point to the folder containing swt.jar for your platform.


Err...Can anyone suggest what to do now?
Thanks.
User avatar
leke
LXF regular
 
Posts: 507
Joined: Mon Oct 22, 2007 5:45 pm
Location: Oulu, Finland

Postby ethernet » Thu May 05, 2011 10:10 am

It might be worth trying doing it through Eclipse (as per these steps). That worked for me. It takes ages for those components to download.
ethernet
LXF regular
 
Posts: 170
Joined: Sat Oct 07, 2006 8:00 pm
Location: Ireland

Postby leke » Thu May 05, 2011 11:06 am

ethernet wrote:It might be worth trying doing it through Eclipse (as per these steps). That worked for me. It takes ages for those components to download.

It's a similar guide. I've done everything up to...
Step 4. Adding Platforms and Other Components
...and get the error running the Android command from /tools

But thanks anyway ;)
User avatar
leke
LXF regular
 
Posts: 507
Joined: Mon Oct 22, 2007 5:45 pm
Location: Oulu, Finland

Postby ethernet » Thu May 05, 2011 2:28 pm

What I meant is that you can also manage AVDs through Eclipse. Should invoke the same program in any case.

Any luck trying it without root privs?
cd to /path/to/android-sdk-whatever/tools/
and then launch ./android

The emulator is sooooo slow, you'll be happy *not* to get past this little error :)
ethernet
LXF regular
 
Posts: 170
Joined: Sat Oct 07, 2006 8:00 pm
Location: Ireland

Re: Got stuck with Android dev environment setup.

Postby nelz » Thu May 05, 2011 2:55 pm

leke wrote:
Please export ANDROID_SWT to point to the folder containing swt.jar for your platform.


Err...Can anyone suggest what to do now?
Thanks.


Have you tried doing what the error message suggested?
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8552
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby Bazza » Thu May 05, 2011 3:43 pm

I'd thought about this platform but......

......I have no idea what I could "develop" that hasn't already been done.

Also, not sure if I am capable of doing so in the first place. ;o(
73...

Bazza, G0LCU...

Team AMIGA...
User avatar
Bazza
LXF regular
 
Posts: 1482
Joined: Sat Mar 21, 2009 11:16 am
Location: Loughborough

Postby leke » Thu May 05, 2011 4:21 pm

Bazza wrote:I'd thought about this platform but......

......I have no idea what I could "develop" that hasn't already been done.

Also, not sure if I am capable of doing so in the first place. ;o(
You just reinvent something. Angry Birds is just a reinvention of Yeti Sports with a lame storyline.
Oh, and if you google Yeti Sports, be warned, it involves cruelty to penguins.
My first effort will be a copy of Whack a mole, but with a twist ;)

ethernet wrote:Any luck trying it without root privs?
cd to /path/to/android-sdk-whatever/tools/
and then launch ./android

:o it worked! (wtf?).


nelz wrote:Have you tried doing what the error message suggested?

Didn't really understand what the error message was going on about, but I guess that part was telling me to change a path in some file called ANDROID_SWT to point to some other file called swt.jar, but no need now as it seems to be working.
User avatar
leke
LXF regular
 
Posts: 507
Joined: Mon Oct 22, 2007 5:45 pm
Location: Oulu, Finland

Postby nelz » Thu May 05, 2011 5:53 pm

The message was telling you to set the ANDROID_SWT environment variable to the directory containing that file, and then export it.

Code: Select all
locate swt.jar
export ANDROID_SWT="/path/from/above/"


Have you rebooted since the problem occurred? It is possible the variable was defined, but not available in your existing environment.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8552
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby leke » Thu May 05, 2011 8:50 pm

nelz wrote:Have you rebooted since the problem occurred? It is possible the variable was defined, but not available in your existing environment.
Yep, i think so too. I can execute with sudo now too -- which I needed to do, to save the API I installed from the set up app.
It's times like these I miss the little windows nag, "Restart required. Restart now?" :roll:

@ethernet
Oh, and I see what you mean by the emulator being slow, OMG!
User avatar
leke
LXF regular
 
Posts: 507
Joined: Mon Oct 22, 2007 5:45 pm
Location: Oulu, Finland

Postby nelz » Thu May 05, 2011 11:05 pm

Except you don't need to reboot to set a single variable, well, not in Linux.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8552
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby leke » Sun May 08, 2011 12:12 pm

nelz wrote:Except you don't need to reboot to set a single variable, well, not in Linux.
Would you have to possibly log out and then log back in again?

As for development, wow, the emulator is so slow to work with on my hardware, I'm not able to currently use it. I'm googling for other ways -- perhaps a way I can hook up my tablet and send code to it to execute.
User avatar
leke
LXF regular
 
Posts: 507
Joined: Mon Oct 22, 2007 5:45 pm
Location: Oulu, Finland

Postby ethernet » Sun May 08, 2011 1:20 pm

If you can afford it, give a standard Android image 512 MB RAM. For a tablet, go for 1 GB, if possible.

Connect your Android device and run
Code: Select all
/path/to/android-sdk/platform-tools/adb devices


If it's detected here, Eclipse should launch the app on the physical device over launching the emulator, by default. You can double check this by right-clicking on your app in Eclipse --> Run As --> Run Configurations. Bring up the Target tab and ensure 'Automatic' is selected.

You also need to enable USB debugging on the device and allow installation of non-market (third-party) apps in the phone's preferences for this to work.

I had to write a udev rule on openSUSE 10.3 to detect a HTC Desire but then it 'just worked'.
ethernet
LXF regular
 
Posts: 170
Joined: Sat Oct 07, 2006 8:00 pm
Location: Ireland

Postby nelz » Sun May 08, 2011 5:57 pm

leke wrote:
nelz wrote:Except you don't need to reboot to set a single variable, well, not in Linux.
Would you have to possibly log out and then log back in again?


No, although that would do it. All you actually need to do is what the message says, export the variable.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8552
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby leke » Mon May 09, 2011 6:16 am

nelz wrote:No, although that would do it. All you actually need to do is what the message says, export the variable.

Ah, ok. I finally got it after I googled it, and it's what I know as, 'setting the path variable'. :roll:
User avatar
leke
LXF regular
 
Posts: 507
Joined: Mon Oct 22, 2007 5:45 pm
Location: Oulu, Finland


Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests

cron