question

Sean Yoon avatar image
Sean Yoon asked Sean Yoon commented

CloverAccount.getAccount returns null from emulator

I just tried my first app with SDK 248.4 on emulator Station 2018 and DEV kit.

In the build.gradle.

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    compileSdkVersion 29
    defaultConfig {
        applicationId "com.micropayusa.ordergo"
        minSdkVersion 17
        //noinspection ExpiredTargetSdkVersion
        targetSdkVersion 25
}

In the AndroidManifest.xml.

<uses-permission android:name="android.permission.GET_ACCOUNTS"/>

In the MainActivity.java.

account = CloverAccount.getAccount(MainActivity.this);

In the emulator, the account is returned null, but my DEV kit returns the account successfully.

Any ideas to get the account on emulator?


Thank you,

EmulatorClover Station 2018
10 |2000

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

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered Sean Yoon commented

This is a runtime permission. If you target Android 6 (API 23) or higher, you need to request the permission at runtime.

https://developer.android.com/training/permissions/requesting


On Clover devices we don't require runtime permissions; asking in the manifest is enough. This is special to Clover devices only however.

1 comment
10 |2000

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

Sean Yoon avatar image Sean Yoon commented ·

Thank you. I solved it.

0 Likes 0 ·

Welcome to the
Clover Developer Community