Cannot Create a new workbook or open existing one.

JeffChen.2953JeffChen.2953 AUMember
edited May 2016 in Workbooks & Inspector

Windows 8 Pro
Xamarin Android installed
Xamarin for Visual Studio installed
Xamarin Studio intalled.

All above components are latest stable release.

I can develop my app and debug it within Visual Studio 2015, then I suppose the setup should be fine.

However, after I install Xamarin Workbook, when I create a new workbook, I got following error showing in log file

[Info][00:00:00] AppSession: Starting Xamarin Inspector client<br /> [Error][00:00:10.6094299] AgentSessionWindow: unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object.<br /> at Xamarin.Inspector.Client.Android.AgentProcessFactories.AndroidAgentProcessFactory.&lt;>c__DisplayClass4_0.<CreateAgentProcessTask>b__2(AndroidDevice d)<br /> at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable<code>1 source, Func2 predicate)
at Xamarin.Inspector.Client.Android.AgentProcessFactories.AndroidAgentProcessFactory.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Xamarin.Interactive.Core.AgentCache.d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Xamarin.Interactive.Caching.ReferenceCountedCache3.<GetItemAsync>d__9.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Xamarin.Interactive.Caching.ReferenceCountedCache3.d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Xamarin.Interactive.Core.AgentCache.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Xamarin.Inspector.Windows.Client.AgentSessionWindow.d__50.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Xamarin.Inspector.Windows.Client.AgentSessionWindow.d__48.MoveNext()

When I try to open a existing one ( the one I download from https://github.com/xamarin/Workbooks/blob/master/android/Views/PropertyAnimation.workbook

I got following error in log file:

[Info][00:00:00.0009791] AppSession: Starting Xamarin Inspector client<br /> [Error][00:00:00.0832589] OpenWorkbook: unhandled exception: Xamarin.Interactive.Workbook.WorkbookDocumentModel+InvalidDocumentManifestException: The workbook does not contain a valid manifest.<br /> at Xamarin.Interactive.Workbook.WorkbookDocumentModel.Read(FilePath path, TextReader reader)<br /> at Xamarin.Interactive.Workbook.WorkbookDocumentModel.Open(FilePath path)<br /> at Xamarin.Inspector.Windows.Client.App.OpenWorkbook(String path)

I can use workbook in Mac with Xamarin.iOS.

I have tried to use Xamarin Workbook with Android on two of my workstations, all of them get the same error.

Is this a bug ?

Posts

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    For the first bug, possibly there's an issue with your Android emulator. Do you have the VS Android Emulator installed? Do you have an emulator with Android 4.4 or greater set up in it?

    For the second bug, how recently did you download the workbook file? I fixed an issue with that workbook's manifest almost a month ago.

  • JeffChen.2953JeffChen.2953 AUMember

    @SandyArmstrong said:
    For the first bug, possibly there's an issue with your Android emulator. Do you have the VS Android Emulator installed? Do you have an emulator with Android 4.4 or greater set up in it?

    For the second bug, how recently did you download the workbook file? I fixed an issue with that workbook's manifest almost a month ago.

    Hi Sandy, thank you for you response.

    The first one:
    1. I do not have VS Android Emulator installed. I have one Android SDK Emulator being created in AVD Manager.
    2. Within Xamarin Android Player, I have one Nexus 7 (Lollipop) API 22 instance with Google Play Service installed.

    The second one:
    1. I downloaded workbook file yesterday from that link.

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    The Xamarin Android Player device should be supported (Google emulator is not, though). But if you can, I recommend installing and setting up a VS Android Emulator. It performs much better if you're already using Hyper-V.

    I'll see if I can track down the bug. It could be that installing VS Android Emulator will work around it.

    I am not able to reproduce your issue with the Android workbook file, though. It loads fine for me. When I get a chance I'll test on Windows 8 and see if it behaves any differently (I'm on Windows 10 right now).

  • AndyHopperAndyHopper USMember ✭✭
    edited May 2016

    I just installed 0.81 on Windows 10/VS2015, and while the Xamarin Workbooks Agent launches on the Visual Studio Emulator, the workbooks UI continues to show an "hourglass" indicator (spinning circle). I don't have a menu option under File to create a new workbook, and opening a .workbook file just opens a new instance of the workbooks UI.

    EDIT: Doy; the first UI I see where I select Android, iOS or WPF clearly states "New Workbook." However, the unresponsive UI issue remains.

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    @AndyHopper Can you gist your Workbooks client logs?

    Also, can you check if your VS Android Emulator has internet access? If not, you may need to do the following to fix your Hyper-V networking (I frequently have to do this when changing what wifi network I'm connect to):

    1. Close emulators
    2. Open Hyper-V Manager
    3. Under Actions, open Virtual Switch Manager...
    4. Delete all virtual switches
    5. Click OK
    6. Launch VS Android Emulator. You will probably be prompted to recreate virtual network switch.
    7. Test that VS Android Emulator's browser can access internet
  • AndyHopperAndyHopper USMember ✭✭

    Hmm. No "Inspector XXX" logs were in the %LOCALAPPDATA%\Xamarin\Logs\14.0 folder.

    Verified that the emulator's got Internet access, though.

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    The client logs are in %LOCALAPPDATA%\Xamarin\Inspector\logs\.

  • AndyHopperAndyHopper USMember ✭✭
    edited May 2016

    Aha!

    [Error][00:03:58.1362876] AgentSessionWindow: Error getting visual tree: System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> Mono.AndroidTools.InstallFailedException: Failure [INSTALL_FAILED_INVALID_URI] at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass90_0.<InstallPackage>b__0(Task``1 t) at System.Threading.Tasks.ContinuationTaskFromResultTask``1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of inner exception stack trace --- at System.AggregateException.Handle(Func``2 predicate) at AndroidDeviceExtensions.<>c__DisplayClass11_0.<PushAndInstallPackage>b__0() at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Xamarin.Inspector.Client.Android.AgentProcessFactories.AndroidAgentProcess.<StartAgentProcessAsync>d__15.MoveNext() --- End of inner exception stack trace --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Xamarin.Interactive.Core.AgentCache.<StartAgentAsync>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Xamarin.Interactive.Core.AgentCache.<GetAgentAsync>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Xamarin.Interactive.Core.AgentCache.AgentTicket.<GetClientAsync>d__31.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Xamarin.Inspector.Windows.Client.AgentSessionWindow.<RefreshTreeViewAsync>d__59.MoveNext() ---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> Mono.AndroidTools.InstallFailedException: Failure [INSTALL_FAILED_INVALID_URI] at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass90_0.<InstallPackage>b__0(Task``1 t) at System.Threading.Tasks.ContinuationTaskFromResultTask``1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of inner exception stack trace --- at System.AggregateException.Handle(Func``2 predicate) at AndroidDeviceExtensions.<>c__DisplayClass11_0.<PushAndInstallPackage>b__0() at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Xamarin.Inspector.Client.Android.AgentProcessFactories.AndroidAgentProcess.<StartAgentProcessAsync>d__15.MoveNext() ---> (Inner Exception #0) Mono.AndroidTools.InstallFailedException: Failure [INSTALL_FAILED_INVALID_URI] at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass90_0.<InstallPackage>b__0(Task``1 t) at System.Threading.Tasks.ContinuationTaskFromResultTask``1.InnerInvoke() at System.Threading.Tasks.Task.Execute()<--- <---

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    @AndyHopper Hmm, I wouldn't expect that error to come up with released build. Can you try manually uninstalling the agent app from the emulator, and then trying again?

  • AndyHopperAndyHopper USMember ✭✭
    edited May 2016

    You betcha! After uninstalling the app (and clearing out the log on my desktop just to be on the safe side), here's all I get:

    [Info][00:00:00] AppSession: Starting Xamarin Inspector client

    (Still have the spinner)

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    @AndyHopper So does the workbook finish connecting now?

  • AndyHopperAndyHopper USMember ✭✭

    Sorry, your comment beat my edit. Nope, still have the spinner.

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    @AndyHopper well I'm a bit sorry for making you jump through troubleshooting hoops because I just tested and I'm having the same issue with 0.8.1.

    I'll make sure it's fixed in the next release. Thanks for finding this!

  • AndyHopperAndyHopper USMember ✭✭

    No problem; just wanted to make sure I hadn't done anything lamebrained...

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    The issue is pretty straightforward. We renamed the exe in 0.8.1, so you need to check your firewall exceptions.

    Go to Control Panel > System and Security > Windows Firewall > Allowed apps, click "Change settings", then scroll down and find "Xamarin Workbooks".

    Make sure there is a single rule for it, which is enabled (check box on the left side), and that you allow access to both public and private networks.

    This is necessary because the Android Emulator uses the "Windows Phone Emulator Internal Switch", which defaults to being a public network. And we need the emulator to be able to send messages to a service running in the workbooks client. The workbook spins forever because it is waiting for the agent app running in the emulator to send it an identification message.

    Probably what happened is that you were prompted for a firewall exception, and only allowed access for private networks, which sounds very sensible, but unfortunately is insufficient.

    I'm going to look into how this user experience can be improved:

    1. Double-check if there's anything we can do to remove the need for a firewall exception.
    2. If an exception is required, have our client check what its access is so it can prompt the user again instead of just spinning forever.
  • JeffChen.2953JeffChen.2953 AUMember

    @SandyArmstrong said:
    The issue is pretty straightforward. We renamed the exe in 0.8.1, so you need to check your firewall exceptions.

    Go to Control Panel > System and Security > Windows Firewall > Allowed apps, click "Change settings", then scroll down and find "Xamarin Workbooks".

    Make sure there is a single rule for it, which is enabled (check box on the left side), and that you allow access to both public and private networks.

    This is necessary because the Android Emulator uses the "Windows Phone Emulator Internal Switch", which defaults to being a public network. And we need the emulator to be able to send messages to a service running in the workbooks client. The workbook spins forever because it is waiting for the agent app running in the emulator to send it an identification message.

    Probably what happened is that you were prompted for a firewall exception, and only allowed access for private networks, which sounds very sensible, but unfortunately is insufficient.

    I'm going to look into how this user experience can be improved:

    1. Double-check if there's anything we can do to remove the need for a firewall exception.
    2. If an exception is required, have our client check what its access is so it can prompt the user again instead of just spinning forever.

    Hi Sandy,

    Now, I can see that spinning in my workbook.

    I also can see 'Xamarin Workbooks Agent' in Visual Studio Emulator for Android (Marshmallow 6.00 API 23)

    I check the 'allowed application' in Windows Firewall seeting, only one rules for Xamarin Workbooks, both Prive and Public checkboxs are checked.

    Just, the workbook are still spinning....

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    @JeffChen.2953 hi again. Did you verify that the Android emulator you are using can access the internet? If it cannot, follow the steps earlier in this thread for fixing Hyper-V networking.

  • JeffChen.2953JeffChen.2953 AUMember
    edited May 2016

    @SandyArmstrong said:
    @JeffChen.2953 hi again. Did you verify that the Android emulator you are using can access the internet? If it cannot, follow the steps earlier in this thread for fixing Hyper-V networking.

    Hi Sandy, It can connect to internet, I even install GApps successfully, and connect to Google Play Service. But the process of setup this thing is really awful. However, setup only was only successfully on API 19 instance, when I try to setup API 23 or API 22 instance in Visual Studio Emulator for Android, they all failed.

    To be honestly, I think none of these emulators are easy to setup and use, none of them are functional well, or stable.

    Only Google's Emulator has no problem on setup and install google play service. But workbooks does not support Google Emulator.

    Xamarin Android Player's API23 image are in preview, has problem to install Google Play Service, and downloading the image is very slow.

    Visual Studio Emulator sometimes works, sometimes does not. I have spend whole of this morning try to install API 22 instance in Visual Studio Emulator, the VM just does not start, stacking at 'OS is starting' and then throw error. But the API 19 instance (the one installed along with emulator) works well, can start, can install google play service, but Workbooks still has problem with it.

    However, I try do the same setup on workstation in my office, Visual Studio Emulator API22 instance works very well. This thing just does not work consistently.

    And now, you know what, I am trying to install API22 in Visual Studio Emulator for Android again, emulator is booted, but just repeat 'Android is starting... optimizing app xx of 67' screen all the time, so unbelievable...

    I tried genymotion as well, installing Google Play Service has problem.

    None of emulator work perfectly. These emulators just drive me crazy :(

    I think if Xamarin Workbooks can connect to Google SDK Emulator, then it solved all the problems.

  • JeffChen.2953JeffChen.2953 AUMember
    edited May 2016

    Now, I just make Visual Studio Emulator Lollipop API 22 instance work on my laptop.

    I need to go to Hyper-V Manager -> Right click on the VM -> Settings -> Expand Processors -> Compatibility -> Check 'Migrate to a physical computer with a different processor version'

    I guess this may relevant to my laptop: Surface 4 Pro, maybe the CPU is not compatible ? have no idea...

    I installed the Gapps successfully.

    Trying to Add google account, but just always receive a error 'sorry there seems to be a problem please try again'.

  • JeffChen.2953JeffChen.2953 AUMember

    @SandyArmstrong , will it be possible to make Xamarin Workbook connect to Google SDK Emulator ?

  • JeffChen.2953JeffChen.2953 AUMember

    @SandyArmstrong all right now, it turns out that VMware player does not compatible with Hyper-V. I think I know this before, just forget this thing this time, if I remember this prerequest this time, I would not even give VS Emulator a try, such waste time.

    I need to VMware hosted Mac os x on Windows 10 for Xamarin.iOS dev.

    So, VMware does not play out with Hyper-V -> no hyper-v -> no VS Emulator -> no workbooks.

    I am going back to Goolge SDK Emulator and VMware Player solution now. Maybe try workbooks with XAP later.

  • AndyHopperAndyHopper USMember ✭✭

    Hi, @SandyArmstrong ! It's working for me now. Thanks for the research and solution!

Sign In or Register to comment.