Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Discussion > Android Applications

Android Applications All the information you could ever want about Android Applications. Learn about apps and get help with them... all here! New apps can be found and announced in the Applications Announcements forum linked below.



Reply
 
LinkBack Thread Tools
Old August 8th, 2011, 12:10 AM   #1 (permalink)
New Member
 
Join Date: Aug 2011
Posts: 1
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem running HelloWorld app in Eclipse

Hello, World | Android Developers

Eclipse 3.7
SDK 3.2, 3.0, 2.3.3
Hierarchy Viewer version: 12.0.0.v201106281929-138431
Android Development Toolkit version: 12.0.0.v201106281929-138431

I tried running the helloworld app on all three target build platforms with a AVD selected for each one appropriately.

I am getting this error consistently:

Code:
[2011-08-07 21:55:04 - hierarchyviewer]Unable to get view server version from device emulator-5554
[2011-08-07 21:55:44 - hierarchyviewer]Unable to get view server protocol version from device emulator-5554
It also runs very slowly (in excess of 60 secs on Ubuntu 11.04).

I found the code that throws these exceptions in the com.android.hierarchyviewerlib.device.DeviceBridge class.

Here is the method involved:

Code:
public static ViewServerInfo loadViewServerInfo(IDevice device) {
        int server = -1;
        int protocol = -1;
        DeviceConnection connection = null;
        try {
            connection = new DeviceConnection(device);
            connection.sendCommand("SERVER"); //$NON-NLS-1$
            String line = connection.getInputStream().readLine();
            if (line != null) {
                server = Integer.parseInt(line);
            }
        } catch (Exception e) {
            Log.e(TAG, "Unable to get view server version from device " + device);
        } finally {
            if (connection != null) {
                connection.close();
            }
        }
        connection = null;
        try {
            connection = new DeviceConnection(device);
            connection.sendCommand("PROTOCOL"); //$NON-NLS-1$
            String line = connection.getInputStream().readLine();
            if (line != null) {
                protocol = Integer.parseInt(line);
            }
        } catch (Exception e) {
            Log.e(TAG, "Unable to get view server protocol version from device " + device);
        } finally {
            if (connection != null) {
                connection.close();
            }
        }
        if (server == -1 || protocol == -1) {
            return null;
        }
        ViewServerInfo returnValue = new ViewServerInfo(server, protocol);
        synchronized (sViewServerInfo) {
            sViewServerInfo.put(device, returnValue);
        }
        return returnValue;
    }
Any idea why this is happening and how I can fix this? thx.

asookazian is offline  
Reply With Quote
Sponsors
Old October 21st, 2011, 04:19 PM   #2 (permalink)
New Member
 
Join Date: Oct 2011
Posts: 6
 
Device(s):
Thanks: 1
Thanked 0 Times in 0 Posts
Default

are you running the same program more than once with no changes?

and if you shut down the emulator and then run the app does it work fine?

I had a similar error
xDroidApps is offline  
Last edited by xDroidApps; October 21st, 2011 at 04:21 PM.
Reply With Quote
Old February 18th, 2012, 10:11 AM   #3 (permalink)
New Member
 
Join Date: Feb 2012
Posts: 1
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had the same problem until I looked at the tutorial code and realized that I had left the line:

super.onCreate(savedInstanceState);
setContentView(R.layout.main);

in my code instead of replacing it with the tutorial code:

super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
theArchitect65 is offline  
Reply With Quote
Reply

Bookmarks

Tags
adt, eclipse, tutorial


Go Back   Android Forums > Android Discussion > Android Applications User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 01:26 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo