Unable to fetch devices from cloud for tag

Hi,

I have run into a bug that I can’t figure out. As the logs below show, the Proximity SDK seems to be able to download a list of all my beacons, but it is unable to find the beacon i have with a given tag.

2019-09-05 11:52:54.474 8742-9770/my.package D/ESTIMOTE_LOG: com.estimote.proximity_sdk.internals.proximity.repository.CloudAndLocalStorageProximityRepository -> Downloaded attachments for 18 devices.
2019-09-05 11:52:54.545 8742-9770/my.package D/ESTIMOTE_LOG: com.estimote.proximity_sdk.internals.proximity.repository.CloudAndLocalStorageProximityRepository -> Deleted old attachments for 0 devices.
2019-09-05 11:52:54.710 8742-9770/my.package D/ESTIMOTE_LOG: com.estimote.proximity_sdk.internals.proximity.repository.CloudAndLocalStorageProximityRepository -> Unable to fetch devices from cloud for tag clothing
2019-09-05 11:52:54.713 8742-9770/my.package E/ESTIMOTE_LOG: com.estimote.repository_plugin.DefaultRepository -> Unable to fetch data from the upstream; cause: java.lang.NullPointerException: throw with null exception
2019-09-05 11:52:54.720 8742-9770/my.package D/ESTIMOTE_LOG: com.estimote.proximity_sdk.internals.proximity.repository.CloudAndLocalStorageProximityRepository -> Read 0 devices from local storage for tag clothing
2019-09-05 11:52:54.725 8742-9770/my.package W/ESTIMOTE_LOG: com.estimote.proximity_sdk.internals.proximity.ProximityObservationUseCase -> No beacons for given tag values. Make sure you've entered tag names correctly, your app has network connection available (at least once), and tags are correctly assigned to your beacons in Estimote Cloud.

I have tried to simplify everything and my observer is basically just a copy-paste from the documentation on github:

fun startObserver(appContext: Context, appId: String, appToken: String) {

    val cloudCredentials = EstimoteCloudCredentials(appId, appToken)
    val proximityObserver = ProximityObserverBuilder(appContext, cloudCredentials)
            .withBalancedPowerMode()
            .onError {Log.i(TAG, "onError")}
            .build()

    // Kotlin
    val zone = ProximityZoneBuilder()
            .forTag("clothing")
            .inFarRange()
            .onEnter { Log.i(TAG, "onEnter") }
            .onExit { Log.i(TAG, "onExit") }
            .onContextChange { Log.i(TAG, "onContextChange") }
            .build()
    proximityObserver.startObserving(zone)
}

I have tried three different phone models running Android 7 and 9.

I’m not sure what changes led to this, but the issue started to occur around the time I upgraded to Android Studio 3.5. I use Proximity SDK v1.0.3.

The beacon I use for testing has ID 6641bc00f639f738a699dadaeae2361a.

I also tried to make a new test app using the “Add New App” feature in the Estimote cloud service. I downloaded the sample project, but even then the SDK cannot find any beacons with my tag.

EDIT: This turned out to be user error. I managed to use the wrong tag.

I think I figured it out this morning. I disabled R8 and then it worked again. It turned out that while I thought I had added

-keep class com.estimote.proximity_sdk.internals.proximity.cloud.model.**

to my proguard rules (as suggested in the docs) I actually hadn’t. When I added that line the problem went away.