CameraX works on Android Q but not on Android R - android-camerax

I am trying to create a custom camera app using CameraX by following the example from Google Codelabs.
The tutorial specifically states:
We recommend using an AVD that is based on Android 11 or higher.
It is working fine with API 29 (Android 10) but it does not work with API 30 (Android 10+) and produces the following error:
2020-08-11 11:22:34.979 8607-8698/com.codelabs.camerax E/CameraCaptureSession: Session 0: Exception while stopping repeating:
android.hardware.camera2.CameraAccessException: CAMERA_ERROR (3): cancelRequest:459: Camera 0: Error clearing streaming request: Function not implemented (-38)
at android.hardware.camera2.CameraManager.throwAsPublicException(CameraManager.java:1009)
at android.hardware.camera2.impl.ICameraDeviceUserWrapper.cancelRequest(ICameraDeviceUserWrapper.java:99)
at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:1263)
at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:578)
at android.hardware.camera2.impl.CameraCaptureSessionImpl$2.onDisconnected(CameraCaptureSessionImpl.java:789)
at android.hardware.camera2.impl.CameraDeviceImpl$7.run(CameraDeviceImpl.java:245)
at androidx.camera.core.impl.utils.executor.SequentialExecutor$1.run(SequentialExecutor.java:110)
at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.workOnQueue(SequentialExecutor.java:230)
at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.run(SequentialExecutor.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Caused by: android.os.ServiceSpecificException: cancelRequest:459: Camera 0: Error clearing streaming request: Function not implemented (-38) (code 10)
at android.os.Parcel.createExceptionOrNull(Parcel.java:2387)
at android.os.Parcel.createException(Parcel.java:2357)
at android.os.Parcel.readException(Parcel.java:2340)
at android.os.Parcel.readException(Parcel.java:2282)
at android.hardware.camera2.ICameraDeviceUser$Stub$Proxy.cancelRequest(ICameraDeviceUser.java:732)
at android.hardware.camera2.impl.ICameraDeviceUserWrapper.cancelRequest(ICameraDeviceUserWrapper.java:97)
at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:1263) 
at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:578) 
at android.hardware.camera2.impl.CameraCaptureSessionImpl$2.onDisconnected(CameraCaptureSessionImpl.java:789) 
at android.hardware.camera2.impl.CameraDeviceImpl$7.run(CameraDeviceImpl.java:245) 
at androidx.camera.core.impl.utils.executor.SequentialExecutor$1.run(SequentialExecutor.java:110) 
at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.workOnQueue(SequentialExecutor.java:230) 
at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.run(SequentialExecutor.java:172) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:923) 
Dependency:
def camerax_version = "1.0.0-beta07"
// CameraX core library using camera2 implementation
implementation "androidx.camera:camera-camera2:$camerax_version"
// CameraX Lifecycle Library
implementation "androidx.camera:camera-lifecycle:$camerax_version"
// CameraX View class
implementation "androidx.camera:camera-view:1.0.0-alpha14"
implementation "androidx.exifinterface:exifinterface:1.2.0"

Related

Unable to perform web element operations in custom library of Robot Framework 3.1.2 and Python 3.7.4

I have a custom library in Robot Framework and I am trying to pass id of some web element and perform operation on the same.
from robot.libraries.BuiltIn import BuiltIn
class mylibrary:
def get_webdriver_instance(self):
return BuiltIn().get_library_instance('SeleniumLibrary')
def sendkeys_value(self,ele,value):
driver = self.get_webdriver_instance()
element = driver.find_element_by_id(ele)
element.send_keys(value)
When call sendkeys_value in Robot Framework its throwing error as Attribute Error: 'SeleniumLibrary' object has no attribute 'find_element_by_id'
That's because your driver object is a reference to the SeleniumLibrary itself, while it has a property driver itself, which is the actual selenium library. A lot of drivers repeated :) , it's probably easier to explain with an example:
driver = self.get_webdriver_instance().driver

frontend_tuner_status doesn't work in Python FEI

I'm using the Redhawk IDE 2.0.1 in Centos 6.5.
If I generate a Python based FEI, install, run, allocate, and then try to change the center_frequency via the Properties tab in the IDE I get the error:
Failed to update device property: Center Frequency
Error while executing callable. Caused by org.omg.CORBA.NO_IMPLEMENT: Server-side Exception: null vmcid: 0x41540000 minor code: 99 completed: No
Server-side Exception: null
I've tried to totally different systems and I get the same behavior.
If I do the same thing with the C++ project it works fine. Seems to me the auto generated Python code in 2.0.1 is broken like maybe it's not registering the listener? Any ideas are appreciated as this app will be much easier to implement in Python for me. Thanks
The error org.omg.CORBA.NO_IMPLEMENT: Server-side Exception is a CORBA exception indicating that the FEI device does not implement the setTunerCenterFrequency method, despite the FEI device having a DigitalTuner port. The DigitalTuner IDL inherits from the AnalogTuner IDL, which provides the setTunerCenterFrequency method. There must be a bug in the implementation of the FEI DigitalTuner port. In ${OSSIEHOME}/lib/python/frontend/input_ports.py, InDigitalTunerPort does not inherit from the InAnalogTunerPort, which is where the setCenterFrequency method lives. Changing it to the following should fix this issue:
class InDigitalTunerPort(FRONTEND__POA.DigitalTuner, InAnalogTunerPort):
def __init__(self, name, parent=digital_tuner_delegation()):
InAnalogTunerPort.__init__(self, name, parent)
There's a second issue as well. The generated base class instantiates the DigitalTuner port without passing in a reference to itself, the parent. The generated base class of your FEI Device should change from this:
self.port_DigitalTuner_in = frontend.InDigitalTunerPort("DigitalTuner_in")
to this:
self.port_DigitalTuner_in = frontend.InDigitalTunerPort("DigitalTuner_in", self)

failed to create d2d device in c++

I am new to working with windows applications and c++. I am trying to create a D2D device from Dxgi surface of d3d11 device following this code "http://msdn.microsoft.com/en-us/library/windows/desktop/hh404272(v=vs.85).aspx" .
But HRESULT gr ( creating d2d device) gives me an error "E_INVALIDARG" though I followed the same steps as given.
Here is the code snippet.
//m_device is already initialized
// Get DXGI device
IDXGIDevice* DxgiDevice = nullptr;
HRESULT hr = m_Device->QueryInterface(__uuidof(IDXGIDevice), reinterpret_cast<void**>(&DxgiDevice));
// create id2d21factory
ID2D1Factory1* m_d2dFactory=nullptr;
D2D1_FACTORY_OPTIONS options;
options.debugLevel= D2D1_DEBUG_LEVEL_NONE;
D2D1_FACTORY_TYPE factoryType = D2D1_FACTORY_TYPE_SINGLE_THREADED;
hr = D2D1CreateFactory(factoryType, __uuidof(ID2D1Factory1),&options, reinterpret_cast<void **> (&m_d2dFactory));
HRESULT gr= m_d2dFactory->CreateDevice(DxgiDevice, &m_d2dDevice );
This code doesn't give any errors while compiling or building solution in visual studio 2012.
But giving me error while debugging.
I am trying to insert this code in microsoft's desktop duplication sample code. I need to create a d2dbitmap source for my project
please help me with this.
Please let me know if further details are required.
I recommend you set the options to D2D1_DEBUG_LEVEL_INFORMATION when _DEBUG is defined and then you may see some error messages in your output window. For example, the output told me that
D2D DEBUG WARNING - The Direct3D device was not created with D3D11_CREATE_DEVICE_BGRA_SUPPORT, and therefore is not compatible with Direct2D.
which is really helpful.

J2ME NoClassDefFoundError com.sun.midp.io.properties

My J2ME application use the class : com/sun/midp/io/Properties
when i try to install it on nokia C3 or samsung
I see this error in my phone:
No Class Def Found Error
java/lang/NoClassDefFoundError
com/sun/midp/io/Properties
Example code:
Properties p = new Properties();
int s = p.size();
But it works fine with LG
How can I solve this issue.
I tried to add the jsr which contain the class to my application but it didn't work
The classes provided by Sun are subject to license terms, that's probably why they are not presented on all mobile platforms. Also the JVM classes and components vary from platform to platform, since they cover different device configurations and features. You can't solve this issue.

MIDP 2.0 version issues: $method is undefined for $type

I've written a MIDlet that does several "advanced" things: fetching images from the web, resizing them, saving them on the phone, displaying them.
This all works perfectly in the Nokia S60 3rd Edition FP1 emulator. This device has MIDP 2.0 and CLDC 1.1 support (also JSR75, which I need in order to save files). It also works as it should on the Nokia E71 (physical device).
I then tried to run the MIDlet on several other emulators. One of them, the DefaultCldcJtwiPhone2 from the Java ME SDK 3.0, also claims MIDP 2.0 and CLDC 1.1 support. It doesn't have JSR75, which explains why "FileConnection can not be resolved to a type".
This does not, however, explain why List.deleteAll(), String.equalsIgnoreCase(String) and a few others are undefined.
The actual errors that I get:
The method ceil(double) is undefined for the type Math
The method deleteAll() is undefined for the type List
The method equalsIgnoreCase(String) is undefined for the type String
The method getWidth() is undefined for the type Displayable
When I look at the MIDP 2.0 (i.e. JSR118) API (http://java.sun.com/javame/reference/apis/jsr118/), I can clearly see all of these methods being present, with the "since" tag being either MIDP 2.0 or CLDC 1.1.
My question: why doesn't an emulator with MIDP 2.0 support have access to all MIDP 2.0 methods? Or alternatively, what am I doing wrong?
Sounds like you're using methods defined in CLDC 1.1; the emulator you are using must only support CLDC 1.0 (this would certainly explain the lack of equalsIgnoreCase() and anything involving double and float primitives). See the full API here. And see here for a list of differences between 1.0 and 1.1.
EDIT:
Some ways to check the CLDC version of your device:
1) Check the microedition.configuration system property as described here.
System.out.println("The CLDC version is: " + System.getProperty("microedition.configuration"));
2) Check the existence of a class supported only in 1.1.
try {
Class.forName("java.lang.ref.WeakReference");
System.out.println("It's CLDC 1.1");
} catch (ClassNotFoundException e) {
System.out.println("It's CLDC 1.0");
}
Eclipse references both cldc_1.0.jar and cldc_1.1.jar (as well as midp_2.0.jar and midp_2.1.jar).
To fix it:
Go to Window > Preferences > Java ME > Device Managment > your-device > Edit... > Libraries > cldc_1.0.jar > Remove
More details you can find here: http://thompsonng.blogspot.com/2009/09/j2me-setting-eclipse-to-use-cldc-11.html
Even after you have chosen an emulator device that supports CLDC-1.1 , like DefaultCldcJtwiPhone2, you can still configure it to emulate a CLDC-1.0 only phone.
At least that's what the project properties on Netbeans look like.
I got the same problem today(11/03/10) after updating from:
SDK 1.6.0_17 + eclipse ee 3.5.1 + Java_ME_platform_SDK_3.0 EA.
to:
SDK 1.6.0_18 + eclipse ee 3.5.2 + Java_ME_platform_SDK_3.0.
The method ceil(double) is undefined for the type Math
The method floor(double) is undefined for the type Math
The method abs(int) in the type Math is not applicable for the arguments (double)
The method sqrt(double) is undefined for the type Math

Resources