Open ChurikiTenna opened 1 year ago
Seeing the same issue... and there is absolutely nothing I can figure out to get this fixed.
Which Xcode and Unity versions did you use? (2022.2.0 looks like the plugin version)
Try rechecking the flavors setting for "Unity-iPhone", it looks like they are reset to default on every export. In my case, the issue was caused by this.
Having this issue:
Unity 2022.3.31f Latest Plugin version
My xcode:
Same deal when using physical iPhone
I encountered this issue due to different build flavors. To address it, I wrote a small Node.js script that automatically patches the Unity-iPhone pbxproj file. Simply update the flavor names in the script and run it after exporting your Xcode project.
// patch-unity-pbxproj.js
const xcode = require("xcode");
const fs = require("fs");
const projectPath = process.env.UNITY_PROJECT_PATH ?? "app/ios/UnityLibrary/Unity-iPhone.xcodeproj/project.pbxproj";
const project = xcode.project(projectPath);
project.parse((err) => {
if (err) {
console.error(err);
return;
}
const buildConfigurationSection = project.pbxXCBuildConfigurationSection();
const configurationList = project.pbxXCConfigurationList();
const configurations = Object.keys(configurationList).map((key) => {
if (key.endsWith("_comment")) return undefined;
return configurationList[key];
}).filter(config => config !== undefined);
const modes = ["Debug", "Release"];
const flavors = ["development", "next", "production"];
for (const configuration of configurations) {
const buildConfigurations = configuration.buildConfigurations;
for (const mode of modes) {
for (const flavor of flavors) {
const baseConfigurationId = buildConfigurations.find(entry => entry.comment === mode).value;
const name = `${mode}-${flavor}`;
if (buildConfigurations.find(entry => entry.comment === name) === undefined) {
console.log("Copy configuration", baseConfigurationId, name);
const buildConfiguration = buildConfigurationSection[baseConfigurationId];
const clonedBuildConfigurationId = project.generateUuid();
const clonedBuildConfiguration = { ...buildConfiguration, name };
buildConfigurationSection[`${clonedBuildConfigurationId}_comment`] = clonedBuildConfiguration.name;
buildConfigurationSection[clonedBuildConfigurationId] = clonedBuildConfiguration;
buildConfigurations.push({ value: clonedBuildConfigurationId, comment: name });
}
}
}
}
fs.writeFileSync(projectPath, project.writeSync());
});
Describe the bug Swift Compiler Error (Xcode): No such module 'UnityFramework' on flutter run. Also tried running from Xcode which didn't work.
To Reproduce Follow steps on here: https://pub.dev/packages/flutter_unity_widget#steps
Expected behavior Start the app.
Unity (please complete the following information):
Smartphone (please complete the following information):
Additional context I see UnityLibrary and UnityLibrary_BurstDebugInformation_DoNotShip created in flutter_project/ios/
What I tried:
Run UnityFramework scheme from Xcode
Build input file cannot be found: 'path to project/ios/UnityLibrary/UnityFramework/Info.plist'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it?