Author Topic: Failed To Install  (Read 7647 times)

matthewsjc1

  • Guest
Failed To Install
« on: May 03, 2012, 12:47:00 am »
I've installed one test app before and I'm trying to install another to my iPhone, but when trying to sync, I get an error message that says it failed to install. I replaced the mobileprovision file first. Not sure what's going on..,

martol1ni

  • Guest
Re: Failed To Install
« Reply #1 on: May 03, 2012, 12:55:32 am »
Have you checked if there are any errors? In your return zip file from the build center...

matthewsjc1

  • Guest
Re: Failed To Install
« Reply #2 on: May 03, 2012, 01:00:16 am »
I don't see any error log files or anything. The only thing I could think of is that I included stdlib, but the help file says standard libraries are usable. Everything works fine I the simulator.

martol1ni

  • Guest
Re: Failed To Install
« Reply #3 on: May 03, 2012, 01:03:05 am »
All includes should work without a problem. I think it's either the mobileprovision or something wrong in your code. There are somethings that I have experienced is working fine in the simulator, but is not allowed on the actual device.

matthewsjc1

  • Guest
Re: Failed To Install
« Reply #4 on: May 03, 2012, 01:06:54 am »
It's a very simple app. I'm just playing around with the sdk. Here's my source code:

#include "DragonFireSDK.h"
#include "stdlib.h"
using namespace std;

int AddToScore(int touchId);

const int CUR_SCORE_TEXT_MAX_LENGTH = 200;
const int CUR_SCORE_FONT_SIZE = 20;
int fontId = 0;
int curScore = 0;
char curScoreText[10] = "\0";
int scoreLabelId = 0;
int scoreButtonId = 0;
const int BUTTON_TOUCH_ID = 1;

void AppMain()
{
   fontId = FontAdd("Arial", "Regular", CUR_SCORE_FONT_SIZE, 0xff0000);
   scoreButtonId = ButtonAdd("Images/button", 100, 100, AddToScore, BUTTON_TOUCH_ID);
   scoreLabelId = TextAdd(10, 10, curScoreText, fontId);
}

void AppExit()
{
}

void OnTimer()
{
   itoa(curScore, curScoreText, 10);
   TextSetText(scoreLabelId, curScoreText);
}

int AddToScore(int touchId)
{
   curScore++;
   return 0;
}

matthewsjc1

  • Guest
Re: Failed To Install
« Reply #5 on: May 03, 2012, 01:07:59 am »
Hmmm... just noticed I used "stdlib.h" instead of <stdlib>. i wouldn't think that would make a difference, but...

matthewsjc1

  • Guest
Re: Failed To Install
« Reply #6 on: May 03, 2012, 01:10:41 am »
Maybe something to do with itoa be deprecated?

martol1ni

  • Guest
Re: Failed To Install
« Reply #7 on: May 03, 2012, 01:11:40 am »
I wouldn't think so, remove using namespace std, that I am sure you can't use. That did at least give me a problem once.

matthewsjc1

  • Guest
Re: Failed To Install
« Reply #8 on: May 03, 2012, 01:16:40 am »
I uploaded without it and will try it out. Thanks a bunch :) So, iTunes won't let the app install if it detects an internal problem within the app?

matthewsjc1

  • Guest
Re: Failed To Install
« Reply #9 on: May 03, 2012, 01:18:13 am »
K. I got it back with errors this time, because itoa was found in the namespace. Guess I'll try it and manually declaring the namespace with each call.

martol1ni

  • Guest
Re: Failed To Install
« Reply #10 on: May 03, 2012, 01:27:34 am »
K. I got it back with errors this time, because itoa was found in the namespace. Guess I'll try it and manually declaring the namespace with each call.

Nope, doesn't seem that way. :-) Try not to use too many "c++ shortcuts" in forms of using std namespaces and stuff like that. I am guessing the converter that tries to build it over to objective-c is strugging a bit with those lines, maybe not causing errors, just don't get anything.

matthewsjc1

  • Guest
Re: Failed To Install
« Reply #11 on: May 03, 2012, 01:36:49 am »
Well, got it to install, but I had to remove anything to do with std and the text functions. Is there possibly a configuration I have to set in VC++ 2010 that is causing a problem?? Without use of the standard libraries, functionality is gonna be pretty limited.

matthewsjc1

  • Guest
Re: Failed To Install
« Reply #12 on: May 03, 2012, 01:51:30 am »
I figured it out. DragonFire doesn't convert itoa to a compatible form in iOS. I found a source online that talks about it:

Quote
« on: March 16, 2012, 10:31:55 pm »
If you're trying to use the non-standard itoa() function on your device, here is a one that I wrote so that code that uses this function will compile for iOS.

Add the following to your App.cpp file:

Code: [Select]
#ifdef __APPLE__
char *itoa(int value,char *str,int radix)
    {
    switch (radix)
        {
        case 8:  // Octal
            sprintf(str,"%o",value);
            break;
        case 10: // Decimal
            sprintf(str,"%d",value);
            break;
        case 16: // Hex
            sprintf(str,"%x",value);
            break;
        default: // Other - assume decimal
            sprintf(str,"%d",value);
            break;
        }
    return(str);
    }
#endif
This will let you continue to use itoa() on iOS.  Alternatively, you could also just use sprintf(), but that's another story!

Enjoy!
Logged

I'll just use sprintf isntead. Thanks for the help man!
,Jared

matthewsjc1

  • Guest
Re: Failed To Install
« Reply #13 on: May 03, 2012, 01:58:37 am »
Works

nednones

  • Guest
Re: Failed To Install
« Reply #14 on: May 03, 2012, 02:12:42 am »
If you need to access overloaded methods in the classes attached as header files, you can't use the "using namespace std". You can however declare std::"property type/method", e.g. std::string varname.