react-native-unity-view icon indicating copy to clipboard operation
react-native-unity-view copied to clipboard

iOS - The build cannot be appended.

Open rd3-elizeu opened this issue 5 years ago • 12 comments

Sorry if this is a dumb question, but i don't know what i'm doing wrong.

The React project i'm using is the default "AwesomeProject" from react's setting up tutorial. Installed via the ' npx react-native init AwesomeProject ' command. Then i created a Unity project using version 2020.1.13f1 and followed the first instructions.

As you can see on the attached image the project is named the same as the React, i copied both required scripts to Assets > Scripts > Editor and the Auto Graphics API is on.

Screen Shot 2020-11-19 at 1 05 38 PM

rd3-elizeu avatar Nov 19 '20 16:11 rd3-elizeu

Hello, Same problem I think it comes from the file path /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline.bindings.cs:253 Because I can't find the file and my user is not Bokken and I see that you have the same path.

It's just a guess, I'm not sure.

I have test on a Linux and MacOs config and i get the same error.

remifabbri avatar Nov 24 '20 17:11 remifabbri

Hello rd3, I find a solution ! The error appear with version last version 2019.3.15f1, you need to use this. And i think the problème is at line 48 Assets/Scripts/Editor/build.cs var options = BuildOptions.AcceptExternalModificationsToPlayer; This option must be different after version version 2019.3.15f1

Have a good day :)

remifabbri avatar Nov 30 '20 16:11 remifabbri

Thanks, i was able to export on 2019.3. But i'd really love a solution to export in unity 2020.1, if there is one available. I'll investigate if i get the time :)

Btw, were you able to run it on your device and make the UnityView open? I just opened another issue about it. I just can't make it work :(

rd3-elizeu avatar Nov 30 '20 16:11 rd3-elizeu

Not yet, I'm looking at it tomorrow.

remifabbri avatar Nov 30 '20 17:11 remifabbri

thanks for the answers. Please keep me posted if you get it to work, i'll let you know too, if i can :)

rd3-elizeu avatar Nov 30 '20 17:11 rd3-elizeu

Build.cs deletes the UnityExport directory each time for both platforms e.g.

 if (Directory.Exists(iosExportPath)) {
             Directory.Delete(iosExportPath, true);
         }

For iOS, BuildOptions.AcceptExternalModificationsToPlayer will append to an existing Xcode project. This fails in 2019.4+ as no project exists to be appended. What happens if you replace

var options = BuildOptions.AcceptExternalModificationsToPlayer;

with

var options = BuildOptions.None;

Finetuned avatar Dec 01 '20 17:12 Finetuned

Hello, @Finetuned i don't understand how do you mean ! 🤔

The build deleted the old folder of build for replace this and i think is a normal behaviour.

And i try change the options with your propose and get the same error like report by rd3-elizeu.

remifabbri avatar Dec 02 '20 13:12 remifabbri

@remifabbri. you cannot append to a non-existent project. See https://docs.unity3d.com/ScriptReference/BuildOptions.AcceptExternalModificationsToPlayer.html for the explanation of this enum.

To test, I built my project via build settings, commented out the delete block, and exported via the ReactNative menu. I don't see the error this way but it's just a test.

Finetuned avatar Dec 02 '20 13:12 Finetuned

@remifabbri running into the same issue. any luck?

nguyendarryl avatar Dec 09 '20 04:12 nguyendarryl

@nguyendarryl always the same prob! I work on my model with the version 2019.3.15f1.

when I will have acquired more skills on unity I will tackle this version build problem. I promise I'll keep you informed :)

remifabbri avatar Dec 10 '20 13:12 remifabbri

This has been already solved here: https://github.com/asmadsen/react-native-unity-view/issues/27#issuecomment-737425365

For iOS, replace this line in DoBuildIOS()

var options = BuildOptions.AcceptExternalModificationsToPlayer;

with

var options = BuildOptions.AllowDebugging;

For Android, replace this line in DoBuildAndroid()

var options = BuildOptions.AcceptExternalModificationsToPlayer;

with

var options = BuildOptions.AllowDebugging;
EditorUserBuildSettings.exportAsGoogleAndroidProject = true;

zoix avatar Jan 29 '21 05:01 zoix

Thank's a lot @agamadev for report the solution here.

remifabbri avatar Jan 29 '21 14:01 remifabbri