Log in or register to post comments

QCARUnityPlayer redefinition errors Xcode

June 5, 2013 - 2:15am #1

Vuforia SDK Version: 2.0.32 -

Description with steps to reproduce:

The problem occurs as soon as you add another plugin to your project that also needs to add an include statement to AppController.mm. I for example came across this after adding AutoPilot to my Vuforia project. 

Vuforia's PostProcessBuildPlayer script looks for an include statement in AppController.mm to see if the file has already been patched or that it needs to be. The problem is it's only doing so by looking for the include statement on the first line, and as AutoPilot's post process build phase adds another include statement at the top of the file after Vuforia does so, the Vuforia include statement gets pushed to the second line. Which means that as soon as you build the project for the second time, Vuforia's PostProcessBuildPlayer script doesn't find the statement on the first line and thinks the file needs patching, causing the redefinition errors i was seeing. My fix for now is to have Qualcomm's script look through all lines in AppController.mm to see if it can find the include instatement rather then only the first line.

 

In PostProcessBuildPlayer line 246 replace
 
    # Check to see if file looks like it has alread been processed and
    # only process if it has not
    if lines[0] != '#include \"QCARUnityPlayer.h\"\n':
 
with 
 
    # Check to see if file looks like it has alread been processed and
    # only process if it has not
    alreadyprocessed = False
 
    for line in lines:
        if line == '#include \"QCARUnityPlayer.h\"\n':
            alreadyprocessed = True
            break
 
    if alreadyprocessed == False:

 

Cheers,

Adrien

-

Development OS (Mac OS X, Windows, Linux): Not relevant -

Mobile OS and Version: Not relevant -

Mobile Device Manufacturer and Model name: Not relevant -

Do the Vuforia Sample Applications show the same behavior?: Yes

QCARUnityPlayer redefinition errors Xcode

June 5, 2013 - 2:51am #2

Thanks for this Adrien, and for the workaround.

Will look into this and revert back when we have more info.

cheers,

 

N

Log in or register to post comments