iOS - The build cannot be appended.
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.
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.
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 :)
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 :(
Not yet, I'm looking at it tomorrow.
thanks for the answers. Please keep me posted if you get it to work, i'll let you know too, if i can :)
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;
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. 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.
@remifabbri running into the same issue. any luck?
@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 :)
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;
Thank's a lot @agamadev for report the solution here.