imsparsh / python-for-android

Automatically exported from code.google.com/p/python-for-android
Apache License 2.0
0 stars 0 forks source link

take_picture.py does not work on android 4.x #67

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. start the example script take_picture.py 

What is the expected output? 
camera makes a picture and save it to SD card

What do you see instead?
 java.lang.NullPointerException

What version of the product are you using? On what operating system?
Python for Android r6
SL4A r6
Android 4.03

Please provide any additional information below.

logcat:

V/sl4a.JsonRpcServer:117( 1781): Sent: {"error":null,"id":0,"result":true}
V/sl4a.JsonRpcServer:74( 1781): Received: {"params": ["/sdcard/foo.jpg"], "id": 
1, "method": "cameraCapturePicture"}
W/CameraFactory(   77): camera_get_camera_info: id = 0
E/sl4a.RpcReceiverManager:69( 1781): Error
E/sl4a.RpcReceiverManager:69( 1781): java.lang.reflect.InvocationTargetException
E/sl4a.RpcReceiverManager:69( 1781):     at 
java.lang.reflect.Constructor.constructNative(Native Method)
E/sl4a.RpcReceiverManager:69( 1781):     at 
java.lang.reflect.Constructor.newInstance(Constructor.java:417)
E/sl4a.RpcReceiverManager:69( 1781):     at 
com.googlecode.android_scripting.jsonrpc.RpcReceiverManager.get(RpcReceiverManag
er.java:66)
E/sl4a.RpcReceiverManager:69( 1781):     at 
com.googlecode.android_scripting.jsonrpc.RpcReceiverManager.invoke(RpcReceiverMa
nager.java:86)
E/sl4a.RpcReceiverManager:69( 1781):     at 
com.googlecode.android_scripting.facade.FacadeManager.invoke(FacadeManager.java:
58)
E/sl4a.RpcReceiverManager:69( 1781):     at 
com.googlecode.android_scripting.rpc.MethodDescriptor.invoke(MethodDescriptor.ja
va:109)
E/sl4a.RpcReceiverManager:69( 1781):     at 
com.googlecode.android_scripting.jsonrpc.JsonRpcServer.handleConnection(JsonRpcS
erver.java:99)
E/sl4a.RpcReceiverManager:69( 1781):     at 
com.googlecode.android_scripting.SimpleServer$ConnectionThread.run(SimpleServer.
java:91)
E/sl4a.RpcReceiverManager:69( 1781): Caused by: java.lang.NullPointerException
E/sl4a.RpcReceiverManager:69( 1781):     at 
com.googlecode.android_scripting.facade.CameraFacade.<init>(CameraFacade.java:70
)
E/sl4a.RpcReceiverManager:69( 1781):     ... 8 more
E/sl4a.JsonRpcServer:101( 1781): Invocation error.
E/sl4a.JsonRpcServer:101( 1781): java.lang.NullPointerException
E/sl4a.JsonRpcServer:101( 1781):     at 
com.googlecode.android_scripting.rpc.MethodDescriptor.invoke(MethodDescriptor.ja
va:111)
E/sl4a.JsonRpcServer:101( 1781):     at 
com.googlecode.android_scripting.jsonrpc.JsonRpcServer.handleConnection(JsonRpcS
erver.java:99)
E/sl4a.JsonRpcServer:101( 1781):     at 
com.googlecode.android_scripting.SimpleServer$ConnectionThread.run(SimpleServer.
java:91)
V/sl4a.JsonRpcServer:117( 1781): Sent: 
{"error":"java.lang.NullPointerException","id":1,"result":null}
V/sl4a.SimpleServer$ConnectionThread:100( 1781): Server thread 156 died.
V/sl4a.Process$1:135( 1781): Process 1884 exited with result code 0.
E/sl4a.Relay:157( 1781): Problem while handling incoming data in relay thread
E/sl4a.Relay:157( 1781): java.io.IOException: session closed
E/sl4a.Relay:157( 1781):     at 
org.connectbot.transport.ProcessTransport.read(ProcessTransport.java:81)
E/sl4a.Relay:157( 1781):     at org.connectbot.service.Relay.run(Relay.java:125)
E/sl4a.Relay:157( 1781):     at java.lang.Thread.run(Thread.java:861)

Original issue reported on code.google.com by paulherweg on 5 Dec 2012 at 1:17

GoogleCodeExporter commented 9 years ago
I am seeing the same problem. It does not occur if you use interactive api: 
droid.cameraInteractiveCapturePicture. For my app interactive is not useful. 
But if you are just testing with the provided apps you could use the editor and 
add "Interactive" until the null pointer bug is fixed.

Original comment by rgdad...@gmail.com on 3 Jan 2013 at 5:10