question

travisbrewfund avatar image
travisbrewfund asked Bejoy Nair edited

CloverAccount.getAccount returning null

I am adding a button to our Android app that will allow you to select an item from the inventory and open the register app (Like this example: https://github.com/clover/android-examples/tree/master/selectitemsexample). Following the example, I need to get the clover account object with this call:

account =CloverAccount.getAccount(this);

But this seems to return null. I thought it was a permissions issue or something so I tried enabling the permissions (both from my app’s manifest.xml file and from the clover website) to no avail. I’m wondering if it’s just something wrong with how I’ve set up my dev environment or if it’s just some other detail I’m missing. Thanks in advance for your help.
Clover Android SDK
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bejoy Nair avatar image
Bejoy Nair answered Bejoy Nair edited
Travis - Assuming that all permissions have been correctly granted on the Clover App developer page. This is usually caused due to side loading of an app into clover devices. Clover is still working for a fix but you can usually work around this issue by doing the following:
1. Uninstall the app from the app market by logging into the www.clover.com dashboard
2. Immediately click on install for your app
3. Now return to your device and open App Market app
4. Tap sync button
5. Once sync is complete reopen the app and it should work.

Sync will download the required security config for you app to work on the dev device.

Hope this solves ur issue.
thx,
2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

travisbrewfund avatar image travisbrewfund commented ·

Hi Bejoy, thanks for the quick response. I followed your instructions but am still running into the same issue. However, I think I noticed what is going on. The app market is still listing our old version of the app (version 1.11) which did not require the additional permissions. v1.12 (the latest version) is what I need to be installing from the app market, but this is not being served. From the app settings apk page I can see where v1.11 is listed as "default" which I think needs to be changed to v1.12. How can I accomplish this?

0 Likes 0 ·
Bejoy Nair avatar image Bejoy Nair travisbrewfund commented ·

Travis - Are you seeing this on production account (www.clover.com) or sandbox (sandbox.clover.com) appmarket/apk page?

0 Likes 0 ·
Miguel avatar image
Miguel Deactivated answered Miguel Deactivated commented
Just confirming, do request the following permissions in your AndroidManifest.xml:
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
After initially uploading your APK, you can just sideload with the instructions that @Bejoy Nair listed and you should have all the requested permissions. There isn't a need to go through the App Market to get newer APK versions on your device.
2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

travisbrewfund avatar image travisbrewfund commented ·

Correct, I have been including that permission in my manifest file. Sideloading is how I was initially doing things as well.

0 Likes 0 ·
Miguel avatar image Miguel travisbrewfund commented ·

Are you able to sideload the Clover examples and do they work correctly?

0 Likes 0 ·

Welcome to the
Clover Developer Community