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

Cannot read property ‘setOnTouchListener’ of null #45

Open
earnestware opened this issue Sep 7, 2020 · 9 comments
Open

Cannot read property ‘setOnTouchListener’ of null #45

earnestware opened this issue Sep 7, 2020 · 9 comments

Comments

@earnestware
Copy link

I have a project I’m working on and have come across a weird situation. My primary dev machine is iMac Pro and I use bitbucket to store the code. I also pull to my MacBook to code while relaxing... the problem is with nativescript-toasty. Everything works fine on the iMac but on the MacBook Pro it throws an exception TypeError: Cannot read property ‘setOnTouchListener’ of null... I’m guessing this is line 30 of toasty.android.ts I’m asking here because maybe this is a set up issue?

@triniwiz
Copy link
Owner

triniwiz commented Sep 7, 2020

Can you share the code you are using ?

@felixkrautschuk
Copy link

I also got this issue now, for me it only occurs on Android 11 (working fine on 8, 9 and 10)

I am using

This is what I am doing:

function showToast(text: string) {
    new Toasty({ text : text })
        .setToastDuration(ToastDuration.SHORT)
        .setToastPosition(ToastPosition.BOTTOM)
        .setTextColor("#FFFFFF")
        .setBackgroundColor("#656565")
        .show();
}

The app does not crash, but the toast is not shown and I see the error message from this thread in the log:
TypeError: Cannot read property 'setOnTouchListener' of null (Android 11)

@triniwiz
Copy link
Owner

Ok good to know it which version it happens on

@dmoptimal
Copy link

I'm using pretty much the same specs and I also get this issue (only on Android 11)

@juniorschen
Copy link

any solutions?

@earnestware
Copy link
Author

Can you share the code you are using ?

this.toast = new Toasty({ text: "Some message" }); this.toast.show();

The problem is android version>10.

@triniwiz
Copy link
Owner

this is fixed in @triniwiz/nativescript-toasty

@denkan
Copy link

denkan commented May 6, 2021

this is fixed in @triniwiz/nativescript-toasty

@triniwiz How do you mean?
Can't see any updates on Github repo, NS marketplace nor NPM.

Any advice on how to fix the issue is appreciated.

EDIT:
Oh, my bad. Here they are:
https://market.nativescript.org/plugins/@triniwiz/nativescript-toasty/
https://www.npmjs.com/package/@triniwiz/nativescript-toasty

Maybe update the readme on nativescript-toasty and reference NS >7.0 to @triniwiz/nativescript-toasty?
EDIT 2: Haha, just saw the readme was indeed correct here on Github. My bad, looking at NPM/NS Marketplace.

@triniwiz
Copy link
Owner

triniwiz commented May 6, 2021

this is fixed in @triniwiz/nativescript-toasty

@triniwiz How do you mean?
Can't see any updates on Github repo, NS marketplace nor NPM.

Any advice on how to fix the issue is appreciated.

EDIT:
Oh, my bad. Here they are:
https://market.nativescript.org/plugins/@triniwiz/nativescript-toasty/
https://www.npmjs.com/package/@triniwiz/nativescript-toasty

Maybe update the readme on nativescript-toasty and reference NS >7.0 to @triniwiz/nativescript-toasty?
EDIT 2: Haha, just saw the readme was indeed correct here on Github. My bad, looking at NPM/NS Marketplace.

https://github.com/triniwiz/nativescript-plugins/tree/master/packages/nativescript-toasty

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

6 participants