Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash initializing NFC #36

Closed
victordiaz opened this issue Jul 4, 2020 · 19 comments
Closed

Crash initializing NFC #36

victordiaz opened this issue Jul 4, 2020 · 19 comments

Comments

@victordiaz
Copy link
Owner

Problem description
Crash on script launching
https://pastebin.com/acSt8gJW

Device model / Android Version
Redmi Note 8 (Android 10 custom rom)

Steps to reproduce the bug
Launch a script from the device or the Web Editor

@victordiaz
Copy link
Owner Author

@BillisC
There is a bit of old code in PHONK.
Each time an script launches the NFC tries to be initialized in devices supporting it. Automatic initialization is not good :/

Maybe the custom rom does not support NFC and thats why it crash.
Nevertheless, the NFC should not be initialized each time so this needs a fix asap

@BillisC
Copy link

BillisC commented Jul 4, 2020

What's strange is that redmi note 8 does not have NFC unlike redmi note 8T. So I used an app that shows support and it indeed showed that it supports. I bet it's because the build is also made for 8T(It's mainly for 8) so it's probably a rom issue. Maybe it could also be what you said about old code.

EDIT: Looks like another app fails to detect it

@victordiaz
Copy link
Owner Author

victordiaz commented Jul 4, 2020

@BillisC
There is an alpha version here https://github.com/victordiaz/PHONK/releases/tag/1.2.6-alpha that should correct the problem with this commit a1e7258
Do you mind having a look?

@BillisC
Copy link

BillisC commented Jul 4, 2020

Wow everything works fine now. Small issue that it shows a random crash when i change between scripts. But the app doesn't crash and i can continue using it.

https://pastebin.com/0WCcSuCS

@victordiaz
Copy link
Owner Author

I just uploaded a new APK in the same link as before (1.2.6-alpha-2)
It should work now :)

I will keep this issue open until it the NFC stuff can be tested with some real NFC tags :)

@victordiaz
Copy link
Owner Author

wait! I was too fast :)
Check the alpha3.... :)

@BillisC
Copy link

BillisC commented Jul 4, 2020

Alpha 3 works perfectly 👍

@BillisC
Copy link

BillisC commented Jul 4, 2020

One thing I noticed is that the nfc example led to an app crash but would it be possible to show a text like "Unsupported" or similar instead?

@victordiaz
Copy link
Owner Author

Yes, that would be good.
I dont have the right hardware but if you can test it for me I'd be happy to do it

@BillisC
Copy link

BillisC commented Jul 4, 2020

sure thing, right hardware you mean no nfc hardware right?

victordiaz added a commit that referenced this issue Jul 7, 2020
@victordiaz
Copy link
Owner Author

Hi @BillisC
There is a new version 1.2.7 online. Can you check if the same thing is still happening? Thanks

@BillisC
Copy link

BillisC commented Jul 14, 2020

The nfc is fixed and the app works. Not sure if you changed the example nfc since it crashes the app

@victordiaz
Copy link
Owner Author

Hi @BillisC
I don't understand very well. Does it crash on your device?
In my PIxel 3a NFC works both reading and writing with 1.2.7

@BillisC
Copy link

BillisC commented Jul 14, 2020

Let me explain,
My phone (redmi note 8) does not support NFC. The app used to crash because of some old code that you already fixed. Now everything is fine except from the NFC example script which instantly crashes the app because no NFC is found. So my idea was to add a message like "NFC is unsupported" in it instead of crashing the app.

@victordiaz
Copy link
Owner Author

victordiaz commented Jul 14, 2020

Oh, I see! :)
In theory I'm checking if the NFC is supported by the device. Since your rom is reporting that you have NFC (but you dont have) then the app crashes, so I think is more an issue with the rom than with PHONK now.
If you can post a log I can try to add some try catches. I think your setup is very unlikely to happen to another person, dont you think?

@marclava
Copy link

My phone is also a Xiaomi, model Mi A2 Lite (Redmi 6 Pro); it does not support NFC, and the Phonk example shows a proper alert ("This device does not support NFC"), very probably because my ROM (LineageOS) correctly detects that NFC is not supported.

@victordiaz
Copy link
Owner Author

Thanks @marclava for checking it out

@BillisC
Copy link

BillisC commented Jul 14, 2020

Well this indeed looks like a rom issue. This should conclude the nfc problems the app had.

@victordiaz
Copy link
Owner Author

@BillisC ok! thanks for your initial report, I made me help improving and fixing a bunch of NFC related stuff :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants