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

Always get Latest Version 0.0.0.0 update from GOOGLE_PLAY #132

Closed
4 tasks done
SetiaBudy-Mail opened this issue Apr 1, 2018 · 35 comments
Closed
4 tasks done

Always get Latest Version 0.0.0.0 update from GOOGLE_PLAY #132

SetiaBudy-Mail opened this issue Apr 1, 2018 · 35 comments
Labels
bug Something isn't working help wanted This issue needs help from other users

Comments

@SetiaBudy-Mail
Copy link

  • I have verified there are no duplicate active or recent bugs, questions, or requests.
  • I have verified that I am using the latest version of AppUpdater.
  • I have given my issue a non-generic title.
  • I have read over the README, Wiki and FAQs (before asking questions on how to do something).
Details
  • PiracyChecker version: 2.6.5
  • Device OS version: 5.0.2
  • Device Manufacturer: LG
  • Device Name: G2
Builder
AppUpdaterUtils appUpdaterUtils = new AppUpdaterUtils(this)
                .setUpdateFrom(UpdateFrom.GOOGLE_PLAY)
                .withListener(new AppUpdaterUtils.UpdateListener() {
                    @Override
                    public void onSuccess(Update update, Boolean isUpdateAvailable) {
                        Log.d("Latest Version ",  update.getLatestVersion());
                        Log.d("Release notes",  update.getReleaseNotes());
                        Log.d("URL",  update.getUrlToDownload().toString());
                        Log.d("Is update available? ", Boolean.toString(isUpdateAvailable));
                    }

                    @Override
                    public void onFailed(AppUpdaterError error) {
                        Log.d("AppUpdater Error", "Something went wrong");
                    }
                });
        appUpdaterUtils.start();
Problem

Hi.. I want to ask, why I always get return Latest Version 0.0.0.0 while in the playstore has its version 1.0.0 thanks.

Expected Result

Latest Version 1.0.0
Release notes
URL https://play.google.com/store/apps/details?id=com.vcard.sg&hl=en
Is update available?true

Actual Result

Latest Version 0.0.0.0
Release notes
URL https://play.google.com/store/apps/details?id=com.vcard.sg&hl=en
Is update available?false

@ivalice93
Copy link

i'm getting the same issue of unable to check app version, it always returns 0.0.0.0 and false on isUpdateAvailable

@javiersantos javiersantos added the possible bug It may be a bug, but it hasn't been reproduced yet label Apr 2, 2018
@ps-jimmy
Copy link

ps-jimmy commented Apr 3, 2018

I am also having same issue here, it always returns 0.0.0.0 and false on isUpdateAvailable

@javiersantos
Copy link
Owner

Thank you for letting me know. I'm looking into it.

@bayrontq
Copy link

bayrontq commented Apr 4, 2018

The Google Play code has stopped reflect the field softwareVersion

@buneme
Copy link

buneme commented Apr 5, 2018

Same here

@buneme
Copy link

buneme commented Apr 5, 2018

@javiersantos maybe the structure of the html page has changed?

@tdtran
Copy link
Contributor

tdtran commented Apr 5, 2018

Google indeed updated the Google Play website. What we do in this library is HTML scraping. Since Google does not provide a stable API for this purpose, that's the only option we have. Unfortunately HTML scraping is fatally sensitive to any changes in Play Store website. To make it worse it's entirely possible that Google does staged rollout, some user's (countries of origin, last digit of their IP address, whatever) may get a different version of the web than others. I personally decided to step back from using this library to notify users about new versions of my apps.

@apurv-verma-007-kranti
Copy link

I am also having same issue here

@kushanshah11
Copy link

@javiersantos same Issue Occurred. Update Dialog not pop Up.

@supersume
Copy link

supersume commented Apr 20, 2018

@javiersantos This issue can be solved by reading the tag with the htlgb class in the Play Store HTML

<span class="htlgb"><div><span class="htlgb">2.1</span></div></span>

@tdtran
Copy link
Contributor

tdtran commented Apr 20, 2018

@supersume the css class htlgb is used in much more places in that html. We'd need to include Current Version in the pattern and that is localized so we need to fetch the en version of the html to parse for the version name, then localized version for what's new. What if the app is for a local market, ie not available for en speaking countries, no english app listing either? I also guess that class name is generated by whatever css tool google engineering is using. That means it can change at any time without adv notice.

@javiersantos javiersantos added bug Something isn't working help wanted This issue needs help from other users and removed possible bug It may be a bug, but it hasn't been reproduced yet labels Apr 22, 2018
@pmrajani
Copy link

here is log i can show in my IDE.

E/AppUpdater: Cannot retrieve latest version. Is it configured properly?


Code setup :
i have added it on MainActivity onCreate method.

AppUpdater appUpdater = new AppUpdater(this);
appUpdater.start();

@kushanshah11
Copy link

@javiersantos have you solved this problem?

@tejasgawali4
Copy link

@javiersantos getting the same error.

E/AppUpdater: Cannot retrieve latest version. Is it configured properly?

@luciovinicius
Copy link

anyone? i'm getting the same error

@chaitanya-teja
Copy link

I think it has not been updated yet after google changed their html source.

@vishnu-simplecrm
Copy link

Still facing the same issue. Is it resolved? if (yes){ "Do I need to update dependency"} else{ "Till when it will be resolved?"}

@kushanshah11
Copy link

kushanshah11 commented May 29, 2018

HI @javiersantos
I can get Latest Version Using Jsoup.

is this parameter used by you in this lib?

newVersion = Jsoup.connect("https://play.google.com/store/apps/details?id=com.otto.excellence&hl=it")
                        .timeout(30000)
                        .userAgent("Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6")
                        .referrer("http://www.google.com")
                        .get()
                        **.select(".hAyfc .htlgb")**
                        .get(7)
                        .ownText();
                return newVersion;

Let me know your thought on same.

Thanks

@serrokitskiy
Copy link

waiting

@vishnu-simplecrm
Copy link

At least give us the timeline, till when the issue will be resolved. Or should we look for other libraries.

@kushanshah11
Copy link

kushanshah11 commented Jun 12, 2018

Hi All,
if you want alternate way to get play store App Version

compile 'org.jsoup:jsoup:1.8.3'

 private class GetVersionCode extends AsyncTask<Void, String, String> {
        @Override
        protected String doInBackground(Void... voids) {

            String newVersion = null;
            try {
                newVersion = Jsoup.connect("https://play.google.com/store/apps/details?id=com.otto.excellence&hl=it")
                        .timeout(30000)
                        .userAgent("Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6")
                        .referrer("http://www.google.com")
                        .get()
                        .select(".hAyfc .htlgb")
                        .get(7)
                        .ownText();
                return newVersion;
            } catch (Exception e) {
                Log.e("Exception", e.getMessage());
                return newVersion;
            }
        }

        @Override
        protected void onPostExecute(String onlineVersion) {
            super.onPostExecute(onlineVersion);

            Log.d("update", "playstore version " + onlineVersion);
        }
    }

@serrokitskiy
Copy link

@kushanshah11 D/update: playstore version 5.0 and up

@kushanshah11
Copy link

@serrokitskiy i dont understand...

@serrokitskiy
Copy link

serrokitskiy commented Jun 12, 2018

@kushanshah11
Log.d("update", "playstore version " + onlineVersion);
return
D/update: playstore version 5.0 and up

not version of application

@kushanshah11
Copy link

@serrokitskiy i have checked with same code and i get correct result.
here i attached snap so you have better idea.

or you can send me link of playstore app for which you are testing so i can investigate for same.

image

Thanks in advance.

@serrokitskiy
Copy link

@kushanshah11
Copy link

@serrokitskiy just update

.get(5)

and you will get your version code.

@serrokitskiy
Copy link

@kushanshah11 ok, thk

@kushanshah11
Copy link

@serrokitskiy let me know once done

@ebenites
Copy link

I changed my code using JSON mode. https://github.com/javiersantos/AppUpdater/wiki/UpdateFrom.JSON
It's work for me

@almaz010891
Copy link

Same problem

@deltaguita
Copy link

deltaguita commented Jul 3, 2018

I create a feature request to google, hope developer can get official support
https://issuetracker.google.com/issues/111101725

@javiersantos
Copy link
Owner

javiersantos commented Jul 5, 2018

Hi guys. I want to clarify that there is no definitive solution to the problem, since Google Play does not provide an API to obtain the latest version.

I will work on a temporary solution that will solve the problem. Please, I advise you to use an alternative and more reliable method (such as JSON or XML).

@javiersantos
Copy link
Owner

javiersantos commented Jul 5, 2018

Update 2.7 is now available with the workaround based on Jsoup. Please note that this is a temporary solution and the Google Play website may change at any time.

https://github.com/javiersantos/AppUpdater/releases/tag/2.7

@MrAnkit007
Copy link

I couldnt understand how to use it properly. should I use it in activity.xml or activity.java

PS: Sorry I am new to this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted This issue needs help from other users
Projects
None yet
Development

No branches or pull requests