Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions Facebook.Unity.Editor/android/ManifestMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -346,21 +346,24 @@ private static void AddAppLinkingActivity(XmlDocument doc, XmlNode xmlNode, stri

private static void CreateDefaultAndroidManifest(string outputFile)
{
var inputFile = Path.Combine(
EditorApplication.applicationContentsPath,
"PlaybackEngines/androidplayer/AndroidManifest.xml");
if (!File.Exists(inputFile))
string[] possiblePaths =
{
// Unity moved this file. Try to get it at its new location
inputFile = Path.Combine(
EditorApplication.applicationContentsPath,
"PlaybackEngines/AndroidPlayer/Apk/AndroidManifest.xml");
}
// 2019.3+
"PlaybackEngines/AndroidPlayer/Apk/UnityManifest.xml"
// 2018.3 - 2019.2
"PlaybackEngines/AndroidPlayer/Apk/AndroidManifest.xml",
// 2017.2 - 2018.2
"PlaybackEngines/androidplayer/AndroidManifest.xml",
};

if (File.Exists(inputFile))
foreach (var relativePath in possiblePaths)
{
File.Copy(inputFile, outputFile);
return;
var fullPath = Path.Combine(EditorApplication.applicationContentsPath, relativePath);
if (File.Exists(fullPath))
{
File.Copy(fullPath, outputFile);
return;
}
}

// On Unity 5.3+ we don't have default manifest so use our own
Expand Down