Skip to content

Commit d5c7e5e

Browse files
committed
Do not copy labels for generated local repo
The copied label such as "gvhp_exportpath" may interfere the uninstallation feature and package migration feature since those feature will try to remove the generated file instead of the ones they are copied from. Change-Id: I28f1d5225740fe2e5ff61ae3ceef14f787a5f8cf
1 parent 07dc51f commit d5c7e5e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

source/AndroidResolver/src/PlayServicesResolver.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2278,9 +2278,12 @@ internal static string CopyAssetAndLabel(string sourceLocation, string targetLoc
22782278
sourceLocation, targetLocation),
22792279
level: LogLevel.Verbose);
22802280

2281-
if (!AssetDatabase.CopyAsset(sourceLocation, targetLocation)) {
2282-
return String.Format("Failed to copy {0} to {1}.",
2283-
sourceLocation, targetLocation);
2281+
// Use File.Copy() instead of AssetDatabase.CopyAsset() to prevent copying meta data.
2282+
try {
2283+
File.Copy(sourceLocation, targetLocation);
2284+
} catch (Exception e) {
2285+
return String.Format("Failed to copy {0} to {1} due to {2}",
2286+
sourceLocation, targetLocation, e.ToString());
22842287
}
22852288

22862289
var unlabeledAssets = new HashSet<string>();

0 commit comments

Comments
 (0)