home-assistant / android

:iphone: Home Assistant Companion for Android
https://companion.home-assistant.io/
Apache License 2.0
2.34k stars 657 forks source link

NFC Tags - Cannot Read and Write #1955

Closed ad-ha closed 3 years ago

ad-ha commented 3 years ago

Home Assistant Android version: beta-1716-40e7907-full

Android version: 10

Phone model: Galaxy S9 (SM-G960W) and Galaxy S8 (SM-G950F)

Home Assistant version: 2021.11.5

Last working Home Assistant release (if known): The Android version from last week was working ok, as tested

Description of problem: With this latest update I cannot read or write any NFC tag. I have tried to write a few and the app keeps crashing. Also tried to read some wrote last week (they were working and calling the right automations) and the app also crashes and closes.

Diagnosis report sent through Android crash report.

Traceback (if applicable, to get the logs you may refer to: https://companion.home-assistant.io/docs/troubleshooting/faqs/#android-crash-logs): N/A

Screenshot of problem: N/A

Additional information: N/A

dshokouhi commented 3 years ago

please get us the crash logs so we can proceed, I am unable to reproduce this as I had tested NFC yesterday. I do not see logs sent through androids crash report so we need the logs posted here.

dshokouhi commented 3 years ago

Ok I see the crash it seems to be happening only when a user is in the NFC setup pages:

2021-11-22 08:25:25.140 24048-24048/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: io.homeassistant.companion.android, PID: 24048
    java.lang.IllegalStateException: Hilt Fragments must be attached to an @AndroidEntryPoint Activity. Found: class io.homeassistant.companion.android.nfc.NfcSetupActivity
        at dagger.hilt.internal.Preconditions.checkState(Preconditions.java:83)
        at dagger.hilt.android.internal.managers.FragmentComponentManager.createComponent(FragmentComponentManager.java:75)
        at dagger.hilt.android.internal.managers.FragmentComponentManager.generatedComponent(FragmentComponentManager.java:64)
        at io.homeassistant.companion.android.nfc.Hilt_NfcEditFragment.generatedComponent(Hilt_NfcEditFragment.java:90)
        at io.homeassistant.companion.android.nfc.Hilt_NfcEditFragment.inject(Hilt_NfcEditFragment.java:112)
        at io.homeassistant.companion.android.nfc.Hilt_NfcEditFragment.onAttach(Hilt_NfcEditFragment.java:62)
        at androidx.fragment.app.Fragment.onAttach(Fragment.java:1783)
        at io.homeassistant.companion.android.nfc.Hilt_NfcEditFragment.onAttach(Hilt_NfcEditFragment.java:49)
        at androidx.fragment.app.Fragment.performAttach(Fragment.java:2922)
        at androidx.fragment.app.FragmentStateManager.attach(FragmentStateManager.java:464)
        at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:275)
        at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
        at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2106)
        at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
        at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:524)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7839)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
ad-ha commented 3 years ago

Gad you found the issue.

Thanks for the quick check and reply.