Closed grammatn closed 6 years ago
For NuGet 1.1.0: It appears (to me) to be a NuGet package problem. When I installed the package to the iOS project it located the FilePicker.dll in the 'portable...' folder. This assembly uses a compiler directive in CrossFilePicker.cs to throw the message you are seeing (i.e. this portable assembly shouldn't be used for the native projects). I believe the assembly in the MonoTouch10 folder is the correct assembly to be referenced. I've already merged the source into my project (to figure this problem out) so am not in a position to verify the assembly in the MonoTouch10 folder will actually work. (Visual Studio 2015, BTW)
I confirm this. You must reference manually the DLLs from the MonoTouch10 folder and the plugin will work on iOS.
Hi Greeg767, i was tried to add reference manually in xamarin iOS but NSInternalinconsistencyexception occur. how to solve this?
Sorry I have no idea about that problem. I never had that one before.
Hi Greg767, Thanks for you response,its ok
For more information, on iOS I had to change the TakeMediaAsync() method to not re-read the file again. Don't know if it's worth to do a PR since the project seems to be badly managed at the moment?
Handler = (s, e) => {
var tcs = Interlocked.Exchange(ref _completionSource, null);
Func<Stream> streamGetter = null;
if(e.FileByte != null)
{
streamGetter = () => new MemoryStream(e.FileByte);
}
else
{
streamGetter = () => File.OpenRead(e.FilePath);
}
tcs?.SetResult(new FileData(e.FilePath, e.FileName, streamGetter));
This should now be working in this NuGet: https://www.nuget.org/packages/Xamarin.Plugin.FilePicker/1.4.0-beta
If not, please open a issue on the new repo where development will be continued: https://github.com/jfversluis/FilePicker-Plugin-for-Xamarin-and-Windows/issues
Hi,
It is not working in ios.
if any one got success in ios..Please post your solution
@lohitha123 please see #87
I tried to use CrossFilePicker PickFile function to choose file in my xamarin form but it doesn't work.
It said "This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation."