nativescript-ui-feedback icon indicating copy to clipboard operation
nativescript-ui-feedback copied to clipboard

RadCalendar Android: this.nativeView.setForceDarkAllowed is not a function

Open Guervyl opened this issue 4 years ago • 1 comments

Tell us about the problem

RadCalendar Android: this.nativeView.setForceDarkAllowed is not a function

Which platform(s) does your issue occur on?

Android 10, 11

Please provide the following version numbers that your issue occurs with:

  • Progress NativeScript UI plugin version: nativescript-ui-calendar": "^7.0.2"
  • CLI: 7.2.0
  • Cross-platform modules: "@nativescript/core": "~7.1.0"
  • Runtime(s): (the "tns-android" and "tns-ios" properties in the package.json). I don't see those in the file.

Please tell us how to recreate the issue in as much detail as possible.

When running the app on emulators of android 10, android 11 I got the error this._nativeView.setForceDarkAllowed is not a function. On my phisical phone Android 6, I don't get this error.

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

It's just about rendering the RadCalendar

Guervyl avatar Feb 28 '21 03:02 Guervyl

I fixed the issue by setting

if (isAndroid) {
            try {
                Theme.setMode(Theme.Light);
            } catch (e) {
                console.log("Error setting Theme to light mode", e);
            }
        }

However if I want dark mode the app will crash.

Guervyl avatar Feb 28 '21 03:02 Guervyl