0

What device(s) are you experiencing the problem on? Amoi N821

What firmware version are you running on the device? Android 4.1.1

What steps will reproduce the problem?

  1. Create the following Python script:
    import android
    droid = android.Android()
    droid.makeToast('Hello, Android!')
    print 'Hello world!'
  2. Run script

What is the expected output? must print 'Hello world!' & make popup 'Hello Android!'

What do you see instead? see this error:

dlopen libpython2.6.so

Traceback (most recent call list):

File "/storage/sdcard0/sl4a/scripts/hello_world.py", line 2, in

droid = droid.Android()

File "/storage/sdcard0/sl4a/scripts/android.py", line 34, in Init

self.conn = socket.create_connection(addr)

File "/home/manuel/AptanaStudio3Workspace/python-for-android/python-build/output/usr/lib/python2.6/socket.py", line 498, in create_connection

socket.gaierror: [Errno 7] no address associated with hostname.

.

.

Please provide any additional information below. My friend has the same phone and the same problem.

How can I fix it?

2 Answers2

1

I had exactly the same problem on my Lenovo P770. Later I confirmed that it was due to IPV6 binding to localhost by some software, or OEM ROM. I was lucky enough to get help from Robbie Matthews on Google groups. He compiled a special SL4A package addressing this issue.

http://code.google.com/p/android-scripting/wiki/Unofficial#Development_releases

If you work out, do not thank me. Thank him instead.

sanz
  • 11
  • 1
0

Your script doesn't match your error message??

Your error includes the following line, which is incorrect.

droid = droid.Android()

It should be as you have written it in the example you gave.

droid = android.Android()
Carl Smith
  • 3,025
  • 24
  • 36