13

I have been trying to add the in app update feature to make the user update the app when there is a new update available in the playstore. I am using the package in_app_update.

But it keeps throwing this error,

I/PlayCore( 8420): UID: [10378]  PID: [8420] AppUpdateService : requestUpdateInfo(com.example.app)
I/PlayCore( 8420): UID: [10378]  PID: [8420] AppUpdateService : Initiate binding to the service.
I/PlayCore( 8420): UID: [10378]  PID: [8420] AppUpdateService : ServiceConnectionImpl.onServiceConnected(ComponentInfo{com.android.vending/com.google.android.finsky.installservice.DevTriggeredUpdateService})
I/PlayCore( 8420): UID: [10378]  PID: [8420] AppUpdateService : linkToDeath
I/PlayCore( 8420): UID: [10378]  PID: [8420] OnRequestInstallCallback : onRequestInfo
I/PlayCore( 8420): UID: [10378]  PID: [8420] AppUpdateService : Unbind from service.
W/JavaBinder( 8420): BinderProxy is being destroyed but the application did not call unlinkToDeath to unlink all of its death recipients beforehand.  Releasing leaked death recipient: com.google.android.play.core.internal.ac

The code I am using is,

try {
  if (Platform.isAndroid) {
    InAppUpdate.checkForUpdate().then((info) {
      setState(() {
        _updateInfo = info;
      });
    }).catchError((error) => print(error));

    if (_updateInfo?.updateAvailable == true) {
      InAppUpdate.performImmediateUpdate()
          .catchError((error) => print(error));
    }
  }
} catch(e) {
    print(e);
}

After failing with the above package for number of days I tried using another package named native_updater. This package also resulted in the same error. Although I followed their example, which should have worked.

The output of flutter doctor is,

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.22.0-10.0.pre.121, on Linux, locale en_US.UTF-8)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Android Studio (version 4.0)
[✓] Connected device (1 available)


I could not find any similar question or answer which is why had to post one.

I am using a 64 bit Kali Linux machine.

Ratnadeep
  • 1,125
  • 1
  • 15
  • 30
  • i have the same issue ... – Jeremy HOFFMANN Sep 24 '20 at 10:14
  • It doesn't throw, it's an internal binder warning for "com.google.android.play.core.internal.ac". Do you actually experience problems? (The error is related to not retaining a handler for binder death but it might work just fine otherwise https://android.googlesource.com/platform/frameworks/base/+/master/core/jni/android_util_Binder.cpp#624) – minsk Oct 01 '20 at 07:19
  • @minsk Thank you for your comment. After adding this code I have updated multiple versions of the app in playstore, but it did not update my locally installed app according to the new update in playstore which it should have. – Ratnadeep Oct 09 '20 at 12:18

3 Answers3

10

At first I had the same problem as you. But I noticed something, the app must be downloaded from the Play Store, and an update must be available as well. If you do this by launching the app from flutter or vscode, it is normal that it does not work. I don't know if I was very clear.

Be aware that this plugin cannot be tested locally. It must be installed via Google Play to work. Please check the official documentation about In App Updates from Google.

Jeremy HOFFMANN
  • 1,230
  • 1
  • 11
  • 21
  • Thank you for your answer. What I want is once I have downloaded the app from play store, then if another updated version is uploaded to play store then I want the app already installed in my phone to update to that latest version that was just uploaded to play store. – Ratnadeep Sep 24 '20 at 14:54
  • @RatnadeepChakraborty Were you able to solve this? I'm stuck at same – watney Jul 01 '21 at 12:41
  • Also @RatnadeepChakraborty, were you trying this on your publicly available application or inside one of the test tracks? – watney Jul 03 '21 at 02:47
  • @watney no, from playstore. I used this package and uploaded to playstore. Later on when I released a further update the already installed app in my phone should be updated but it did not. – Ratnadeep Jul 03 '21 at 15:38
  • @RatnadeepChakraborty not sure what could be the issue in your case but for me, it wasn't showing the update button to internal testers after updating the app on playstore. I had to get it verified in the closed testing track and now it shows the update button for each update in the internal test track. https://stackoverflow.com/questions/66911642/google-play-android-app-internal-testing-update-button-not-shown-to-internal-t – watney Jul 06 '21 at 06:34
2

Make sure 4 things, so you can test your in_app_update feature:

  • Your previous app version code must smaller than future app version code
  • PlayStore should be clear cache before test
  • Previous app version, newer app version must be installed from Internal app sharing. (You can reference this link)
  • Your email which signed in PlayStore must be added to internal tester

Good luck bro!

0

Test with internal app sharing

Use internal app sharing to test in-app updates by performing the following steps:

  • Make sure your test device has a version of your app installed that supports in-app updates and was installed using an internal app sharing URL.

  • Follow the Play Console instructions to share your app internally. Upload a version of your app that uses a version code that is higher than the one you already have installed on the test device.

  • On the test device, click the internal app sharing link for the updated version of your app but do not install the app from the Play Store page that appears after you click the link.

  • Open the app from the device's app drawer or home screen. The update should now be available to your app, and you can test your implementation of in-app updates.

https://developer.android.com/guide/playcore/in-app-updates/test#internal-app-sharing

Scorpion
  • 39
  • 1
  • 4