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
New Developer
Posts: 74
Registered: ‎02-09-2011
My Device: Torch 9850/64GB PlayBook
My Carrier: Verizon

Release Build crashes once debug token is removed

Hey guys,

 

I have a problem here that has left me stumped for days on end now. I have an app that runs 100% perfect as it should. I can build a debug version, upload it to the dev alpha, and it runs perfectly. I can also build a release version, upload it to the device, and it runs perfectly. However, if i upload the release build fine and it runs, then i close it, remove the debug token on the device and try and reopen the app it instantly crashes. This even happens when i export a release build, sign it, and upload it to the device with the command line; once the debug token is removed or expired the app fails to open.  This problem has led my app to be denied by BBWorld and i cant seem to find the problem. I get no errors with either build configuration, no errors in the bar-descriptor, and no problems whatsoever while the debug token is loaded. I'm really at a loss here guys so any advice would be greatly appreciated.  Thank you

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Release Build crashes once debug token is removed

Can you describe more precisely what "crash" means here?

You say it "instantly crashes". You also say "fails to open". I could interpret that as anything to a complete lack of action when you tap the icon, right through to something where, say, the splash screen appears, the main window starts to appear, and then the app exits abnormally (which is closer to what I'd call a "crash").

By the way, if the devmode version and the release version are both built properly, the system treats them as entirely different apps, and there could be no connection between the two things. I'm suspecting something going wrong with the way you're building these. Are you doing anything remotely unusual here? I notice you talk about using the command line to upload, which means you're not just using Momentics. I don't use it either, but most people do, so I'd call even that a sign you're doing something at least slightly unusual. Anything beyond that?

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Highlighted
New Developer
Posts: 74
Registered: ‎02-09-2011
My Device: Torch 9850/64GB PlayBook
My Carrier: Verizon

Re: Release Build crashes once debug token is removed

What I mean by crash and fails to open is that when i click the icon the screen stutters to the right for a aplit second as if the ui is going to move into the active frames panel and open the app but it never gets there.  The screen slightly shifts for that spilt second and nothing happens, the OS just stays on the app icon tray. As for building them, I dont do anything unusual i followed the sample apps and didnt change any arguments. I had to add some inclusions such as camera apis. Heres my .pro file:

 

 

TEMPLATE = app
TARGET = MagZoom

LIBS += -lcamapi -lscreen -lexif -lbbdevice

CONFIG += qt warn_on cascades10

QMAKE_CFLAGS_RELEASE += -fstack-protector-strong
QMAKE_CXXFLAGS_RELEASE += -fstack-protector-strong
QMAKE_LFLAGS_RELEASE += -Wl,-z,relro

INCLUDEPATH += ../src
SOURCES += ../src/*.cpp
HEADERS += ../src/*.hpp ../src/*.h

lupdate_inclusion {
SOURCES += ../assets/*.qml
}

device {
CONFIG(release, debug|release) {
DESTDIR = o.le-v7
}
CONFIG(debug, debug|release) {
DESTDIR = o.le-v7-g
}
}

simulator {
CONFIG(release, debug|release) {
DESTDIR = o
}
CONFIG(debug, debug|release) {
DESTDIR = o-g
}
}

OBJECTS_DIR = $${DESTDIR}/.obj
MOC_DIR = $${DESTDIR}/.moc
RCC_DIR = $${DESTDIR}/.rcc
UI_DIR = $${DESTDIR}/.ui

suredelete.target = sureclean
suredelete.commands = $(DEL_FILE) $${MOC_DIR}/*; $(DEL_FILE) $${RCC_DIR}/*; $(DEL_FILE) $${UI_DIR}/*
suredelete.depends = distclean

QMAKE_EXTRA_TARGETS += suredelete

 

and my bar-descriptor with the release build config:

 

<configuration id="com.qnx.qcc.toolChain.1425411071" name="Device-Release">
<platformArchitecture>armle-v7</platformArchitecture>
<asset path="arm/o.le-v7/MagZoom" entry="true" type="Qnx/Elf">MagZoom</asset>
</configuration>

 

I primarily do everything though Momentics but after I export a release build and sign it I use the command line to deploy just the signed bar to check to see if it works before i send it to BlackBerry.

 

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Release Build crashes once debug token is removed

With the latest SDKs, I believe Device-Release actually builds the app as a .so file, using the "Zygote" stuff. An early blog post on this is here http://devblog.blackberry.com/2012/12/cascades-project-zygote/

You would probably be able to troubleshoot an issue like this by unzipping both the working debug mode app, and the failing release mode one, and doing a directory compare. I find Beyond Compare an extremely valuable tool for such analysis, well worth the small price, but there are certainly adequate free options as well.

I'd pay particular attention both to the main executable, but also the contents of the MANIFEST.MF file. Maybe you'll discover something fairly obvious if you do that.

The fact that you don't even see the splash screen suggests to me that the basic packaging is flawed, so I don't yet see any reasons to suspect your own code, aside from whether the right executable is even being invoked (and is included in the .bar).

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!