quickstart-unity icon indicating copy to clipboard operation
quickstart-unity copied to clipboard

iOS Build fail when there are spaces on build folder name

Open mcrvaz opened this issue 4 years ago • 19 comments

Please fill in the following fields:

Unity editor version: 2019.2.18f1 Firebase Unity SDK version: 6.9.0 Firebase plugins in use (Auth, Database, etc.): Auth, Crashlytics, Functions, Storage, Analytics Additional SDKs you are using (Facebook, AdMob, etc.): Platform you are using the Unity editor on (Mac, Windows, or Linux): Mac Platform you are targeting (iOS, Android, and/or desktop): iOS Scripting Runtime (Mono, and/or IL2CPP): IL2CPP

Please describe the issue here:

(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)

Do an iOS release build on Unity with a filename that includes spaces. Ex: "My Game 1.0.0" When XCode finishes building and starts uploading symbols, the following error occurs: Unable to read GoogleService-Info.plist at path "...."

What's the issue repro rate? (eg 100%, 1/5 etc) 100%

mcrvaz avatar Jan 17 '20 21:01 mcrvaz

This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Jan 17 '20 21:01 google-oss-bot

Hi @mcrvaz thanks for reporting your issue. You can try enclosing your framework path in double quotes as described in this post

paulinon avatar Jan 20 '20 16:01 paulinon

Hi @paulinon , thanks for the help. I can also solve the problem easily by removing the spaces in the build folder name. But this was not an issue before, we were using version 6.5.0 and upgraded recently to 6.9.0. Somewhere along the way this issue began and seem related to Crashlytics trying to upload symbols.

mcrvaz avatar Jan 21 '20 03:01 mcrvaz

It turns out that there was a fix for version 6.7.0 for an issue where the plugin fails to create an XCode run script to upload symbols.

paulinon avatar Jan 21 '20 17:01 paulinon

Hey @mcrvaz. We need more information to resolve this issue but there hasn't been an update in 7 days. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Jan 29 '20 02:01 google-oss-bot

Hi @paulinon, the issue fixed on 6.7.0 is not the same I'm describing here, and we are using Unity 2019.2 with Firebase 6.9.0. It's quite simple to reproduce, just make a release build for iOS with whitespaces in the folder name and then finish the build on XCode and the error should be there. It's not exactly causing any problems for us right now, but was a real pain to discover what was going on since we've always used pretty much the same name for our builds.

mcrvaz avatar Jan 29 '20 03:01 mcrvaz

Thanks for the clarification, @mcrvaz. I was able to reproduce this error on my end. I've filed an internal bug for this. I can't provide any timelines for the fix, so I'll leave this open.

paulinon avatar Jan 29 '20 15:01 paulinon

Any news?

kobyle69 avatar Apr 20 '20 22:04 kobyle69

It's really quite annoying having to change the folder of my Xcode project before every Unity build and then change it back to have no spaces to complete the build in Xcode :'(

nicolasgramlich avatar May 09 '20 07:05 nicolasgramlich

I Solved. If you are building with Unity3D. Modify it like this: Open {Your XCode Project Dir}/Pods/Fabric/run file. In 49 line. ARGUMENTS="$API_KEY_ARG $BUILD_SECRET_ARG $@" -> ARGUMENTS="$API_KEY_ARG $BUILD_SECRET_ARG $1 '$2'"

coreagame avatar May 15 '20 01:05 coreagame

I Solved. If you are building with Unity3D. Modify it like this: Open {Your XCode Project Dir}/Pods/Fabric/run file. In 49 line. ARGUMENTS="$API_KEY_ARG $BUILD_SECRET_ARG $@" -> ARGUMENTS="$API_KEY_ARG $BUILD_SECRET_ARG $1 '$2'"

👏 👏 👏 👏 👏 👏 👏 👏 👏 👏 👏 👏 👏 👏 👏

nicolasgramlich avatar May 15 '20 08:05 nicolasgramlich

If anyone wants to put this in a script to fix it (because the file gets overwritten every time you build from Unity):

sed -i '' "s/ARGUMENTS\=\"\$API_KEY_ARG \$BUILD_SECRET_ARG \$@\"/ARGUMENTS\=\"\$API_KEY_ARG \$BUILD_SECRET_ARG \$1 '\$2'\"/g" ./Builds/PATH_TO_YOUR_XCODE_PROJECT_FOLDER/Pods/Fabric/run

YMMV on the build path!

nicolasgramlich avatar May 15 '20 10:05 nicolasgramlich

With version 6.15.0 the run script has changed format and location.

sed -i '' "s/ARGUMENTS\=\"\$API_KEY_ARG \$@\"/ARGUMENTS\=\"\$API_KEY_ARG \$1 '\$2'\"/g" "/PATH_TO_YOUR_XCODE_PROJECT_FOLDER/Pods/FirebaseCrashlytics/run"

Ospanaattori avatar Jun 10 '20 05:06 Ospanaattori

@nicolasgramlich where do you add this sed -i '' "s/ARGUMENTS\=\"\$API_KEY_ARG \$BUILD_SECRET_ARG \$@\"/ARGUMENTS\=\"\$API_KEY_ARG \$BUILD_SECRET_ARG \$1 '\$2'\"/g" ./Builds/PATH_TO_YOUR_XCODE_PROJECT_FOLDER/Pods/Fabric/run

I am using unity. Is there a place in build settings?

PositronEngineering avatar Jun 14 '20 16:06 PositronEngineering

I run it in the terminal after every iOS build from Unity. Luckily this only happens every so often and isn't annoying enough yet for me to find a place to hook it in automatically.

nicolasgramlich avatar Jun 14 '20 18:06 nicolasgramlich

I'm also encountering this Unable to read GoogleService-Info.plist at path "...." with Firebase 6.15.2 due to blank space in project path.

p0w1nd avatar Sep 21 '20 08:09 p0w1nd

I'm also encountering this Unable to read GoogleService-Info.plist at path "...." with Firebase 6.15.2 due to blank space in project path.

Use the solution above from coreagame: https://github.com/firebase/quickstart-unity/issues/557#issuecomment-628974733

Guidanel avatar Sep 26 '20 23:09 Guidanel

For my case, I had solved by removing blank space in the folder structure in my machine.

Before: /Users/xxxxx/Unity Projects/MyGame/build_output/XCode

After: /Users/xxxxx/UnityProjects/MyGame/build_output/XCode

(I have a CLI build tool which export Unity project to ./build_output/XCode and then run Fastlane to build and upload to TestFlight - so the problem was from the root folder "Unity Projects" which has a blank space).

But I thought it should be better if this get fixed into Firebase (someone above said that it didn't happen in some older version of Firebase).

p0w1nd avatar Sep 27 '20 03:09 p0w1nd

Here's a Fastlane lane of the above mentioned workaround for anyone who might need it.

Remember to modify the path to the XCode project.

lane :fix_firebase_spaces do
    sh("sed", "-i", "''", "s/ARGUMENTS\=\"\$API_KEY_ARG \$@\"/ARGUMENTS\=\"\$API_KEY_ARG \$1 '\$2'\"/g", "PATH_TO_XCODE_PROJECT_FOLDER/Pods/FirebaseCrashlytics/run")
end

reaver avatar Nov 11 '20 08:11 reaver