If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
noahhuang
Posts: 100
Registered: ‎10-01-2012
My Device: BB10 Dev Alpha
My Carrier: Roger

Re: app migrated to GOLD release, but fails to launch on device

My situation is I can compiler my codes without any error..

 

But when I try to deploy to simulator, it will show up can not find qtSql.so or qtXML.so... related issues...

 

I have no ideas this is a Gold version or a Break version to developers...

 

Please use plain text.
Developer
Ebscer
Posts: 851
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha
My Carrier: Verizon

Re: app migrated to GOLD release, but fails to launch on device


noahhuang wrote:

 

But when I try to deploy to simulator, it will show up can not find qtSql.so or qtXML.so... related issues...

 


You should not be using the pre-compiled libraries at all for the simulator. These are only for use in the release version of the app.


Read my thoughts on BlackBerry Development at news.ebscer.com
Please use plain text.
Developer
Algorithmus
Posts: 16
Registered: ‎09-17-2012
My Device: Developer

Re: app migrated to GOLD release, but fails to launch on device

I'm having a similar problem. I tried creating a new project to pinpoint what was causing it, and it turns out everytime I try to create a singleton, I get this error message.

I tested this with a completely new project accessed from main.cpp with 

 

Ping mainApp;

 

 

And in Ping.hpp:

 

class Ping : public QObject
{
    Q_OBJECT
public:
    Ping(QObject *parent = 0);
    virtual ~Ping() {}
 
    static Ping* instance();
 
private:
    static Ping* appInstance;
};

 

 

Ping.cpp:

 

Ping::Ping(QObject *parent)
{
    // create scene document from main.qml asset
    // set parent to created document to ensure it exists for the whole application lifetime
    QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
 
    // create root object for the UI
    AbstractPane *root = qml->createRootObject<AbstractPane>();
    // set created root object as a scene
    Application::instance()->setScene(root);
}
 
Ping* Ping::instance() {
if (!appInstance) {
appInstance = new Ping();
}
return appInstance;
}

 

 

If I declare Ping* instance() and Ping* appInstance without static, it works fine. But if they are static, I get "Unable to release application on target", and the app installs correctly, but I can't open it; it quits right away.

Please use plain text.
BlackBerry Development Advisor (Retired)
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: app migrated to GOLD release, but fails to launch on device

 

if (!appInstance) {
appInstance = new Ping();
}

Why would appInstance ever be 0/false?

--
Rob is no longer associated with BlackBerry.
Please use plain text.
Developer
Algorithmus
Posts: 16
Registered: ‎09-17-2012
My Device: Developer

Re: app migrated to GOLD release, but fails to launch on device

Because it's not actually created in the constructor.

 

Furthermore, I've removed the code inside that method except the return statement at some point and it still doesn't change anything, so long as the method is still static.

Please use plain text.
BlackBerry Development Advisor (Retired)
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: app migrated to GOLD release, but fails to launch on device

Variables - including pointers - are not initialised to 0 in C/C++...

 

 

--
Rob is no longer associated with BlackBerry.
Please use plain text.
Developer
Algorithmus
Posts: 16
Registered: ‎09-17-2012
My Device: Developer

Re: app migrated to GOLD release, but fails to launch on device

So how would you suggest implementing a singleton if I can't check to see if the instance is already created?

Please use plain text.
BlackBerry Development Advisor (Retired)
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: app migrated to GOLD release, but fails to launch on device

Do you have a line in your c++ that looks like this? (Code shouldn't link without it...)

 

 

Ping * Ping::appInstance;

 

 

update it to set the variable to 0 / NULL;

 

Ping * Ping::appInstance(0);

 

 

--
Rob is no longer associated with BlackBerry.
Please use plain text.
Developer
Paratheo
Posts: 133
Registered: ‎04-25-2009
My Device: Bold 9900
My Carrier: AT&T

Re: app migrated to GOLD release, but fails to launch on device

This did it for me. Just had to remove the <entryPointType> code and my app launched successfully. Thanks!
Please use plain text.