Log in or register to post comments

Unity Invalid PBX Project

March 11, 2016 - 10:02am #1

Hello! currently been highly interested and have been greatly working with Vuforia through the IOS specific plugin and working with it on Xcode, but at Work with some people we planned to move towards using Unity3D as a helper to set up everything easier among my peers. While Xcode and Ios Vuforia worked without a single blink.

Unity3D on the other hand when were setting up within some Mac environments and Windows (with Unity3d 32bits due to current restrictions), and we try to build for IOS specifically, we found one error at compiling time into a Xcode project that we havent being able to find a reason about why. Using just the core Unity Plugin, and then The Plugin + Examples. same error keeps happening:

Exception: Invalid PBX project (parsing line 757)
UnityEditor.iOS.Xcode.PBX.Parser.ParseKeyValue () (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBX/Parser.cs:149)
UnityEditor.iOS.Xcode.PBX.Parser.ParseTree () (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBX/Parser.cs:120)
UnityEditor.iOS.Xcode.PBX.Parser.ParseValue () (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBX/Parser.cs:164)
UnityEditor.iOS.Xcode.PBX.Parser.ParseKeyValue () (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBX/Parser.cs:152)
UnityEditor.iOS.Xcode.PBX.Parser.ParseTree () (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBX/Parser.cs:120)
UnityEditor.iOS.Xcode.PBX.Parser.ParseValue () (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBX/Parser.cs:164)
UnityEditor.iOS.Xcode.PBX.Parser.ParseKeyValue () (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBX/Parser.cs:152)
UnityEditor.iOS.Xcode.PBX.Parser.ParseTree () (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBX/Parser.cs:120)
UnityEditor.iOS.Xcode.PBXProjectData.ParseContent (System.String content) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBXProjectData.cs:451)
UnityEditor.iOS.Xcode.PBXProjectData.ReadFromStream (System.IO.TextReader sr) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBXProjectData.cs:458)
UnityEditor.iOS.Xcode.PBXProject.ReadFromStream (System.IO.TextReader sr) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBXProject.cs:868)
UnityEditor.iOS.Xcode.PBXProject.ReadFromString (System.String src) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBXProject.cs:863)
UnityEditor.iOS.Xcode.PBXProject.ReadFromFile (System.String path) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBXProject.cs:857)
UnityEditorInternal.Advertisements.UnityAdsPostprocessor.EditXcodeProject (System.String buildFolder) (at C:/buildslave/unity/build/Extensions/UnityAds/UnityAdsEditor/UnityAdsPostprocessor.cs:104)
UnityEditorInternal.Advertisements.UnityAdsPostprocessor.PostProcessBuild_iOS (BuildTarget target, System.String path) (at C:/buildslave/unity/build/Extensions/UnityAds/UnityAdsEditor/UnityAdsPostprocessor.cs:96)
UnityEditor.HostView:OnGUI()

This Error at building the project from Unity3D 32 Bits on Windows causes the Xcode projects to not complete and arent readable and we dont have any specific idea about if its an Issue of having the Unity3d 32 Bits on Windows.. Or because the Unity3D downloader got the IOS Modules and I believe if they are the same of the 64 bits causing an issue? (Unity3d does not provide a downloader assistant for 32 bit specifically, you acquire the editor separately).

Thought Maybe Im missing something specifically. But so far that is been the only problem happening.

Unity Invalid PBX Project

April 12, 2017 - 3:16am #8

To build from WINDOWS u can use some magic:

(In PostProcessBuildPlayer.cs replace to this code)

// The PBXShellScriptBuildPhase appears in Xcode 4 as "Run Script", we need to delete the QCAR

                // directory from the app to avoid a duplicate copy

                if (section == "PBXShellScriptBuildPhase")

                {

                    if (line.Trim().StartsWith("shellScript"))

                    {

                        pbxproj.Flush();

                        var seek = -3;

#if UNITY_EDITOR_WIN

                        seek = -4;

#endif

                        pbxproj.BaseStream.Seek(seek, SeekOrigin.Current);

                        pbxproj.WriteLine("\\nrm -rf \\\"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Data/Raw/QCAR\\\"\";");

                    }

                }

Unity Invalid PBX Project

October 5, 2016 - 5:22am #7

Hi Maclin,



Your suggestion works great. Unity built Xcode project without error and now xcode can parse xcodeproject file.

But the is no code sighning option is showing in build how to run it with code signing.

 

 





 

Unity Invalid PBX Project

September 20, 2016 - 11:54pm #6

hello sir

 

i working currently vuforia but ios iphone not build error is : 

Invalid PBX project (parsing line 757)

UnityEditor.iOS.Xcode.PBX.Parser.ParseKeyValue () (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBX/Parser.cs:149)

UnityEditor.iOS.Xcode.PBX.Parser.ParseTree () (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBX/Parser.cs:120)

UnityEditor.iOS.Xcode.PBX.Parser.ParseValue () (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBX/Parser.cs:164)

UnityEditor.iOS.Xcode.PBX.Parser.ParseKeyValue () (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBX/Parser.cs:152)

UnityEditor.iOS.Xcode.PBX.Parser.ParseTree () (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBX/Parser.cs:120)

UnityEditor.iOS.Xcode.PBX.Parser.ParseValue () (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBX/Parser.cs:164)

UnityEditor.iOS.Xcode.PBX.Parser.ParseKeyValue () (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBX/Parser.cs:152)

UnityEditor.iOS.Xcode.PBX.Parser.ParseTree () (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBX/Parser.cs:120)

UnityEditor.iOS.Xcode.PBXProjectData.ParseContent (System.String content) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBXProjectData.cs:451)

UnityEditor.iOS.Xcode.PBXProjectData.ReadFromStream (System.IO.TextReader sr) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBXProjectData.cs:458)

UnityEditor.iOS.Xcode.PBXProject.ReadFromStream (System.IO.TextReader sr) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBXProject.cs:868)

UnityEditor.iOS.Xcode.PBXProject.ReadFromString (System.String src) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBXProject.cs:863)

UnityEditor.iOS.Xcode.PBXProject.ReadFromFile (System.String path) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/XCode/PBXProject.cs:857)

UnityEditorInternal.Advertisements.UnityAdsPostprocessor.EditXcodeProject (System.String buildFolder) (at C:/buildslave/unity/build/Extensions/UnityAds/UnityAdsEditor/UnityAdsPostprocessor.cs:104)

UnityEditorInternal.Advertisements.UnityAdsPostprocessor.PostProcessBuild_iOS (BuildTarget target, System.String path) (at C:/buildslave/unity/build/Extensions/UnityAds/UnityAdsEditor/UnityAdsPostprocessor.cs:96)

UnityEditor.HostView:OnGUI() 

whats is solution please give me answer 

Unity Invalid PBX Project

June 19, 2016 - 9:46am #5

EDIT: After actually reading the original post, your problem isn't exactly the same as the issue I had - which is caused by Vuforia/Unity failing to modify the Xcode project file. Nevertheless, some people might find this post helpful.

I encountered this problem today building to iOS using Vuforia 5.5.9 and Unity 5.3.5f1. It's pretty easy to remedy if you look at the code. The error occurs in PostProcessBuildPlayer.cs where Vuforia is adding Framework and Resource entries, along with a few other changes to the built Xcode project file (something that wasn't done in previous versions of Vuforia). Since it doesn't seem to work, it needs to be done manually:

  1. Firstly, get rid of PostProcessBuildPlayer.cs in <Project>/Assets/Vuforia/Editor/Scripts/.
  2. Build your project as normal, opening it in Xcode when finished.
  3. Add Security.framework in Build Phases->Link Binary with Libraries. Vuforia also adds AVFoundation, CoreMedia and CoreVideo - but I found that these libraries were already included (probably by Unity).
  4. In Build Settings->Build Options - set Enable Bitcode to "No" (disables bitcode).
  5. In Build Settings->Linking->Other Linker Flags - add "-lc++" (adds C++11 support). I didn't actually do this, but it's probably safe.

Additionally, I discovered a few fixes for other errors in iOS/Unity/Vuforia projects but I'm not sure if they're still required:

  1. Build Settings->Search Paths->Library Search Paths - fix "$(SRCROOT)/Libraries/Plugins/iOS" to have only forward slashes.
  2. Build Settings->Apple LLVM x.x - Code Generation - set Optimization Level to NONE[-o0] or FAST[-O, O1].

Otherwise, this should be enough to get your project going, as it did for me with a simple single marker project. This doesn't include adding resource files. Interestingly enough, this didn't seem to matter as my build from Unity didn't include any resource files (which are usually found in "<XcodeProjectDirectory>/Data/Raw/") and everything still works as intended.

This might be a problem with some more complex apps, or if there are resources in the above directory, so you'll need to do your own sleuthing. It probably involves adding said resources in Xcode under "Build Phases->Copy Bundle Resources". EDIT: More recent versions of Vuforia now require you to use a database to hold your marker(s), which you'll have to add with the above "Build Phases->Copy Bundle Resources->Add->Add other"  browsing to <Project>/Data/Raw/QCAR.

Hopefully this works for those experiencing this issue.

Unity Invalid PBX Project

April 18, 2016 - 5:08pm #4

jacobwesgreene wrote:

Thanks for the information. Does Vuforia still support building Vuforia-iOS projects with Unity on a Mac? Thanks.

Yes

Unity Invalid PBX Project

April 14, 2016 - 6:17am #3

Thanks for the information. Does Vuforia still support building Vuforia-iOS projects with Unity on a Mac? Thanks.

Unity Invalid PBX Project

March 14, 2016 - 11:42am #2

Building a Vuforia iOS project with Unity on Windows is not a use-case that we support. There's been various compiling or technical issues reported by users when attempting this in the past. If you find a successful workaround, feel free to share the technique if you like. When running Unity 32-bit Installer on Windows 64-bit, you do need to deselect the "Unity Editor" option during setup or the installer will detect the 64-bit OS and try to install the 64-bit Editor instead.

Log in or register to post comments