This repository has been archived by the owner on Nov 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 146
Core library: IInstallStateUpdatedListener missing new Android 14 requirements? #813
Comments
Maybe this package will help you: https://github.com/oscoreio/Maui.Android.InAppUpdates |
same issue
|
nuget change : Xamarin.Google.Android.Play.App.Update You should use the immediate update. |
This was referenced Mar 7, 2024
The InstallStateUpdateListener has generics so it cannot be bound without causing errors. You can add the following file to your app with a Build aciton of package xamarin.google.android.play.core.install;
import com.google.android.play.core.install.InstallStateUpdatedListener;
import com.google.android.play.core.install.InstallState;
public class InstallStateUpdatedListenerWrapper {
private InstallStateUpdatedListener installStateUpdatedListener = state -> {
onStateUpdate (state);
};
void onStateUpdate(InstallState state)
{
if (stateUpdateListener != null)
stateUpdateListener.OnStateUpdate(state);
}
public InstallStateUpdatedListener GetListener()
{
return installStateUpdatedListener;
}
public interface InstallStateListener {
/**
* Called when an the State is Updated
*
* @param state The Install Session State.
*/
abstract void OnStateUpdate (InstallState state);
}
private InstallStateListener stateUpdateListener = null;
public void setStateUpdateListener (InstallStateListener listener)
{
stateUpdateListener = listener;
}
} then you can use installListener = new InstallStateUpdatedListenerWrapper();
installListener.StateUpdate += (sender, args) => {
}; you might also need this target in your csproj to fix a dependecy <Target Name="_Foo" AfterTargets="ResolveAndroidTooling" BeforeTargets="_CompileBindingJava">
<ItemGroup>
<_ReferenceJavaLibs Include="$(AndroidSdkBuildToolsPath)core-lambda-stubs.jar" />
</ItemGroup>
</Target> |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Xamarin.Android Version (eg: 6.0):
14.0
Operating System & Version (eg: Mac OSX 10.11):
Pixel 5 - API 34 (Android 14.0)
Describe your Issue
I have a simple flexible In-App update for my Android app, and then...
After upgrading my simulator, and using the new Pixel 5 - Android 14 (API 34) simulator, I now get exception:
Relevant information
Packages used (newest version of Google Play Core):
Info: I have tried using the specific App Update nuget package, and I get same exception as this issue:
PatGet/XamarinPlayCoreUpdater#17
Which is:
The text was updated successfully, but these errors were encountered: