Bug 55077 - NSInvalidArgumentException *** -[NSURL initFileURLWithPath:]: nil string parameter
Summary: NSInvalidArgumentException *** -[NSURL initFileURLWithPath:]: nil string para...
Status: RESOLVED NORESPONSE
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-04-12 12:09 UTC by SiemensS23
Modified: 2017-07-25 14:20 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Debug Console (3.59 KB, text/plain)
2017-04-12 12:09 UTC, SiemensS23
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NORESPONSE

Description SiemensS23 2017-04-12 12:09:42 UTC
Created attachment 21458 [details]
Debug Console

Hello everyone, i'm trying to develop a project with Xamarin Forms, specially Ios shared code where, after i binded the Google Vr SDK library perfect with ApDefinition & StructAndEnums classes and the GVRSDK static library, i ve some problem to solve.
When i insert the GVRVideoView widget into my ViewController, two buttons about Fullscreen and Cardboard View Mode doesn't appear; i've insert their own enable methods into code to do that.
Also when i tap them the app crashes and the debug console give me these exception. I don't know what i should try to do.
Maybe anyone can help and discuss with me these problem?
Comment 1 Paul DiPietro [MSFT] 2017-04-12 14:21:18 UTC
There's no explicit mention of Forms in your debug output, and in any case we would need more information in order to look into this further. Please upload a reproduction project with the minimal amount of code needed to reproduce the issue. 

That said, due to the sort of exception, I'm guessing it isn't a Forms issue and lies somewhere in code because presumably an nil parameter is being provided, which isn't allowed. I won't re-categorize the issue just yet, but please see if the answer provided here relating to that error is of any assistance to you (the code is in Objective-C but the general idea should be there): http://stackoverflow.com/questions/22551038/nsinvalidargumentexception-reason-nsurl-initfileurlwithpath-nil-st
Comment 2 SiemensS23 2017-04-12 15:07:05 UTC
Ok the code that i use about my project with the class references about it is these. Consider that shared code doesn't create any storyboard reference to work with that and so i coded that in one only class like these.

using CoreGraphics;
using Foundation;
using Google.VR;
using System;
using UIKit;

namespace App18.iOS
{
    public partial class ViewController : UIViewController, IGVRVideoViewDelegate
    {

        GVRVideoView videoView = new GVRVideoView();
        //GVRPanoramaView videoView = new GVRPanoramaView();
        public bool IsPaused
        {
            get;
            set;
        }

        public ViewController(IntPtr handle) : base(handle)
        {
           
        }

        public ViewController()
        {
           
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.BackgroundColor = UIColor.White;

            CGRect rect = View.Bounds;
            CGRect Frame = new CGRect(20, 100, 280, 365);
            videoView.Frame = Frame;
            videoView.Delegate = this;
            videoView.LoadFromUrl(NSUrl.FromFilename("video.mp4"), GVRVideoType.StereoOverUnder);
            //videoView.DisplayMode = GVRWidgetDisplayMode.Fullscreen;
            var heightC = NSLayoutConstraint.Create(videoView, NSLayoutAttribute.Height, NSLayoutRelation.Equal,
                                                null, NSLayoutAttribute.NoAttribute, 1.0f, 50.0f);
            var widthC = NSLayoutConstraint.Create(videoView, NSLayoutAttribute.Width, NSLayoutRelation.Equal,
                                                null, NSLayoutAttribute.NoAttribute, 1.0f, 50.0f);
            var leftC = NSLayoutConstraint.Create(videoView, NSLayoutAttribute.Left, NSLayoutRelation.Equal,
                                                View, NSLayoutAttribute.Left, 1.0f, 100.0f);
            var rightC = NSLayoutConstraint.Create(videoView, NSLayoutAttribute.Right, NSLayoutRelation.Equal,
                                                View, NSLayoutAttribute.Right, 1.0f, 100.0f);
            var topC = NSLayoutConstraint.Create(videoView, NSLayoutAttribute.Top, NSLayoutRelation.Equal,
                                                View, NSLayoutAttribute.Top, 1.0f, 100.0f);
            
            //videoView.DisplayMode = GVRWidgetDisplayMode.Fullscreen;
           
            View.Add(videoView);
            View.AddConstraint(leftC);
            View.AddConstraint(topC);
            View.AddConstraint(rightC);
            videoView.AddConstraint(heightC);
            videoView.AddConstraint(widthC);
        }
        
        public void DidUpdatePosition(GVRVideoView videoView, double position)
        {
            if (position == videoView.Duration)
            {
                videoView.SeekTo(0);
                videoView.Play();
            }
        }

        public void WidgetViewDidTap(GVRWidgetView widgetView)
        {
            //throw new NotImplementedException();
            //videoView.DisplayMode = GVRWidgetDisplayMode.Fullscreen;
            
        }

        public void WidgetView(GVRWidgetView widgetView, GVRWidgetDisplayMode displayMode)
        {
            //throw new NotImplementedException();
        }

        public void WidgetView(GVRWidgetView widgetView, NSObject content)
        {
            //videoView = widgetView as GVRVideoView;
            
            
            videoView.EnableInfoButton = true;
            //videoView.EnableFullscreenButton = false;
            //videoView.EnableCardboardButton = false;
            videoView.EnableTouchTracking = true;
            videoView.Subviews[0].SetNeedsLayout();

            videoView.Play();
        }

}
Comment 3 SiemensS23 2017-04-12 15:21:43 UTC
Oh i've comment also the two methods about the fullscreeen and cardboard button, i know. But when they enabled first of all they don't show up to the screen. Second, when i tap one of them, application will crash
Comment 4 Paul DiPietro [MSFT] 2017-06-19 18:26:56 UTC
Reassigning to X.iOS for upkeep as they might know more about this because I'm assuming it isn't a Forms issue.

(X.iOS team: Sorry in advance if this is in the wrong place and doesn't fall on you. Could be a fault with the GVR library?)
Comment 5 Rolf Bjarne Kvinge [MSFT] 2017-06-20 11:01:42 UTC
Please provide a complete solution we can use to reproduce this, since it may very well be an issue with either your bindings or the native library.
Comment 6 John Miller [MSFT] 2017-07-25 14:20:01 UTC
Because we have not received a reply to our request for more information, we are marking this issue as RESOLVED→NORESPONSE. If you are still encountering this issue on the latest Xamarin.iOS 10.12.0.14, please don’t hesitate to reopen the ticket with the requested information. Thanks!