Skip to content

Commit 2ca8a90

Browse files
committed
fix bugs for Apple plugins. Framework and Library cannot be embeded. apple/unityplugins#20
and apple/unityplugins#6
1 parent dd0c791 commit 2ca8a90

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Packages/com.apple.unityplugin.core/Editor/AppleFrameworkUtility.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ public static string GetPluginLibraryPathForBuildTarget(string libraryName, Buil
3232
return string.Empty;
3333
}
3434

35-
string[] results = AssetDatabase.FindAssets(libraryName);
35+
string libraryNameWithoutExtension = Path.GetFileNameWithoutExtension(libraryName);
36+
string[] results = AssetDatabase.FindAssets(libraryNameWithoutExtension);
37+
3638
foreach (string currGUID in results)
3739
{
3840
string libraryPath = AssetDatabase.GUIDToAssetPath(currGUID);
@@ -136,7 +138,7 @@ public static void CopyAndEmbed(string source, BuildTarget buildTarget, string p
136138
{
137139
var expectedInstallPath = source.Substring(source.LastIndexOf(searchString) + searchString.Length);
138140
Debug.Log($"CopyAndEmbed - Expected install path for {frameworkName}: {expectedInstallPath}");
139-
fileGuid = pbxProject.FindFileGuidByProjectPath(Path.Combine("Frameworks", expectedInstallPath));
141+
fileGuid = pbxProject.FindFileGuidByProjectPath(Path.Combine(frameworkName.EndsWith(".a") ? "Libraries" : "Frameworks", expectedInstallPath));
140142
if (string.IsNullOrEmpty(fileGuid))
141143
{
142144
fileGuid = pbxProject.FindFileGuidByProjectPath(Path.Combine("Libraries", expectedInstallPath));

0 commit comments

Comments
 (0)