Static library not working after update of Monotouch/Xamarin - xamarin.ios

About two years ago I built an image viewer into my Monotouch application. See this question of mine from way back when I was looking for an image viewer for monotouch. I used the source of MTGallery and used btouch to bring this into my Monotouch application. This worked perfectly and has been working perfectly for the last two years. But at some point in the last six months one of the updates that I did to Monodevelop has broken this functionality. Now the viewer is not showing the image, it is just showing a blank screen. The source for this hasn't changed, in fact it I still have the compiled library that was compiled two years ago.
I know that at the end of last year, I could compile my Monotouch application and the image viewer would work correctly. I have a backup of the application source from December 2012. If I deploy the version that was compiled then to my iPad it works correctly. But if I recompile the same source now without making any changes to the source or the settings in Monodevelop, it doesn't work.
So, this is what I have tried: Updated Monodevelop (I had to upgrade my Mac OS to Mountain Lion to be able to do this). Installed Xamarin Studio and got a new license for this development environment. The image viewer does not work when compiled in either Monodevelop or Xamarin Studio. I have tried recompiling the Objective-C library. I tried using btouch again to recreate the C# files for inclusion in my project.
Nothing I have tried so far has helped. Does anyone have any idea what could be causing this issue and what I could try changing to get this working.
UPDATE:
I am now a step further; I have determined that the static library is in fact being called and if I rotate my iPad the image is then showing in the viewer, but is not showing before a rotation takes place. From looking at the Objective-C code it appears that the image was initially being loaded by the scrollViewDidEndDecelerating delegate method of the UIScrollView. It seems that this is now not firing when the image viewer loads, whereas previously it was firing.

If it did work and suddenly doesn't without any change from you, it's probably a bug in Xamarin.iOS/Studio. The best way to get this fixed is to create a bug (http://bugzilla.xamarin.com) and attach your project so we can have a look at it.

Related

Hololens won't start the app if I put a c#script in its content (il2cpp)

I'm a new hololensdeveloper and I recently made a Hololensproject using net scripting backend just because there were way more information on how to set it up and get it working with Visual Studio.
Now when I feel somewhat confident I decided to change it up to il2cpp, but I have a major issue.
Everytime I put a c#script(even empty ones) into any folder within the application the Hololens won't even start it. The screen goes black for some seconds and then returns me to the mainpage.
This feels strange as all the scripts from the HolotoolKit works fine and they are written with c#.
Im currently using
.Unity 2018.3.4f1
.HolotoolKit 2017
.Visual Studio 2017
Thank you!
-----Solved------
SO after alot of time, I switched to Unity LTS and that fixed my problem. Feels bad that I have to rely on an older version.
If I remember correctly, using the HoloToolKit and not the mrtk v1 or v2, you should use Unity LTS 2017. Maybe thats the problem?
And I'm not sure if I understood you the right way. So you are building it in unity and than deploying it to the HoloLens without getting any errors in your console?
Also changing the scripting backend framework, means using a different build directory and If you are not doing that Unity should give you a message like "Build path contains project built with IL2CPP or .Net"

Project is targeting frameworks not installed or are included as part of future updates to Visual Studio

I am attempting to convert the Microsoft.Health C# class library that is installed as part of the HealthVault SDK, using instructions provided here. After following these instructions, I get the following error when attempting to load the project into Visual Studio 2013.
"The project is targeting frameworks hat are either not installed or
are included as part of future updates to Visual Studio. See
http://go.microsoft.com/fwlink/?LinkId=287985"
Visiting the link takes me to .NET SDKs and Downloads. Once there, I have no clue on what needs to be done.
I do realize that one will have to leverage the Portable Class Library Contrib project to fill in some missing bits, especially code related to System.Security. This, I will deal with later.
Any one run into a similar problem?
Maybe so late but for those who have the same problem.
I had the same error in a project which was working perfect before updating VS2013 and finally after 3 hours looking for the source of the error I found that the error is about TargetFrameworkProfile.
In my case I sloved it like so:
Right click in the unloaded project in your solution and click Edit.
Find the TargetFrameworkProfile tag and set it as below:
<TargetFrameworkProfile>Profile78</TargetFrameworkProfile>
At a guess, this is because you need to specify the TargetFrameworkVersion and TargetFrameworkProfile properties in the project file. Compare the .csproj you are trying to create to a newly created PCL project file, and make sure that everything that's not specific to your project matches.
I ran into the same issue and got it resolved by installing the latest Visual Studio Update

How to add Storage reference?

This should be pretty straightforward, but can't work this out for myself I'm afraid!
The following line of code triggers the error:
using Microsoft.Xna.Framework.Storage;
Error: The type or namespace name 'Storage' does not exist in the
namespace 'Microsoft.Xna.Framework' (are you missing an assembly
reference?)
But as far as I can tell, I have added the reference: (Solution explorer -> right click References -> Add reference -> .NET tab -> scroll down to Microsoft.Xna.Framework.Storage -> select it -> click OK).
Microsoft.Xna.Framework.Storage shows up when I expand "references" in the solution explorer.
What am I missing?
EDIT
Okay on second look this might be to do with how I'm adding the references. When I search in the object browser Microsoft.Xna.Framework.Storage doesn't show up (but when I search, for example, for audio, Microsoft.Xna.Framework.Audio does show up). Is there anyway to check that when I click "OK" on the add reference pop-up that it is actually working?
I see two likely possibilities.
You have a mismatch of XNA 4.0 and XNA 3.1 (or previous) references in your project. If the Storage reference you added is from 3.1, you'll get this message. You can try removing it, and then looking specifically for the 4.0 version during add.
The device you are building for may not support the Storage mechanism. In particular, Windows Phone apparently uses a different storage mechanism (System.IO.IsolatedStorage http://msdn.microsoft.com/en-us/library/ff604992.aspx).
Hope one of these helps.
This question was asked a long time ago, but if anyone else is still looking for an answer, here is how i fixed it.
If you installed the Microsoft.Xna.Framework references by using the installer from Microsoft, then it installs in C:\Windows\Microsoft.NET\assembly. I found all of the Xna libraries in GAC_32 and Microsoft.Xna.Framework.Storage in GAC_MSIL.
You can also use the GAC to find libraries that aren't in Visual Studio's reference list. For .NET Framework versions before 4.0, the libraries are in C:\Windows\assembly, and the libraries for versions after 4.0 are in C:\Windows\Microsoft.NET\assembly.
It's actually been removed from Monogame by Microsoft.
Running: Windows 10, with integrated graphics card (Intel G45/G43), Visual Studio 19, Monogame 3.7.1
Project Structure: Solution > Game.Shared, Game.Android, Game.OpenGL (followed this guide on creating a Cross-Platform project, method number 3).
I changed the Target Framework in my OpenGL project from .NET 4.5 to .NET 4.7.x (the newest version), and I was able to build and deploy the app to an Android device. Do this by clicking the project and selecting Properties.
I simply commented out the line. App will successfully deploy to an Android device this way. The game will then deploy, but I can't get any content to load.
Have yet to see if I can deploy to an iOS device, I will update this post when I figure out if I can.
No nuGet's installed.

How to get MvvmCross vNext to compile on Mac using MonoDevelop

I am trying to compile the vNext branch of MvvmCross on a Mac to try & start doing some iOS development using PCL's & MvvMCross.
I have spent a couple of days on this now but appear to be going in circles... being somewhat new to both C# & the Mac.
I have installed MonoDevelop 3.1.1 as recently referred to on #slodge's blog.
I have updated the targets file as per this reference https://files.xamarin.com/~jeff/Microsoft.Portable.CSharp.targets
I have downloaded the vNext branch from GitHub.
I have loaded the mvvmcross_all.sln in MonoDevelop however building it using the Debug|iPhone Simulator profile gives me 3 errors.
I have not been able to work out how to fix the references errors as for example appear in CrossUI.Core, ie references to
System
System.Core
System.Net
etc
Each of these lines has an error of Assembly not available for .NetPortable 4.0 Profile1 Profile (in Mono 2.10.9)
I realise its all a moving target but its obviously possible to get it to compile.
Any suggestions as to what I may have missed would be appreciated.
TIA,
Andreas
Thanks Andreas
In the version referenced in the blog at http://slodge.blogspot.co.uk/2013/02/a-patched-monodevelop-for-pcls.html, it appears that MonoDevelop reports that CrossUI is missing its references - but it still compiles. See this screenshot from my Mac - solution explorer reports problems but 'rebuild all' on CrossUI succeeds.
If you get problems with building, please do report the build output and I'll try to help.
Note that the patched version of MonoDevelop also still has other problems - e.g. syntax highlighting and intellisense issues- MonoTouch: creating multiplatform apps using Portable Class Libraries
Alternatively, there are some iOS/Mac friendly binaries on SkyDrive - http://slodge.blogspot.co.uk/p/mvvmcross-binaries_7.html
The schedule for 'proper' support of Portable Class Libraries is aiming for a demonstrable version before Evolve (so less than 2 months away). Until then I'll personally continue to do most of my PCL work in VS, with the platform specific steps in MonoDevelop.

Can I make MonoDevelop look good on a Retina display?

I bought a new Retina MacBook Pro to develop for iOS with MonoTouch.
It is extremely frustrating that, probably because it is built on Gtk#, MonoDevelop is very blurry.
I can cope with blurry UI but I can't read or write code because it hurts my eyes.
What is the current status of Retina support in Gtk# and MonoDevelop?
Is there any (experimental) compile flag at least to enable proper code rendering?
If I want to contribute, which component is in charge of this? Is it Gtk# or Gtk itself?
Update
This has been fixed as of MonoDevelop 3.0.4:
Other improvements and bug fixes
Fixed rendering on MacBook with retina display
So just go and download it.
Workaround for Older Versions (and other apps, too)
There is a temporary work around I used for WebStorm that worked well. It should work for MonoDevelop too.
You can use that in the mean time until the Xamarin folks get an update to MonoDevelop out.
Here it goes:
Locate MonoDevelop in Applications and click Show Package Contents
Open Contents/Info.plist in any editor and add this after opening <dict>:
<key>NSHighResolutionCapable</key>
<true/>
Copy and paste MonoDevelop app bundle, delete the old one and rename the new one back to MonoDevelop. This will flush system caches.
You will notice that MonoDevelop.app info now has Low Resolution option unchecked and the code renders smoothly.

Resources