keiwando / nativefileso

Unity - Native file dialogs and file type associations on Windows, macOS, iOS and Android
Mozilla Public License 2.0
85 stars 8 forks source link

Build error due to SupportedFileType in NativeFileSOBuild.cs -> PostProcessIOS #2

Closed aidanwolf closed 4 years ago

aidanwolf commented 4 years ago

Thank you for making such an awesome package, it works perfectly on device but I do have to manually set up DocumentType, Import/Export UTIs because of this build error. Here's the console output:

Screen Shot 2020-07-16 at 5 17 17 PM

keiwando commented 4 years ago

Does it say on which line the ArgumentNullException is thrown?

aidanwolf commented 4 years ago

Hi Keiwan! Figured it out, these lines in NativeFileSOBuild.cs are deprecated in the version of Unity I have (2019.3.15f1), switched it to the new line and it works.

var targetName = PBXProject.GetUnityTargetName();
var targetGUID = project.TargetGuidByName(targetName);

var targetGUID = project.GetUnityFrameworkTargetGuid();

I wrongly assumed it was due to SupportedFileTypes because of this line

if (SupportedFilePreferences.supportedFileTypes.Length == 0) {
return;
}

Thanks! All the best to you.

keiwando commented 4 years ago

Thanks for pointing this out and also finding the solution! I fixed it and uploaded a new release: https://github.com/keiwando/nativefileso/releases/tag/v1.0.2

Now it should work on Unity versions below and above 2019.3