I’m trying to understand Unity’s “Automated Plugin Integration”, as described here:
If I’m doing it manually, Unity suggests that I put all of my code in the Classes group of the XCode project. Doing this works as intended.
For the automated integration, however, Unity copies (or in this case, symlinks) all of the code to the “libraries” folder instead. This appears to have a completely different context within the XCode project (I’m strictly Visual C++ only when it comes to my C++ knowledge) as it throws hundreds of errors. It can’t find basic include files. It rejects almost every line as a “bad instruction”.
So I guess there’s something I’m not getting about the automated integration. I guess it’s not a huge problem since the manual integration is “good enough” but I’d like to know what I’m doing wrong here or what it is about my code that stops me from being able to use this feature.
Did you ever find a resolution to your problem? I’m running into exactly the same thing: manually linking to files in the Classes folder works great, but using the symlinks created by unity’s “automated integration” chokes the parser.
I’m getting this quite a bit as well - errors on every line of my .mm file. Exporting again from unity + replacing the xcode project seems to fix it sometimes :S
My file looks like
extern "C" {
void DoSave(const char* imagePath)
{
NSString* nsImagePath = [NSString stringWithUTF8String:imagePath];
UIImage *image = [UIImage imageWithContentsOfFile:nsImagePath];
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
}
}
And every line is being marked as “bad instruction” :(:(
Are there caveats for the ‘Automated plugin integration’ as described in http://unity3d.com/support/documentation/Manual/PluginsForIOS.html?
Twice now I’ve been given Objective-C source files by different third parties and I’ve had to add them to the Classes folder manually in Xcode because adding them to the Plugins/iOS folder causes build errors.
Does anyone know anything?
I don’t think this feature actually works yet. It symlinks everything (including .meta files) over to the Libraries/ subdirectory of the XCode project, but doesn’t modify the project definition to reference everything correctly. I did see that it tried to include the symlink to an .a file, but the pathing was wrong inside XCode. It didn’t copy over a standalone .h file, either. I would just do it manually for now - has anyone filed a bug against this behavior?