dya2 / android-scripting

Automatically exported from code.google.com/p/android-scripting
0 stars 0 forks source link

Remote control instructions don't work #451

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What device(s) are you experiencing the problem on?

Samsung Galaxy S, Android Emulator running Android2.1, Nexus One running 
Android 2.2.1

What steps will reproduce the problem?
1. Issue adb shell command "am start -a 
com.googlecode.android_scripting.action.LAUNCH_TERMINAL -n 
com.googlecode.android_scripting/.activity.ScriptingLayerServiceLauncher -e 
com.googlecode.android_scripting.extra.SCRIPT_NAME 
/sdcard/sl4a/scripts/outputtest.py"

What is the expected output? What do you see instead?
This python script contains a single print statement. It works from the UI 
("run in terminal"), but not using remote control. test.py and hello_world.py 
also work from the UI, but not from adb.

What version of the product are you using? On what operating system?
sl4a version 2, python for android r1

Please provide any additional information below.

logcat:

I/ActivityManager( 2244): Start proc com.googlecode.android_scripting for 
service com.googlecode.android_scripting/.activity.ScriptingLayerService: 
pid=3151 uid=10086 gids={3003, 1015, 1007, 3002, 3001, 1006}
D/ddm-heap( 3151): Got feature list request
I/Zygote  ( 3151): Zygote: pid 3151 has INTERNET permission, then set 
capability for CAP_NET_RAW(13)
D/NotificationService( 2244): pkg:com.googlecode.android_scripting
D/NotificationService( 2244): enqueueNotification :: notification.defaults = 0, 
Notification.DEFAULT_SOUND = 1, notification.sound = null
I/ActivityThread( 3151): Publishing provider 
com.googlecode.android_scripting.provider.apiprovider: 
com.googlecode.android_scripting.provider.ApiProvider
D/dalvikvm( 3151): GC freed 7871 objects / 378584 bytes in 37ms
I/ActivityThread( 3151): Publishing provider 
com.googlecode.android_scripting.provider.scriptprovider: 
com.googlecode.android_scripting.provider.ScriptProvider
I/global  ( 3151): Default buffer size used in BufferedReader constructor. It 
would be better to be explicit if an 8k-char buffer is required.
I/global  ( 3151): Default buffer size used in BufferedReader constructor. It 
would be better to be explicit if an 8k-char buffer is required.
I/global  ( 3151): Default buffer size used in BufferedReader constructor. It 
would be better to be explicit if an 8k-char buffer is required.
I/global  ( 3151): Default buffer size used in BufferedReader constructor. It 
would be better to be explicit if an 8k-char buffer is required.
V/sl4a.InterpreterConfiguration$InterpreterListener:127( 3151): Interpreter 
discovered: com.googlecode.pythonforandroid
V/sl4a.InterpreterConfiguration$InterpreterListener:127( 3151): Binary: 
/data/data/com.googlecode.pythonforandroid/files/python/bin/python
V/sl4a.InterpreterConfiguration$InterpreterListener:127( 3151): Interpreter 
discovered: com.googlecode.pythonforandroid
V/sl4a.InterpreterConfiguration$InterpreterListener:127( 3151): Binary: 
/data/data/com.googlecode.pythonforandroid/files/python/bin/python
E/MediaPlayer( 3151): message received msg=1, ext1=0, ext2=0
E/MediaPlayer( 3151): callback application
E/MediaPlayer( 3151): back from callback
D/dalvikvm( 3151): GC freed 5229 objects / 402744 bytes in 26ms
D/NotificationService( 2244): pkg:com.googlecode.android_scripting
D/NotificationService( 2244): enqueueNotification :: notification.defaults = 0, 
Notification.DEFAULT_SOUND = 1, notification.sound = null
V/sl4a.JsonRpcServer:238( 3151): Bound to 127.0.0.1:38511
D/AndroidRuntime( 3151): Shutting down VM
W/dalvikvm( 3151): threadid=3: thread exiting with uncaught exception 
(group=0x4001dc20)
E/AndroidRuntime( 3151): Uncaught handler: thread main exiting due to uncaught 
exception
E/AndroidRuntime( 3151): java.lang.RuntimeException: Unable to start service 
com.googlecode.android_scripting.activity.ScriptingLayerService@47bb9590 with 
Intent { act=com.googlecode.android_scripting.action.LAUNCH_TERMINAL 
flg=0x10000000 
cmp=com.googlecode.android_scripting/.activity.ScriptingLayerService (has 
extras) }: java.lang.NullPointerException
E/AndroidRuntime( 3151):    at 
android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2882)
E/AndroidRuntime( 3151):    at 
android.app.ActivityThread.access$3500(ActivityThread.java:119)
E/AndroidRuntime( 3151):    at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1926)
E/AndroidRuntime( 3151):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 3151):    at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 3151):    at 
android.app.ActivityThread.main(ActivityThread.java:4363)
E/AndroidRuntime( 3151):    at java.lang.reflect.Method.invokeNative(Native 
Method)
E/AndroidRuntime( 3151):    at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 3151):    at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
E/AndroidRuntime( 3151):    at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
E/AndroidRuntime( 3151):    at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 3151): Caused by: java.lang.NullPointerException
E/AndroidRuntime( 3151):    at 
com.googlecode.android_scripting.activity.ScriptingLayerService.addProcess(Scrip
tingLayerService.java:246)
E/AndroidRuntime( 3151):    at 
com.googlecode.android_scripting.activity.ScriptingLayerService.onStart(Scriptin
gLayerService.java:179)
E/AndroidRuntime( 3151):    at 
android.app.Service.onStartCommand(Service.java:306)
E/AndroidRuntime( 3151):    at 
android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2873)
E/AndroidRuntime( 3151):    ... 10 more
I/Process ( 2244): Sending signal. PID: 3151 SIG: 3
I/dalvikvm( 3151): threadid=7: reacting to signal 3
I/ANDROID_DEBUG( 2244): dumpmesg > 
/data/log/dumpstate_app_201009301249_com_googlecode_android_scripting.log
I/dalvikvm( 3151): Wrote stack trace to '/data/anr/traces.txt'
I/dumpstate( 3165): begin
I/dumpstate( 3165): done

Original issue reported on code.google.com by sayrer on 30 Sep 2010 at 4:57

GoogleCodeExporter commented 9 years ago
Hello All, I am seeing the same issue. Is there any resolution on this ?

Original comment by nampal...@gmail.com on 20 Oct 2010 at 7:57

GoogleCodeExporter commented 9 years ago
Me 2,see my attachment!

Original comment by whuisc...@gmail.com on 20 Dec 2010 at 2:43

Attachments:

GoogleCodeExporter commented 9 years ago
Right, got it.
The wiki page needs updating.
The correct command is:
"am start -a com.googlecode.android_scripting.action.LAUNCH_FOREGROUND_SCRIPT 
-n com.googlecode.android_scripting/.activity.ScriptingLayerServiceLauncher -e 
com.googlecode.android_scripting.extra.SCRIPT_PATH 
/sdcard/sl4a/scripts/output.py"

(where output.py is the example code)
If there are any errors at all, (ie, no invalid filename, wrong intention 
action, etc) it just falls over without a useful error message.

Original comment by rjmatthews62 on 20 Dec 2010 at 5:56

GoogleCodeExporter commented 9 years ago
Wiki page updated.

Original comment by rjmatthews62 on 7 Jan 2011 at 1:44