Hello!! I really love this asset and it helps a lot for my program since im still a beginner!! Thank you!!
I have a (stupid maybe) question. I noticed on your example code section on GitHub that you use several if-elseif to deal with different file types.
Is that the only way to do it, like adding a huge list of if-elseif to handle each one of them? or is there way to do one if statement that allow user to pick any type of files? Thanks!!
If your app can handle any file type, then you may want to use SimpleFileBrowser instead. Regardless, allowedFileTypes for any file type on Android should be */* and on iOS should be [public.item, public.content] (an array of 2 strings).
I wish Photos would be included in list of apps displayed by UIDocumentPickerController on iOS but unfortunately it isnât. I donât think it is possible to pick media from Photos with this plugin. You can have a look at NativeGallery.GetMixedMediaFromGallery, if you wish.
Does inserting pbxProject.AddBuildProperty( targetGUID, "OTHER_LDFLAGS", "-framework SystemConfiguration" ); to this line resolve the issue? If not, can you reproduce the issue on a new Unity project with Cloud Build?
That did get it a little bit further, now Iâm stuck at:
1492: ⸠Code Signing Error: Provisioning profile "Provision profile xxxxxxxx" doesn't include the com.apple.developer.icloud-container-identifiers and com.apple.developer.icloud-services entitlements and doesn't match the entitlements file's value for the com.apple.developer.ubiquity-container-identifiers entitlement.
1493: ⸠Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 14.2'
1494: ⸠Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 14.2'
1495: ! build of 'default-ios' failed. ! xcode build failed.
1496: publishing finished successfully.
1497: Finished: FAILURE
I have added an iCloud container, although from this point I have not much experience in iOS:
I also regenerated the appropriate files for the build server and reuploaded them, no idea if it was needed but did it anyway.
Well, does switching to âInclude CloudKit supportâ make any differentce? I wonder if you can reproduce this issue on a new project with default Player Settings and Cloud Build settings but only enabling NativeFilePickerâs automated setup?
In my case I have this same error when doing manual setup, app works fine with automatic but we have another plugin we need to use which is not working when we use automatic File picker postbuild settings
**Edit I just made a fresh project to test the manual IOS setup out and came out with the same error so I made an issue here on github https://github.com/yasirkula/UnityNativeFilePicker/issues/9 Thanks for your work on this fantastic plugin
@Luchunpen_0 I found the fix for the manual setup!
In the guide for manual steps it says:
âadd MobileCoreServices.framework to Link Binary With Libraries list in Build Phasesâ, this is not clear as the screenshots show the Unity-Iphone Target selected on the left, one would assume you link the MobileCoreServices.framework to there - but you actually need to link it to the target âUnityFrameworkâ in that targetâs Build Phases - Link Binary With Libraries list.
Using the example for PDF here on IOS, Iâm using the asset PDF Renderer from Unity asset store and passing it the path of the pdf from the example code you have but itâs not working, do I need to do something with the â
new string[ ] { pdfFileType } );â part of the call instead of using the string âpathâ?
You donât need anything else. You can insert your code at Debug.Log( "Picked file: " + path ); line of the example code. Are there any error messages in Xcode console? Can it also be possible that PDF Renderer doesnât support some PDF files?
I meant to delete my post when I realised I was being very silly and had a silent error before the pdf reader got the string I was passing it, but my internet here died. It worked exactly as you said!
My Android build is fine and native file picker works correctly however the IOS build fails with the following errors: ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/simonbooth/Desktop/Projects/AppleBlossumIOS/Libraries/libiPhone-lib.a(unwind_test_arm64.o) Undefined symbols for architecture arm64: â_kUTTagClassFilenameExtensionâ, referenced from: +[UNativeFilePicker convertExtensionToUTI:] in NativeFilePicker.o â_UTTypeCreatePreferredIdentifierForTagâ, referenced from: +[UNativeFilePicker convertExtensionToUTI:] in NativeFilePicker.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/simonbooth/Desktop/Projects/AppleBlossumIOS/Libraries/libiPhone-lib.a(unwind_test_arm64.o) Undefined symbols for architecture arm64: â_kUTTagClassFilenameExtensionâ, referenced from: +[UNativeFilePicker convertExtensionToUTI:] in NativeFilePicker.o â_UTTypeCreatePreferredIdentifierForTagâ, referenced from: +[UNativeFilePicker convertExtensionToUTI:] in NativeFilePicker.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Iâm using XCode 12.3 and Unity 2019.4 Any suggestions of how to fix this?
hello @yasirkula Iâm running into issues trying to open a PDF on android in itâs internal PDF viewing options(photos/gallery/etc) stored locally in my unity project in Streaming Assets folder. Would you happen to have a plugin or know of a solution to solve this problem? Iâve found solutions for downloading and then opening. But am hitting a wall with trying to open a file that was built into it initially.
I donât have a plugin for viewing PDF files but the problem you are encountering is probably related to storing the PDF files inside StreamingAssets. On Android, these files are stored inside the APK file, so they are not really files in the filesystem. They must be extracted from the APK first. You can do it via WWW (google should help), UnityWebRequest or 3rd party assets.