ReedCopsey / Gjallarhorn.Bindable

Unidirectional binding library built on top of Gjallarhorn for WPF and Xamarin Forms
MIT License
27 stars 10 forks source link

iOS Sample (not yet working) #15

Open bigjonroberts opened 6 years ago

bigjonroberts commented 6 years ago

@ReedCopsey I'm trying to get Gjallarhorn.Bindable working for iOS.

Ran into the following message trying to pull Gjallarhorn.Bindable.XamarinForms into a new iOS project.

Severity Code Description Project File Line Suppression State Warning The project 'Gjallarhorn.Bindable.XamarinForms' cannot be referenced. The referenced project is targeted to a different framework family (.NETFramework) ElmInspiredOneXF.iOS

bigjonroberts commented 6 years ago

My next step is to try building this exclusively on Visual Studio for Mac. But it's a side project and I might not get to that for a few days.

bigjonroberts commented 6 years ago

Perhaps I can try .NetStandard from #14 Would this lead in the same direction as this? https://dontpaniclabs.com/blog/post/2017/10/17/targeting-net-standard-xamarin-forms-shared-libraries/

bigjonroberts commented 6 years ago

I loaded up the net standard branch from mtnrqb and rebased-renamed my branch over that. I'm able to get everything else working, except the iOS build. I made sure that I am able to get a .netstandard iOS build loaded onto my phone. I just created an empty app in VS for Mac and configured all the profiles/certs/etc. So that is isolated. It's not an issue with building/deploying any old netstandard app.

When I get the error under VS for Mac, it provides a link to here to submit a bug report about this assembly: https://developer.xamarin.com/guides/ios/troubleshooting/mtouch-errors/#MT2102

/Users/dad/work/Gjallarhorn.Bindable/samples/ElmInspiredOne/iOS/bin/iPhone/Debug/ElmInspiredOneXF.iOS2.iOS.exe  
    MTOUCH : error MT2102: Error processing the method 'System.String Gjallarhorn.XamarinForms.DynParameterInfo::get_Name()' in the assembly 'Gjallarhorn.Bindable.XamarinForms.dll': Object reference not set to an instance of an object
Done building target "_CompileToNative" in project "ElmInspiredOneXF.iOS2.iOS.csproj" -- FAILED.

Done building project "ElmInspiredOneXF.iOS2.iOS.csproj" -- FAILED.

Build FAILED.

/Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2003,5): warning MSB3276: Found conflicts between different versions of the same dependent assembly. Please set the "AutoGenerateBindingRedirects" property to true in the project file. For more information, see http://go.microsoft.com/fwlink/?LinkId=294190.
MTOUCH : error MT2102: Error processing the method 'System.String Gjallarhorn.XamarinForms.DynParameterInfo::get_Name()' in the assembly 'Gjallarhorn.Bindable.XamarinForms.dll': Object reference not set to an instance of an object
    1 Warning(s)
    1 Error(s)

Time Elapsed 00:00:18.45

---------------------- Done ----------------------

Build: 1 error, 1 warning
bigjonroberts commented 6 years ago

I was able to get it working using the new Xamarin .NetStandard templates that were introduced last year. I've shared in a separate repo (https://github.com/bigjonroberts/Conduit) and you can decide what to do from there. After decision is made, I'll help roll in the new demo. I still need to go back and make adjustments to the Android app in this repo, but I never had any trouble getting android apps working, so I don't think it will be an issue. Plus side - this is pure FSharp code now, the Driod and iOS apps are fsproj, too, not csproj. Cons:

mtnrbq commented 6 years ago

@bigjonroberts - awesome work

ReedCopsey commented 6 years ago

@bigjonroberts I'd see if rebasing this and seeing how well it works with the latest VS and the updated templates.

Got the official core library project out for NS 2 now, so hopefully this will work better. I'm fine losing support for old VS versions.