blockchain-certificates / wallet-android

An Android app for Blockcerts
MIT License
38 stars 47 forks source link

Error: Only the original thread that created a view hierarchy can touch its views #25

Open mlisle opened 5 years ago

mlisle commented 5 years ago

One of our users is receiving an error when attempting to add us as an issuer to his Blockcerts wallet (Android). After entering our issuer URL, entering his one-time code, and tapping "Add Issuer," he gets:

"Only the original thread that created a view hierarchy can touch its views."

He has tried multiple times, over multiple days, and gets this error each time. Other users have been able to add us as an issuer with no errors during this same time frame.

Does this error ring any bells for anyone?

mlisle commented 5 years ago

Update: I've now received this report from two users running Android 9 (one on a Pixel 2, and the other on a OnePlus 5). Perhaps this is an Android 9 issue?

ghost commented 5 years ago

Confirmed that this happened to my device (Nexus v7) when trying to add an issuer by manually typing the add issuer information. The screenshot shows just random data but I've confirmed the issue is still present with good data.

screenshot_20190208-103338

ghost commented 5 years ago

Initial discovery, this error seems to be happening when trying to enable/disable the Add Issuer button from the AddIssuerFragment.java class.

Line 132:

    private void enableImportButton(boolean enable) {
        mBinding.importButton.setEnabled(enable);
    }

I commented out this line and it seemed to work. Seems like the request goes through correctly even when hitting this error.

stuartf commented 5 years ago

I can't replicate the error on AVD when emulating a Pixel 2 running Android 9 which will make this difficult to test/resolve for anyone who doesn't have a physical device that's affected.

mlisle commented 5 years ago

@AnthonyRonning We tested on 3 emulators (Nexus 6, Pixel 3, 54. FWVGA), all with Android 9, and adding an issuer worked fine. Do you believe the error was fixed with your change from 2/11? If so, we could close this issue.

ghost commented 5 years ago

@mlisle I can check my emulator again this week, the visualization bug fix was in the certificate html loading. Maybe an update to android 9 fixed it? Not sure but I'll let you know, thanks for checking in on it.

ghost commented 5 years ago

I still have this reproducing on my emulator. Pixel API 28 (version 9).


Name: Pixel_API_28

CPU/ABI: Google APIs Intel Atom (x86)

Path: /Users/anthonyronning/.android/avd/Pixel_API_28.avd

Target: google_apis [Google APIs] (API level 28)

Skin: pixel_silver

SD Card: 512M

fastboot.chosenSnapshotFile: 

runtime.network.speed: full

hw.accelerometer: yes

hw.device.name: pixel

hw.lcd.width: 1080

hw.initialOrientation: Portrait

image.androidVersion.api: 28

tag.id: google_apis

hw.mainKeys: no

hw.camera.front: emulated

avd.ini.displayname: Pixel API 28

hw.gpu.mode: auto

hw.ramSize: 1536

PlayStore.enabled: false

fastboot.forceColdBoot: no

hw.cpu.ncore: 4

hw.keyboard: yes

hw.sensors.proximity: yes

hw.dPad: no

hw.lcd.height: 1920

vm.heapSize: 228

skin.dynamic: yes

hw.device.manufacturer: Google

hw.gps: yes

hw.audioInput: yes

image.sysdir.1: system-images/android-28/google_apis/x86/

showDeviceFrame: yes

hw.camera.back: virtualscene

AvdId: Pixel_API_28

hw.lcd.density: 420

hw.arc: false

hw.device.hash2: MD5:55acbc835978f326788ed66a5cd4c9a7

fastboot.forceChosenSnapshotBoot: no

fastboot.forceFastBoot: yes

hw.trackBall: no

hw.battery: yes

hw.sdCard: yes

tag.display: Google APIs

runtime.network.latency: none

disk.dataPartition.size: 800M

hw.sensors.orientation: yes

avd.ini.encoding: UTF-8

hw.gpu.enabled: yes
Screen Shot 2019-05-17 at 11 03 13 AM