GithubHelp home page GithubHelp logo

sanojpunchihewa / inappupdater Goto Github PK

View Code? Open in Web Editor NEW
263.0 8.0 54.0 1.47 MB

Android Library to easily implement in-app updates. Support with a :star: Contributions are welcome! :raised_hands:

License: MIT License

Java 100.00%
android-library android updates inapp-update java playstore updatemanager

inappupdater's Introduction

Build Status Android Arsenal API License: MIT

InAppUpdater

Android Library to easily implement in-app updates

✏️ Usage

Step 1: Add it in your root build.gradle

allprojects {
    repositories {
        maven { url "https://jitpack.io" }
    }
}

Step 2: Add the dependency

dependencies {
    implementation 'com.github.SanojPunchihewa:InAppUpdater:1.0.5'
}

Step 3: Initialize the UpdateManager

Declare the UpdateManager in your Activity

    // Declare the UpdateManager
    UpdateManager mUpdateManager;

Initialize the UpdateManager in your onCreate method of the Activity

    // Initialize the Update Manager with the Activity and the Update Mode
    mUpdateManager = UpdateManager.Builder(this).mode(UpdateManagerConstant.FLEXIBLE);
    mUpdateManager.start();

Update Mode

There are two modes

  • Flexible(UpdateManagerConstant.FLEXIBLE) (default) - User can use the app during update download, installation and restart needs to be triggered by user

  • Immediate(UpdateManagerConstant.IMMEDIATE) - User will be blocked until download and installation is finished, restart is triggered automatically

Additionally you can get the Available Version Code of the update and the Number of days passed since the user was notified of an update through the Google Play. You can find these codes in the demo app

mUpdateManager.addUpdateInfoListener(new UpdateInfoListener() {
    @Override
    public void onReceiveVersionCode(final int code) {
        // You can get the available version code of the apk in Google Play
        // Do something here
    }

    @Override
    public void onReceiveStalenessDays(final int days) {
        // Number of days passed since the user was notified of an update through the Google Play
        // If the user hasn't notified this will return -1 as days
        // You can decide the type of update you want to call
    }
});

Monitoring the flexible update download progres

You can monitor the download progress of a Flexible Update using this callback. Note: This is only available for Flexible update mode. You can find more from the official doc

// Callback from Flexible Update Progress
mUpdateManager.addFlexibleUpdateDownloadListener(new FlexibleUpdateDownloadListener() {
    @Override
    public void onDownloadProgress(final long bytesDownloaded, final long totalBytes) {
       // Show a progress bar or anything you want
    }
});

🎥 Demo

Flexible Update Immediate Update

❗ Troubleshoot

  • In-app updates works only with devices running Android 5.0 (API level 21) or higher
  • In-app updates are available only to user accounts that own the app. So, make sure the account you’re using has downloaded your app from Google Play at least once before using the account to test in-app updates.
  • Make sure that the app that you are testing in-app updates with has the same application ID and is signed with the same signing key as the one available from Google Play.
  • Because Google Play can only update an app to a higher version code, make sure the app you are testing as a lower version code than the update version code.

You can find more information at Frequently Asked Questions

👐 Contributions

Any contributions are welcome!

📄 License

MIT License

Copyright (c) 2019 Sanoj Punchihewa

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

inappupdater's People

Contributors

anjanasenanayake avatar dependabot-preview[bot] avatar sanojpunchihewa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

inappupdater's Issues

crash app : Failed to call observer method

hi, i just use 2 lines of code:

val mUpdateManager = UpdateManager.Builder(this).mode(UpdateManagerConstant.FLEXIBLE);
        mUpdateManager.start()

but got this crash:


2021-03-05 23:25:09.458 8683-8683/com.civix.link E/CustomActivityOnCrash: The previous app process crashed. This is the stack trace of the crash:
    java.lang.RuntimeException: Failed to call observer method
        at androidx.lifecycle.ClassesInfoCache$MethodReference.invokeCallback(ClassesInfoCache.java:226)
        at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeMethodsForEvent(ClassesInfoCache.java:194)
        at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeCallbacks(ClassesInfoCache.java:185)
        at androidx.lifecycle.ReflectiveGenericLifecycleObserver.onStateChanged(ReflectiveGenericLifecycleObserver.java:37)
        at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:361)
        at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:188)
        at com.sanojpunchihewa.updatemanager.UpdateManager.<init>(UpdateManager.java:49)
        at com.sanojpunchihewa.updatemanager.UpdateManager.Builder(UpdateManager.java:54)
        at com.civix.link.Screen.HomeScreen.checkUpdateApp(HomeScreen.kt:296)
        at com.civix.link.Screen.HomeScreen.access$checkUpdateApp(HomeScreen.kt:57)
        at com.civix.link.Screen.HomeScreen$getCurrentUserInfo$1.onSuccess(HomeScreen.kt:195)
        at com.civix.link.Network.ApiHelper$getData$1.onResponse(ApiHelper.kt:42)
        at com.androidnetworking.common.ANRequest.deliverSuccessResponse(ANRequest.java:727)
        at com.androidnetworking.common.ANRequest.access$6500(ANRequest.java:80)
        at com.androidnetworking.common.ANRequest$6.run(ANRequest.java:709)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:8107)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
     Caused by: java.lang.NullPointerException: Attempt to read from field 'int com.sanojpunchihewa.updatemanager.UpdateManager.mode' on a null object reference
        at com.sanojpunchihewa.updatemanager.UpdateManager.continueUpdate(UpdateManager.java:142)
        at com.sanojpunchihewa.updatemanager.UpdateManager.onResume(UpdateManager.java:252)
        at java.lang.reflect.Method.invoke(Native Method)
        at androidx.lifecycle.ClassesInfoCache$MethodReference.invokeCallback(ClassesInfoCache.java:216)
        at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeMethodsForEvent(ClassesInfoCache.java:194) 
        at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeCallbacks(ClassesInfoCache.java:185) 
        at androidx.lifecycle.ReflectiveGenericLifecycleObserver.onStateChanged(ReflectiveGenericLifecycleObserver.java:37) 
        at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:361) 
        at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:188) 
        at com.sanojpunchihewa.updatemanager.UpdateManager.<init>(UpdateManager.java:49) 
        at com.sanojpunchihewa.updatemanager.UpdateManager.Builder(UpdateManager.java:54) 
        at com.civix.link.Screen.HomeScreen.checkUpdateApp(HomeScreen.kt:296) 
        at com.civix.link.Screen.HomeScreen.access$checkUpdateApp(HomeScreen.kt:57) 
        at com.civix.link.Screen.HomeScreen$getCurrentUserInfo$1.onSuccess(HomeScreen.kt:195) 
        at com.civix.link.Network.ApiHelper$getData$1.onResponse(ApiHelper.kt:42) 
        at com.androidnetworking.common.ANRequest.deliverSuccessResponse(ANRequest.java:727) 
        at com.androidnetworking.common.ANRequest.access$6500(ANRequest.java:80) 
        at com.androidnetworking.common.ANRequest$6.run(ANRequest.java:709) 
        at android.os.Handler.handleCallback(Handler.java:883) 
        at android.os.Handler.dispatchMessage(Handler.java:100) 
        at android.os.Looper.loop(Looper.java:237) 
        at android.app.ActivityThread.main(ActivityThread.java:8107) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100) 
2021-03-05 23:25:09.555 8683-8683/com.civix.link W/Gralloc3: mapper 3.x is not supported

InAppUpdater sees the update, but can't install it

Describe the bug
I'm trying to use your library, all works fine, but after the update installation is completed and the program restarts, I see the old version.

To Reproduce
For testing I created a simple application with versionCode 3(before this I posted versionCode 2 in the internal test track, but I did not see updates in my application with versionCode 1) and uploaded it in the Google play in a closed track(alpha version).

Code:

public class UpdateActivity extends AppCompatActivity {

    private UpdateManager mUpdateManager;

    static final int REQUEST_CODE = 781;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_update);

        TextView txtCurrentVersion = findViewById(R.id.currentVersion);
        TextView txtAvailableVersion = findViewById(R.id.availableVersion);

        txtCurrentVersion.setText(String.valueOf(BuildConfig.VERSION_CODE));

        // Initialize the Update Manager with the Activity and the Update Mode
        mUpdateManager = UpdateManager.Builder(this);

        // Callback from Available version code
        mUpdateManager.getAvailableVersionCode(code -> txtAvailableVersion.setText(String.valueOf(code)));
    }

    @Override
    protected void onResume() {
        super.onResume();
        // Continue updates when resumed
        mUpdateManager.continueUpdate();
    }


    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == REQUEST_CODE) {
            if (resultCode == RESULT_OK) {
                Log.d("MyTag", "Result ok! Result code: " + resultCode);
            }
            else if(resultCode == RESULT_CANCELED){
                Log.d("MyTag", "Result canceled! Result code: " + resultCode);

            }
            else if(resultCode == ActivityResult.RESULT_IN_APP_UPDATE_FAILED){
                Log.d("MyTag", "In app update failed! Result code: " + resultCode);

            }
        }
    }


    public void tryToUpdate(View view){
        mUpdateManager.mode(UpdateManagerConstant.FLEXIBLE).start();
    }

}

After starting, I see that current version = 2, available version = 3, so the app sees the update. Next I click the tryToUpdate button and see the update dialog, click "update", wait, see "An update has just been downloaded", click "restart", see installation activity, after that my application restarts and I see the old version - current version = 2, and this is the problem. Of course, I tried to manually close and open the app but I still see the old version. But if I delete the old version and manually install the new version from Google Play, then all works fine.

So, how can I solve this?

Expected behavior
I expect to see current version = 3, available version = 3.

  • OS: Android 8.1.0

Update not working

UpdateManager mUpdateManager;
mUpdateManager = UpdateManager.Builder(this).mode(UpdateManagerConstant.FLEXIBLE);
mUpdateManager.start();

Added in gradle-
implementation 'com.github.SanojPunchihewa:InAppUpdater:1.0.5

Everything is added and fine and as per guideline but not working after update.

[BUG] force update closing on back button.

Describe the bug
force update is closing when hardware back button is pressed.
To Reproduce
Steps to reproduce the behavior:

  1. trigger force update
  2. Click on back button
  3. force update window closes.

Expected behavior
force update is needed so that old version are updated forcefully. user can still close the window and use old version.

Additional context
my main activity has onBackPress() which helps user to exit app for twice clicks.

error not wroking with fragmentActivity

as i extends my mainactivity with fragment activity

error lies in
mUpdateManager = UpdateManager.Builder(this);

this only suport appcompact activity

please tell how to solve this error

Subscription pause and resubscribe

Hi.
I got the following message from Google:
"You must have account hold and restore implemented in your app by November 1, 2020. Subscription pause and resubscribe will also be enabled by default, unless you opt out."
Is this feature planned to be maintained?

Showing No Update available.

2019-10-26 14:58:57.809 895-895/? I//vendor/bin/hw/[email protected]: unbindService is called for service : com.android.vending/com.google.android.finsky.installservice.DevTriggeredUpdateService and for client com.chalkbox.oasishld
2019-10-26 14:58:57.809 895-895/? I//vendor/bin/hw/[email protected]: size of service connections for service: com.android.vending/com.google.android.finsky.installservice.DevTriggeredUpdateServiceafter removal is 0
2019-10-26 14:58:57.809 895-895/? I//vendor/bin/hw/[email protected]: size of client connections for client: com.chalkbox.oasishldafter removal is 0
2019-10-26 14:58:57.809 14713-14713/? D/InAppUpdateManager: No Update available
2019-10-26 14:58:57.812 895-895/? I//vendor/bin/hw/[email protected]: destroyService is called for service : com.android.vending/com.google.android.finsky.installservice.DevTriggeredUpdateService
2019-10-26 14:58:57.813 14713-14733/? I/PlayCore: UID: [10368]  PID: [14713] OnRequestInstallCallback : onRequestInfo

Please help sir.

flexible update not working.

lateinit var updateManager: UpdateManager

in onCreate() method:

updateManager = UpdateManager.Builder(this).mode(UpdateManagerConstant.FLEXIBLE)
updateManager.start()

my app in GooglePlay but still not getting update window. (update not working.)

Call unregisterReceiver(InstallStateUpdatedListener) when update-manager instance is destroyed

Describe the bug
Need to add a method to call unregisterReceiver() on InstallStateUpdatedListener to remove it when status updates are no longer needed.

Crash Log

Activity com.mobile.kseb.Main has leaked IntentReceiver
com.google.android.play.core.listener.b@22d2dc3 that was originally
registered here. Are you missing a call to unregisterReceiver()?
android.app.IntentReceiverLeaked: Activity com.mobile.kseb.Main has leaked
IntentReceiver com.google.android.play.core.listener.b@22d2dc3 that was
originally registered here. Are you missing a call to unregisterReceiver()?
at android.app.LoadedApk$ReceiverDispatcher.(LoadedApk.java:918)
at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:719)
at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1172)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1152)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1146)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:554)
at com.google.android.play.core.listener.a.a(Unknown Source)
at com.google.android.play.core.listener.a.a(Unknown Source)
at com.google.android.play.core.appupdate.b.registerListener(Unknown
Source)
at
com.sanojpunchihewa.updatemanager.UpdateManager.setUpListener(UpdateManager.java:122)
at
com.sanojpunchihewa.updatemanager.UpdateManager.start(UpdateManager.java:62)
at com.mobile.kseb.Main.onCreate(Main.java:59)
at android.app.Activity.performCreate(Activity.java:6237)
at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
09-29 21:04:45.241 4836-4876/com.mobile.kseb E/Surface:
getSlotFromBufferLocked: unknown buffer: 0xab309be0

Related to 16

[BUG] I've got NPE report from firebase

Describe the bug
i've used this repo 1.0.5-alpha.1, reported NPE from firebase crashlytics.

To Reproduce
Sorry, i can't reproduce it.

Screenshots
image

Desktop (please complete the following information):

  • OS: android 9, galaxyS8

Additional context
None

[BUG]

Hi, thank you very much for your effort,

I implemented your library but I have a problem.

For example, my local version is 4.5 and version of app in store is 4.6.

App is updated but local version is not changing, Whenever I opened my app always asks update needed.

Please help this issue.

[BUG] Crash and ANR on Huawei devices

Describe the bug
Crash and ANR were confirmed with Android Vital of Firebase and Play Store by the application using ver1.0.5.
Oddly enough, crashes and ANRs are only seen on Huawei devices.

To Reproduce
Occurs when you execute the following code within the onCreate of your Activity.
UpdateManager UpdateManager.Builder(this).mode(UpdateManagerConstant.FLEXIBLE).start();

Screenshots
We will inform you of the crash log and the target device and OS.

java.lang.RuntimeException: 
  at androidx.lifecycle.ClassesInfoCache$MethodReference.invokeCallback (ClassesInfoCache.java:226)
  at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeMethodsForEvent (ClassesInfoCache.java:194)
  at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeCallbacks (ClassesInfoCache.java:185)
  at androidx.lifecycle.ReflectiveGenericLifecycleObserver.onStateChanged (ReflectiveGenericLifecycleObserver.java:36)
  at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent (LifecycleRegistry.java:361)
  at androidx.lifecycle.LifecycleRegistry.addObserver (LifecycleRegistry.java:188)
  at com.sanojpunchihewa.updatemanager.UpdateManager.<init> (UpdateManager.java:49)
  at com.sanojpunchihewa.updatemanager.UpdateManager.Builder (UpdateManager.java:54)
  ...
  at android.os.AsyncTask.finish (AsyncTask.java:696)
  at android.os.AsyncTask.access$600 (AsyncTask.java:180)
  at android.os.AsyncTask$InternalHandler.handleMessage (AsyncTask.java:713)
  at android.os.Handler.dispatchMessage (Handler.java:112)
  at android.os.Looper.loop (Looper.java:216)
  at android.app.ActivityThread.main (ActivityThread.java:7625)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:524)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:987)
  
Caused by: java.lang.NullPointerException: 
  at com.sanojpunchihewa.updatemanager.UpdateManager.continueUpdate (UpdateManager.java:142)
  at com.sanojpunchihewa.updatemanager.UpdateManager.onResume (UpdateManager.java:252)
  at java.lang.reflect.Method.invoke (Method.java)
  at androidx.lifecycle.ClassesInfoCache$MethodReference.invokeCallback (ClassesInfoCache.java:216)
  at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeMethodsForEvent (ClassesInfoCache.java:194)
  at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeCallbacks (ClassesInfoCache.java:185)
  at androidx.lifecycle.ReflectiveGenericLifecycleObserver.onStateChanged (ReflectiveGenericLifecycleObserver.java:36)
  at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent (LifecycleRegistry.java:361)
  at androidx.lifecycle.LifecycleRegistry.addObserver (LifecycleRegistry.java:188)
  at com.sanojpunchihewa.updatemanager.UpdateManager.<init> (UpdateManager.java:49)
  at com.sanojpunchihewa.updatemanager.UpdateManager.Builder (UpdateManager.java:54)
  ...
  at android.os.AsyncTask.finish (AsyncTask.java:696)
  at android.os.AsyncTask.access$600 (AsyncTask.java:180)
  at android.os.AsyncTask$InternalHandler.handleMessage (AsyncTask.java:713)
  at android.os.Handler.dispatchMessage (Handler.java:112)
  at android.os.Looper.loop (Looper.java:216)
  at android.app.ActivityThread.main (ActivityThread.java:7625)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:524)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:987)

Target device
HUAWEI P20 Lite
HUAWEI P30 lite
HUAWEI P10 lite
P20 Pro
P30 Pro
nova 2
Mate 9
HUAWEI P smart+ 2019
HUAWEI P30
华为畅享7S

Target OS
Android 9
Android 8.0
Android 10

Request - ActivityResult

Hello! Thanks for doing this fantastic library! Can you try to add the method "onActivityResult"
This is the official method:

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
  if (requestCode == MY_REQUEST_CODE) {
    if (resultCode != RESULT_OK) {
      log("Update flow failed! Result code: " + resultCode);
      // If the update is cancelled or fails,
      // you can request to start the update again.
    }
  }
}

Thanks a lot! 💙💙💙

google material design textbox looks faded after adding your inapp updater..please help

implementation 'com.github.SanojPunchihewa:InAppUpdater:1.0.4-alpha2' added in build.gradle.

apply plugin: 'com.android.application'
//1.0 9 =>1.1 10
android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    useLibrary 'org.apache.http.legacy'
    defaultConfig {
        applicationId 'com.mobile.kseb'
        minSdkVersion 21
        targetSdkVersion 28
        versionName '0.0'
        versionCode 8
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    productFlavors {
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    //implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.github.SanojPunchihewa:InAppUpdater:1.0.4-alpha2'
    implementation 'com.google.android.material:material:1.0.0'
    //compile 'com.android.support:support-v4:22.1.1'
    //implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    //implementation 'com.android.support:design:28.0.0'
    implementation 'androidx.appcompat:appcompat:1.0.0'
    //its working
    //implementation 'com.android.support:design:28.0.0-alpha3'compile 'cn.pedant.sweetalert:library:1.3'
    //implementation 'com.github.joielechong:countrycodepicker:2.2.0'

    implementation 'com.hbb20:ccp:2.2.7'
    implementation 'com.github.heetch:Android-country-picker:1.0.6'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    //implementation 'com.github.TutorialsAndroid:KAlertDialog:v4.1'
    //implementation 'com.github.Shashank02051997:FancyAlertDialog-Android:0.1'
    implementation 'com.github.thomper:sweet-alert-dialog:v1.4.0'
    implementation 'com.kofigyan.stateprogressbar:stateprogressbar:1.0.0'
    implementation 'com.google.android.play:core:1.6.1'
    implementation files('libs/ksoap2-android-assembly-2.5.8-jar-with-dependencies.jar'


    )
    //compile 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'org.jsoup:jsoup:1.9.2'

}

Didnt work

When i use this library, the app didnt show the update from store even it has the latest version code. Please respond

app not updating after installing from in-app update screen.

app dialog appears that a new version available then i click on update button and update download starts. when app update download completes a snackbar pop ups and if i click on restart then the in-app update screen appears and starts installing but it doesn't show any updated screen. it just goes away and app restarts but version stays same and when i exit and reopen app it again shows the dialog. this is very confusing.

Samsung a10 , android 9

[BUG] Update get cancel.

Force update required
User can cancel Immediate update.
On Cancel click it should ask for update again.

To Resolve
Please Add onActivityResult or handleResult

How to Test this in-app update feature

Is there a way to test if this feature works without releasing updates to play store ? Would it work if the releases to play store are made on the open beta track ? Thanks

[BUG]Fatal Exception: java.lang.NullPointerException Attempt to invoke virtual method 'void android.app.Activity.startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int, android.os.Bundle)' on a null object reference

Log from Crashlytics:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.Activity.startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int, android.os.Bundle)' on a null object reference
       at com.google.android.play.core.appupdate.c.startIntentSenderForResult(:9)
       at com.google.android.play.core.appupdate.d.startUpdateFlowForResult(:23)
       at com.google.android.play.core.appupdate.d.startUpdateFlowForResult(:9)
       at com.sanojpunchihewa.updatemanager.UpdateManager.startUpdate(UpdateManager.java:95)
       at com.sanojpunchihewa.updatemanager.UpdateManager.access$100(UpdateManager.java:26)
       at com.sanojpunchihewa.updatemanager.UpdateManager$1.onSuccess(UpdateManager.java:84)
       at com.sanojpunchihewa.updatemanager.UpdateManager$1.onSuccess(UpdateManager.java:77)
       at com.google.android.play.core.tasks.e.run(:27)
       at android.os.Handler.handleCallback(Handler.java:790)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6767)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:449)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.