Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue implementing IInstallStateUpdatedListener for flexible update #17

Open
dhruvgohiloo7 opened this issue Apr 29, 2021 · 5 comments
Open

Comments

@dhruvgohiloo7
Copy link

When implementing IInstallStateUpdatedListener, I am getting below errors.

error: AppUpdateInstallListener is not abstract and does not override abstract method onStateUpdate(InstallState) in StateUpdatedListener

error: name clash: onStateUpdate(Object) in AppUpdateInstallListener and onStateUpdate(StateT) in StateUpdatedListener have the same erasure, yet neither overrides the other public void onStateUpdate (java.lang.Object p0) where StateT is a type-variable: StateT extends Object declared in interface StateUpdatedListener

@saamerm
Copy link
Collaborator

saamerm commented Apr 29, 2021

What are you trying to achieve?
Does the sample attached in this repo work?
And what version are you having issues with? @dhruvgohiloo7

@dhruvgohiloo7
Copy link
Author

dhruvgohiloo7 commented Apr 29, 2021

@saamerm I am using latest version (1.10.0), I want to support flexible update in my app. So to get InstallStatus after app is downloaded I have implemented IInstallStateUpdatedListener. But I am getting compilation error as posted in the question.
(sample attached in this repo also has the same issue)

public class AppUpdateInstallListener : Java.Lang.Object, IInstallStateUpdatedListener
{
    private readonly IAppUpdateManager _appUpdateManager;

    public AppUpdateInstallListener(IAppUpdateManager appUpdateManager)
    {
        _appUpdateManager = appUpdateManager;
    }

    public void OnStateUpdate(Java.Lang.Object p0)
    {
        if (!(p0 is InstallState info))
            return;

        if (info.InstallStatus() == InstallStatus.Downloaded)
        {
                _appUpdateManager.CompleteUpdate();
        }
    }
}

@PatGet
Copy link
Owner

PatGet commented Apr 29, 2021

Hi @dhruvgohiloo7 . As it is mentioned in xamarin/GooglePlayServicesComponents#221 Xamarin would need to support modules first for some features. Flexible Updates is one of it. So for now only Immediate updates are possible

@Alex1ch
Copy link

Alex1ch commented Oct 15, 2021

Hello @PatGet, there is mapping error with the IInstallStateUpdatedListener interface, I made p/r to fix it #20

@sulayjoshi-bs
Copy link

Hi @Alex1ch I am facing same error with latest stable version 1.10.0 and pre-release version 1.10.2-rc2.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants