question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Link all for project using FreshMvvm - Android

See original GitHub issue

Hi there,

Is there a way to get an app that is using this library with linking set to “Sdk and User Assemblies” set in the project configuration on android to work?

I am setting linking to ‘Sdk and User Assemblies’ and Ive added the [Preserve(AllMembers = true)] attribute on PageModels and Pages to attempt to preserve FreshMvvm (which is probably incorrect anyway), but its throwing an exception on the follow line in my app.cs file:

 Page loginPage = FreshPageModelResolver.ResolvePageModel<LoginPageModel>();

The exception I was getting was:

  at FreshTinyIoC.FreshTinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, FreshTinyIoC.NamedParameterOverloads parameters, FreshTinyIoC.ResolveOptions options) [0x0006b] in C:\Projects\FreshMvvm\src\FreshIOC\FreshTinyIOC.cs:3339 
  at FreshTinyIoC.FreshTinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, FreshTinyIoC.NamedParameterOverloads parameters, FreshTinyIoC.ResolveOptions options) [0x00000] in C:\Projects\FreshMvvm\src\FreshIOC\FreshTinyIOC.cs:3314 
  at FreshTinyIoC.FreshTinyIoCContainer.ResolveInternal (FreshTinyIoC.FreshTinyIoCContainer+TypeRegistration registration, FreshTinyIoC.NamedParameterOverloads parameters, FreshTinyIoC.ResolveOptions options) [0x001b2] in C:\Projects\FreshMvvm\src\FreshIOC\FreshTinyIOC.cs:3175 
  at FreshTinyIoC.FreshTinyIoCContainer.Resolve (System.Type resolveType) [0x00000] in C:\Projects\FreshMvvm\src\FreshIOC\FreshTinyIOC.cs:1184 
  at FreshMvvm.FreshTinyIOCBuiltIn.Resolve (System.Type resolveType) [0x00000] in C:\Projects\FreshMvvm\src\FreshMvvm\FreshTinyIOCBuiltIn.cs:48 
  at FreshMvvm.FreshPageModelResolver.ResolvePageModel (System.Type type, System.Object data, FreshMvvm.FreshBasePageModel pageModel) [0x0002d] in C:\Projects\FreshMvvm\src\FreshMvvm\FreshPageModelResolver.cs:41 
  at FreshMvvm.FreshPageModelResolver.ResolvePageModel[T] (System.Object data, T pageModel) [0x0000b] in C:\Projects\FreshMvvm\src\FreshMvvm\FreshPageModelResolver.cs:25 
  at FreshMvvm.FreshPageModelResolver.ResolvePageModel[T] (System.Object initData) [0x0000b] in C:\Projects\FreshMvvm\src\FreshMvvm\FreshPageModelResolver.cs:19 
  at FreshMvvm.FreshPageModelResolver.ResolvePageModel[T] () [0x00000] in C:\Projects\FreshMvvm\src\FreshMvvm\FreshPageModelResolver.cs:12 
  at SampleApp.App..ctor () [0x00019] in C:\Users\Admin\Xenia\Client\SampleApp\SampleApp\SampleApp\App.xaml.cs:59 

The message was:

"Resolve failed: LoginPage"

There was no inner exception to go with either.

Im guessing maybe the ResolvePageModel cannot resolve the page from the page model type due to reflection being stripped out in this library?

Capture

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
LeoJHarriscommented, Sep 9, 2019

Hi @libin85 I set Linking back to ‘Link Assemblies only’ I was going try to resolve this issue so Ill update you when I have a had a go at this again. Thanks

0reactions
LeoJHarriscommented, Feb 16, 2020

@Stratosf Like this:

    [PropertyChanged.AddINotifyPropertyChangedInterface]
    [Preserve(AllMembers = true)] // Preserve when link all
    public class CustomBasePageModel : FreshBasePageModel
    {
        // Your class stuff here
    }
Read more comments on GitHub >

github_iconTop Results From Across the Web

FreshMvvm for Xamarin.Forms
FreshMvvm is a super light Mvvm Framework designed specifically for Xamarin.Forms. It's designed to be Easy, Simple and Flexible.
Read more >
Xamarin Forms: IOC in FreshMvvm
I am using Freshmvvm for my Xamarin forms project. I am using a camera and want to use platform specific features. So, I...
Read more >
Michael Ridland - RSSing.com
I use FreshMvvm in the majority of my projects. I love it's simplicity but most of all it's flexibility. The Framework is Interface...
Read more >
Tabbed Page In Xamarin.Forms Using FreshMvvm
According to Github, FreshMvvm is a super light Mvvm Framework designed specifically for Xamarin.Forms. It's designed to be simple and flexible.
Read more >
Setting up a basic MVVM architecture in .NET MAUI
Setting up a basic MVVM architecture and Navigation service in .NET MAUI, without 3rd party libraries.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found