0

I am trying to open a camera in Blackberry Cascades 10 Beta 3 SDK (C++, QT, QML), and then respond to it once it has opened. I am using the Dev Alpha Simulator, and I keep getting the error "Context: Failed to find target node with id ###" (several times in a row, where ### is some number) after I try to open it. Could this because I don't have an actual camera for the Simulator to use (I'm trying to see if I can code partial functionality for a camera - and then implement full functionality when I actually have a camera for a Blackberry to use), or is there something I have to put in my QML document?

Here is the code that causes this:

(in constructor):

cameraContainer_ = root->findChild<Container*>("cameraContainer);

(in code to open camera):

bb::cascades::multimedia::Camera camera(cameraContainer_);
connect(&camera, SIGNAL(cameraOpened()), this, SLOT(onCameraOpened());
camera.open()
qDebug() << "opening camera..."

(in slot after camera has opened):

void MyCamera::onCameraOpened(){
    qDebug() << "camera has opened";
    disconnect(&camera, SIGNAL(cameraOpened()), this, SLOT(onCameraOpened());
}

(slot is defined in class declaration & class is derived from QObject & the QObject macro is used):

#ifndef MY_CAMERA_H
#define MY_CAMERA_H

#include <QObject>

class MyCamera : public QObject {
Q_OBJECT

//... inbetween lines of code

private slots:
    void onCameraOpened();
//...
}

#endif

And all I get in the console is:

opening camera... Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644 Context: Failed to find target node with id 644

(Sometimes the number is different than 644, but it's usually pretty close to that number).

I also added these lines in bar-descriptor.xml under

<permission system="true">run_native</permission>

They are:

<permission>use_camera</permission>
<permission>access_shared</permission>
<permission>record_audio</permission>

If anyone has any idea of how to solve this - it would be greatly appreciated.

user1296259
  • 521
  • 1
  • 13
  • 33

1 Answers1

0

The camera is not supported on the simulator, I expect that is probably your problem. If you want to be extra sure, try loading up one of the existing camera samples from GitHub, such as https://github.com/blackberry/Cascades-Samples/tree/master/photobomber and see if you are getting a similar issue.

Paul Bernhardt
  • 491
  • 2
  • 6