Closed kyubuns closed 10 years ago
On what Unity version are you having this problem? Are you building on Mac or Windows ?
sorry,
System.Uri rootURI = new System.Uri( ( projectRootPath + "/." ) ); ↓ System.Uri rootURI = new System.Uri( ( filePath + "/." ));
this code is lie. (create other bugs.)
Unity 4.5.0 using OS X 10.9.2
I think, filePath is not full path. ↓the code may return not full path.
this.projectRootPath = filePath; in public XCProject( string filePath )
What kind of project/build path are you having? Does it contain special characters?
ex.
if( tree.CompareTo( "SOURCE_ROOT" ) == 0 ) { Debug.Log(absPath); // -> /Users/hoge/fuga/Assets/Plugins/Everyplay/iOS/Everyplay.framework (full path) Debug.Log(filePath); // -> /Users/hoge/fuga/Assets/Plugins/Everyplay/iOS/Everyplay.framework (full path) Debug.Log(projectRootPath); // -> xcode_project (not full path, this is /Users/hoge/fuga/xcode_project) System.Uri fileURI = new System.Uri( absPath ); System.Uri rootURI = new System.Uri( ( projectRootPath + "/." ) ); // raise UriFormatException! filePath = rootURI.MakeRelativeUri( fileURI ).ToString(); }
no contain special characters.
I was not able to replicate this issue. For me the projectRootPath is logged as full path and does not raise any exceptions. Tested with Unity 4.5 and Mac OS 10.9.2.
Could you try to build a new blank project with Everyplay and see if the problem happens for that too?
ex. /Users/hoge/fuga is Unity Project Directory ( /Users/hoge/fuga/Assets, /Users/hoge/fuga/ProjectSettings, /Users/hoge/fuga/Temp, etc... ) Can you test XCode save path == /Users/hoge/fuga/test?
Could you try to build a new blank project with Everyplay and see if the problem happens for that too?
I'll try it, later.( I don't use the machine a few hours :-P )
Tried, with same project name in my home dir and building to fuga/test but unfortunately unable to replicate.
oh... okey... wait please...
if( tree.CompareTo( "SOURCE_ROOT" ) == 0 ) { Debug.Log(absPath); // -> /Users/hoge/fuga/Assets/Plugins/Everyplay/iOS/Everyplay.framework (full path) Debug.Log(filePath); // -> /Users/hoge/fuga/Assets/Plugins/Everyplay/iOS/Everyplay.framework (full path) Debug.Log(projectRootPath); // -> xcode_project (not full path, this is /Users/hoge/fuga/xcode_project) System.Uri fileURI = new System.Uri( absPath ); System.Uri rootURI = new System.Uri( ( "/Users/hoge/fuga/xcode_project/." ) ); // changed filePath = rootURI.MakeRelativeUri( fileURI ).ToString(); }
this is success.
i'll test blank project.
sorry, I cannot replicate in blank project. I'll check other PostProcesses. thank you.
i found. This is caused by this code.
BuildPipeline.BuildPlayer(levels, "xcode_project", BuildTarget.iPhone, BuildOptions.None);
This code is working well on Unity and other assts. Can you support this code?
What if you change the "xcode_project" to "/Users/hoge/fuga/xcode_project" ?
BuildPipeline.BuildPlayer(levels, "/Users/hoge/fuga/xcode_project", BuildTarget.iPhone, BuildOptions.None);
Build Success when use this.
but,
BuildPipeline.BuildPlayer(levels, Application.dataPath + "../xcode_project", BuildTarget.iPhone, BuildOptions.None);
This is not success.
The following build commands failed: CpResource /Users/hoge/fuga/Plugins/Everyplay/iOS/Everyplay.bundle build/test.app/Everyplay.bundle
in XCode project build.
× /Users/hoge/fuga/Plugins/Everyplay/iOS/Everyplay.bundle ○ /Users/hoge/fuga/Assets/Plugins/Everyplay/iOS/Everyplay.bundle
Don't use ../
Do it like this instead:
string dstPath = Application.dataPath.Substring(0, Application.dataPath.IndexOf("Assets"));
dstPath = System.IO.Path.Combine(dstPath, "xcode_project");
BuildPipeline.BuildPlayer(levels, dstPath, BuildTarget.iPhone, BuildOptions.None);
excellent! be that as it may, this is bug? or not? (Should I close this issue?)
The problem seems to happen inside a 3rd party tool which we use for editing the xCode project. I don't know if it is a bug or if it just does not support relative paths. I need to take a closer look at it in some point, however you can use the above workaround for now.
ok! thank you paugit!
You are welcome :)
in Everyplay/XCodeEditor/XCProject.cs
caused error: UriFormatException: Invalid URI: The format of the URI could not be determined: xcode_project/.
I think↑this code generates other bugs :-P