App crashes immediately upon launch

Home / Forums / Marmalade Archive / Deployment, devices and platforms / App crashes immediately upon launch
16 replies [Last post]
by: TT_2
Status: Offline
Joined: 2011-03-28
Points: 1030

Hi

Deployed a version of my app on an iPad for the first time. Its an iPad 1. Im have marmalade sdk v5.1. App won't even launch. I see a black screen for a second and then it crashes back to the homescreen instantly.

Log message is as follows:

Tue May 15 22:59:10 my-iPad myapp[396] : Marmalade v5.1.0: main thread
Tue May 15 22:59:10 my-iPad SpringBoard[27] : Unable to get entitlements for client task. Error: Error Domain=NSMachErrorDomain Code=-536870160 "The operation couldnt be completed. (Mach error -536870160 - (iokit/common) data was not found)" UserInfo=0x2f88c0 {}
Tue May 15 22:59:10 my-iPad SpringBoard[27] : No valid 'aps-environment' entitlement string found for application 'myapp': (null). Notifications will not be delivered.
Tue May 15 22:59:10 my-iPad kernel[0] : launchd[396] Builtin profile: container (sandbox)
Tue May 15 22:59:10 my-iPad kernel[0] : launchd[396] Container: /private/var/mobile/Applications/F5EC4310-EB26-4C07-A097-D3F4914C1C51 [69] (sandbox)
Tue May 15 22:59:10 my-iPad myapp[396] : loader thread r9 = 0x00000000
Tue May 15 22:59:10 my-iPad myapp[396] : didFailToRegisterForRemoteNotificationsWithError
Tue May 15 22:59:10 my-iPad myapp[396] : Error in registration. Error: Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x222c60 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}
Tue May 15 22:59:11 my-iPad ReportCrash[397] : Formulating crash report for process myapp[396]
Tue May 15 22:59:11 my-iPad com.apple.launchd[1] (UIKitApplication:com.myco.myapp[0x5956][396]) : (UIKitApplication:com.myco.myapp[0x5956]) Job appears to have crashed: Bus error
Tue May 15 22:59:11 my-iPad SpringBoard[27] : Application 'myapp' exited abnormally with signal 10: Bus error
Tue May 15 22:59:11 my-iPad ReportCrash[397] : Saved crashreport to /var/mobile/Library/Logs/CrashReporter/myapp_2012-05-15-225911_my-iPad.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0

Tried my best to follow all steps required to deploy. Does anyone know what's going on?

Thanks

by: Danny Chapman
Status: Offline
Joined: 2011-11-03
Points: 2630
Assuming you're developing on

Assuming you're developing on windows, you can deploy to windows, and that will check that you included all the assets in the mkb (whether or not they're in a resource group). Just the same as deploying to device - it just might be more convenient sometimes.

by: Samantha C
Status: Offline
Joined: 2011-11-23
Points: 4120
Does your app run ok in the

Does your app run ok in the Simulator?

The log you provided doesn't contain any Marmalade output. You should deploy a debug build, connect the device to your machine and view the log output while your app runs using the iphone configuration utility.

by: TT_2
Status: Offline
Joined: 2011-03-28
Points: 1030
Hi Thanks for your

Hi

Thanks for your response, that was very helpful. Goes to show how far removed I am from development that I didn't think of deploying a debug build myself!

At any rate, the app does run ok on the simulator. I did now deploy a debug build to the ipad. Now there is a popup stating IwAssert failure (GX, 1339). Message. Could not find resource named mysoundgroup (of type CIwSoundGroup).

This is interesting, so the app has no issues finding the resource on my pc when running the simulator, but it cant find them once deployed on the device. Any suggestions on how to resolve?

Thanks once again

by: Samantha C
Status: Offline
Joined: 2011-11-23
Points: 4120
This error means that you you

This error means that you you are trying to access a resource that is not part of your project. Running an x86 Debug build will build your resources automatically, and the files will be generated under data-ram\data-gles1.

You should check that all the files within that directory are named within your MKB file. Hope that helps.

by: TT_2
Status: Offline
Joined: 2011-03-28
Points: 1030
Samantha C: I ran an x86

Samantha C:

I ran an x86 debug build. However, I am not seeing any folder called data-gles1 under data-ram. There is a data-sw folder and resource_cache folder under data-ram. Not sure what I might be missing.

Danny Chapman:

I tried to do a windows deployment with the x86 Debug build. Still very new to the deploy tool but any way I did a deploy all with configuration: default and platform: Windows (Simulator) which generated a .exe file of my app. When I run it gives the message IwAssert failure (UTIL, 1626).
Message: Failed to open file IwUICalculator.group. I started my app of the IwUICalculator example, still using the original name for the group file. I do see a iwuicalculator.group.bin file under the same folder as the exe. Once again, not sure whats going on. I reallly am a little lost about this whole deployment thing. Any help is appreciated.

by: Danny Chapman
Status: Offline
Joined: 2011-11-03
Points: 2630
If you do a debug windows

If you do a debug windows deployment it will still try to process your assets - i.e. load the .group (and everything) and generate a .group.bin. If you do a release windows deployment you should be able to repro/track down/check the crashes you're getting on device - it might just be a little easier.

Anyway - it sounds like you need to find a .group.bin file and add it to the .mkb. Perhaps it's in the data-ram/data-sw directory? from a quick search of the docs for data-sw, it looks like this is where it puts/gets the compiled resources when in software rendering mode - was that intentional? Maybe this would happen if you were working on a machine that didn't have hardware rendering?

by: TT_2
Status: Offline
Joined: 2011-03-28
Points: 1030
Hello Sorry it has taken so

Hello

Sorry it has taken so long to respond to this.

Summary of the situation is as follows:

1. Both the x86 debug and release builds work fine when I run them from Visual Studio. No errors, no crashes.
2. When I run the .s86 file under the debug_x86 build folder, I noticed I needed to put a copy of the s3e.icf and app.icf files into the build folder before the application would run, and even then, Im getting the error message "Failed to open file IwUICalculator.group". Not sure what I have to do for it to be able to open the group file.
3. As already stated, when running the arm debug build on an ipad, I get the message "IwAssert failure (GX, 1339). Message. Could not find resource named mysoundgroup (of type CIwSoundGroup)."
4. I have no idea why I have a data-sw folder instead of a data-gles1 folder under data-ram, not sure how to check whether I have a device that doesnt do hardware rendering.

Any further help is appreciated.

Thanks

by: TT_2
Status: Offline
Joined: 2011-03-28
Points: 1030
Ok So I have made a slight

Ok

So I have made a slight bit of progress. What I am learning is that I'm running into bugs that for some reason aren't caught via running the build on the IDE.

I looked further into why I was getting the "could not find resource" error, and its because I was not correctly accessing the group file. I was trying to load a sound group when the soundspecs are already defined in my main group file, and can be accessed directly without needing to load the soundgroup. So, at any rate, I have managed to correct that problem. The code still runs fine in VS and now I dont get the error when deploying the arm debug build to the ipad.

However I've now hit the next bug, I get the following error:

IwAssert failure:
Channel: PROPERTYSET
File: IwDecomposable.cpp
Line: 60
Expression: false
Message: Could not find string for hash
Callstack:
_IwGxInitPipeline

From http://www.madewithmarmalade.com/node/2819 it seems like it may have something to do with buttons, slots and handlers, but its not clear what I'm doing wrong.

by: TT_2
Status: Offline
Joined: 2011-03-28
Points: 1030
As a test I built and

As a test I built and deployed the IwUICalculator example on ios, which I had used as the basis for my app. Of course it works fine, which means I've made some modifications that are messing things up, although Im not sure if they're in my cpp, mkb, ui or group file. Interestingly the sequence of errors I'm facing is the exact same as those reported in http://www.madewithmarmalade.com/devnet/forum/5749, although I'm not using CIwUISlider. No proposed or actual solution is provided there either.

by: TT_2
Status: Offline
Joined: 2011-03-28
Points: 1030
Still havent been able to

Still havent been able to figure this out. Any help is appreciated. I pretty much have a working prototype on the simulator, but really need to get one working on ios.

by: TT_2
Status: Offline
Joined: 2011-03-28
Points: 1030
Hi,

Hi,

I have tried to strip the app down to the bare minimum, and Im still facing the same issue. This time I'm including code so that hopefully someone can point something out. I have based the app on the IwUI calculator example, so some of the files etc still refer to that. I'm trying to do something quite simple: Click a button which will display an image within the button and play a sound.

MKB:

#!/usr/bin/env mkb
options
{
strict
module_path="$MARMALADE_ROOT/examples"
}

subprojects
{
iwui
iwresmanager
SoundEngine
}

includepaths
{
h
}

files
{
(source)
IwUICalculator.cpp

[Data]
(data)
IwUICalculator.group
IwUICalculator/IwUICalculator.ui
}

assets
{
#Deploy .group.bin files from the 'data-ram/data-gles1' directory if they
#have been written there by running the application in resource building
#mode, otherwise deploy pre-built binaries from the 'data' directory.
#
#For your own application, you are likely to want only the
#'data-ram/data-gles1' directory specified here.
#
#See the IwResManager documentation for more information on resource building.

(data-ram/data-gles1, data)
iwuicalculator.group.bin

(data)
IwUICalculator/sounds/sound1.wav
IwUICalculator/textures/image1.tga

}

deployments
{
["iPad"]
name='myapp'
caption='myapp'
manufacturer='myco'
provider='myco'
version-major=0
version-minor=1

iphone-appid='com.myco.myapp'
}
#### AUTO GENERATED deployment settings from DeployTool.exe. Do not edit below this line ####
deployments
{
["Default"]
["iPad"]
}

Group file:

include resource_templates.itx

CIwResGroup
{
name "IwUICalculator"

useTemplate "image" "iwui"
useTemplate "mtl" "iwui"

iwui_style/iwui_style.group { inline true }

//My images
IwUICalculator/textures/image1.tga

//My sounds
IwUICalculator/sounds/sound1.wav

//Other images
IwUICalculator/textures/dark_button_up.tga
IwUICalculator/textures/dark_button_down.tga
IwUICalculator/textures/dark_background.tga
IwUICalculator/textures/dark_focus.tga

CIwSoundSpec
{
name "sound1"
data "sound1" # The wav file name (without .wav)
vol 0.7
loop false
}

// Create a sound group to contain all of our sound specs
CIwSoundGroup
{
name "soundgroup1"
addSpec "sound1"
}

useTemplate "image" "default"
useTemplate "mtl" "default"

IwUICalculator/IwUIStyles.itx
IwUICalculator/IwUICalculator.ui
}

UI File:

CIwUIElement
{
name "calculator"
pos { 0 0 }
size { 320 480 }
CIwUIImage
{
name "Background"
pos { 0 0 }
size { 320 480 }
texture "background"
}
CIwUIElement
{
name "Grid_0"
pos { 0 0 }
size { 320 475 }
offset { 0 26 }
sizeMin { 320 475 }
sizeMax { 320 475 }
sizeHint { 320 475 }
sizeToContent false
CIwUIButton
{
name "Button_1"
pos { 0 0 }
size { 64 64 }
style
sizeMin { 64 64 }
sizeHint { 64 64 }
sizeToContent true
OnButtonClick { "CController::OnClickButton_1" }
}

CIwUILayoutGrid
{
name "Grid"
sizeToSpace false
numColumns 1
numRows 1
element
{
name "Button_1"
alignH "right"
alignV "bottom"
row 0
column 0
}
}
}
CIwUILayout
{
sizeToSpace true
name "Layered_0"
element
{
name "Background"
}
element
{
name "Grid_0"
alignH "centre"
}
}
}

cpp file:

// Library includes
#include "IwGx.h"
#include "IwGxFont.h"
#include "IwUI.h"
#include "IwUIAnimation.h"
#include "IwUIController.h"
#include "IwUIButton.h"
#include "IwUICheckbox.h"
#include "IwUIElement.h"
#include "IwUIEvent.h"
#include "IwUILabel.h"
#include "IwUISlider.h"
#include "IwUIView.h"
#include "IwUIProgressBar.h"
#include "IwUIPropertySet.h"
#include "s3eKeyboard.h"
#include "IwUISoftKeyboard.h"
#include "IwUITextInput.h"
#include "IwSound.h"
#include "IwSoundInst.h"
#include "IwSoundSpec.h"

extern bool g_IwTextureAssertPowerOf2;
bool g_Quit;
bool g_AC;

CIwUIElement* pWidgets;
CIwUIButton* pButton;
CIwResGroup* pResGroup;
CIwTexture* image;
CIwSoundSpec* SoundSpec;
CIwSoundInst* SoundInstance;

#define DEFAULTSTYLE

#ifdef DEFAULTSTYLE
// Load the default Stylesheet
static const char* s_Stylesheets[] =
{
"Small", // Small Size
"Medium", // Medium Size
"Large", // Large Size
};
#else
// Load the dark Stylesheet
static const char* s_Stylesheets[] =
{
"SmallDark", // Small Size
"MediumDark", // Medium Size
"LargeDark", // Large Size
};
#endif

class CController : public CIwUIController
{
public:
CController()
{
IW_UI_CREATE_VIEW_SLOT1(this, "CController", CController, OnClickButton_1, CIwUIElement*)
}

private:
void OnClickButton_1(CIwUIElement*)
{
pButton = (CIwUIButton*)pWidgets->GetChildNamed("Button_1");

image = (CIwTexture*)pResGroup->GetResNamed("image1", IW_GX_RESTYPE_TEXTURE);
IwUISetPropertyOnInlineStyle(pButton, "buttonUp", "texture", image);
IwUISetPropertyOnInlineStyle(pButton, "buttonUp", "drawableType", IwHashString("image"));

IwGetSoundManager()->Update();
SoundSpec = (CIwSoundSpec*)pResGroup->GetResNamed("sound1", IW_SOUND_RESTYPE_SPEC);
SoundInstance = SoundSpec->Play();
}
};

int main()
{
g_IwTextureAssertPowerOf2 = false;
g_Quit = false;

// Initialize IwUI
IwUIInit();

// Init IwSound
IwSoundInit();

#ifdef IW_BUILD_RESOURCES
// Tell resource system how to convert WAV files
IwGetResManager()->AddHandler(new CIwResHandlerWAV);
#endif

{
CIwUIView view;
CController controller;

pResGroup = IwGetResManager()->LoadGroup("IwUICalculator.group");

{
// Cut-off sizes for stylesheet scale decision
const int32 area_0 = (320*480); // Smaller than this uses small style
const int32 area_1 = (640*480); // Larger/Equal than this uses large style
const int32 actual_area = s3eSurfaceGetInt(S3E_SURFACE_HEIGHT)
*s3eSurfaceGetInt(S3E_SURFACE_WIDTH);
int32 style_id = 1;
if(actual_area=area_1)
style_id = 2;

CIwResource* pResource = pResGroup->GetResNamed(s_Stylesheets[style_id], IW_UI_RESTYPE_STYLESHEET);
IwGetUIStyleManager()->SetStylesheet(IwSafeCast(pResource));
}

pWidgets = CIwUIElement::CreateFromResource("calculator");
view.AddElement(pWidgets);
view.AddElementToLayout(pWidgets);

// Ensure layout is valid prior to setting focus element
view.Layout();

// Pick an element to have focus by default
CIwUIElement* pFocusElement = pWidgets->GetChildNamed("Button_1");
IwGetUIView()->RequestFocus(pFocusElement);

while(!g_Quit)
{
IwGxClear(IW_GX_COLOUR_BUFFER_F | IW_GX_DEPTH_BUFFER_F);

// Update Iw Sound Manager
IwGetSoundManager()->Update();

IwGetUIController()->Update();
view.Update(50);
view.Render();

IwGxFlush();
IwGxSwapBuffers();
s3eDeviceYield();

// Wait until something happens
s3eDeviceYieldUntilEvent();
s3eKeyboardUpdate();
s3ePointerUpdate();

// Check for quit request
g_Quit |= (s3eDeviceCheckQuitRequest()!=0);
}

IwSoundTerminate();
IwGetResManager()->DestroyGroup(pResGroup);
}

IwUITerminate();
return 0;
}

Works fine on x86 debug. When I deploy Arm debug build to iPad, I get the following error:

IwAssert failure:
Channel: PROPERTYSET
File: IwDecomposable.cpp
Line: 60
Expression: false
Message: Could not find string for hash
Callstack:
_IwGxInitPipeline

And when I click ignore, I get this error:

IwAssert failure:
Channel: PROPERTYSET
File: IwUIElementSignal.cpp
Line: 125
Expression:
!g_IwUIAssertMissingSlot
Message: Unable to resolve slot '::' to attach signal '' of element ''
Callstack:
_IwGxInitPipeline

Once again note that I do not get any errors when running the x86 debug build from Visual Studio on my pc.

Any ideas?

Thanks

by: TT_2
Status: Offline
Joined: 2011-03-28
Points: 1030
Hi

Hi

After reading a few posts, I'm wondering if the issues I am facing are related to software rendering.

Early on when I started playing with marmalade (when trying to run HelloWorld), I realized the simulator was hanging. After some reading, I realized it was to do with some GL rendering issues and in some posts it was mentioned that I need to add the line DisableGL=1 into the s3e.icf files. That worked like a charm and I was able to proceed with development.

However, as a result, in my data-ram folder I have a data-sw folder but no data-gles folder. I'm suspecting that the group.bin and other files in data-sw are for some reason not compatible with IOS.

So, how do I get a GL enabled group.bin files? Removing DisableGL=1 from s3e.icf does not seem to create a data-gles folder, so what is it that I need to do? Any suggestions?

by: TT_2
Status: Offline
Joined: 2011-03-28
Points: 1030
Hi

Hi

Well, I have "partially" cracked this! The MKB file was looking for the group.bin file under data-ram/data-gles1, but there was no such folder on my PC. Instead there is a data-ram/data-sw folder. So I changed that in the MKB file and voila! My app (almost) works on the iPad!!

Only issue is, the image is rendering, however, the sound is not playing. No errors showing up either. Any ideas on what this may be? Note: sound plays fine on x86 debug.

by: TT_2
Status: Offline
Joined: 2011-03-28
Points: 1030
Hmm....might be my device.

Hmm....might be my device. s3esoundbasic example is not playing sound either. I noticed other games are not playing sound. youtube videos are though. i will investigate further.

by: TT_2
Status: Offline
Joined: 2011-03-28
Points: 1030
The sounds of some games is

The sounds of some games is working. e.g. I have EA hot pursuit installed. sound works on that. but not on Sega Sonic Racing. Anyone know what might be going on?

by: TT_2
Status: Offline
Joined: 2011-03-28
Points: 1030
Ipad Mute rocker was causing

Ipad Mute rocker was causing the problem. Duh. This case is closed. Thanks.

Latest Posts

Latest Comments

Top Contributors

  • Chris D : 27,010
  • MonRoyals : 26,970
  • Salman : 26,720
  • Jez Hammond : 20,130
  • pjan : 11,150
  • gjw : 10,350
  • Paolo Oliverio : 9,640
  • Beaker_2 : 8,390
  • Kite : 8,210
  • bluescrn : 7,810