Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unity iOS PostProcess FilePath Error #20

Closed
kyubuns opened this issue May 30, 2014 · 21 comments
Closed

Unity iOS PostProcess FilePath Error #20

kyubuns opened this issue May 30, 2014 · 21 comments

Comments

@kyubuns
Copy link

kyubuns commented May 30, 2014

in Everyplay/XCodeEditor/XCProject.cs

System.Uri rootURI = new System.Uri( ( projectRootPath + "/." ) );

caused error:
UriFormatException: Invalid URI: The format of the URI could not be determined: xcode_project/.

I think

System.Uri rootURI = new System.Uri( ( projectRootPath + "/." ) );
↓
System.Uri rootURI = new System.Uri( ( filePath + "/." ));

↑this code generates other bugs :-P

@paugit
Copy link

paugit commented May 30, 2014

On what Unity version are you having this problem? Are you building on Mac or Windows ?

@kyubuns
Copy link
Author

kyubuns commented May 30, 2014

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 )

@paugit
Copy link

paugit commented May 30, 2014

What kind of project/build path are you having? Does it contain special characters?

@kyubuns
Copy link
Author

kyubuns commented May 30, 2014

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.

@paugit
Copy link

paugit commented May 30, 2014

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.

@paugit
Copy link

paugit commented May 30, 2014

Could you try to build a new blank project with Everyplay and see if the problem happens for that too?

@kyubuns
Copy link
Author

kyubuns commented May 30, 2014

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?

@kyubuns
Copy link
Author

kyubuns commented May 30, 2014

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 )

@paugit
Copy link

paugit commented May 30, 2014

Tried, with same project name in my home dir and building to fuga/test but unfortunately unable to replicate.

@kyubuns
Copy link
Author

kyubuns commented May 30, 2014

oh... okey...
wait please...

@kyubuns
Copy link
Author

kyubuns commented May 30, 2014

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.

@kyubuns
Copy link
Author

kyubuns commented May 30, 2014

i'll test blank project.

@kyubuns
Copy link
Author

kyubuns commented Jun 1, 2014

sorry, I cannot replicate in blank project.
I'll check other PostProcesses.
thank you.

@kyubuns kyubuns closed this as completed Jun 1, 2014
@kyubuns kyubuns reopened this Jun 5, 2014
@kyubuns
Copy link
Author

kyubuns commented Jun 5, 2014

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?

@paugit
Copy link

paugit commented Jun 9, 2014

What if you change the "xcode_project" to "/Users/hoge/fuga/xcode_project" ?

@kyubuns
Copy link
Author

kyubuns commented Jun 9, 2014

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

@paugit
Copy link

paugit commented Jun 9, 2014

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);

@kyubuns
Copy link
Author

kyubuns commented Jun 9, 2014

excellent!
be that as it may, this is bug? or not?
(Should I close this issue?)

@paugit
Copy link

paugit commented Jun 9, 2014

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.

@kyubuns
Copy link
Author

kyubuns commented Jun 9, 2014

ok!
thank you paugit!

@kyubuns kyubuns closed this as completed Jun 9, 2014
@paugit
Copy link

paugit commented Jun 9, 2014

You are welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants