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

bug: variable WEB_THEME_DARKENING_ONLY is not recognized #6

Open
yucehasan opened this issue Oct 20, 2022 · 2 comments
Open

bug: variable WEB_THEME_DARKENING_ONLY is not recognized #6

yucehasan opened this issue Oct 20, 2022 · 2 comments

Comments

@yucehasan
Copy link

Plugin version:

1.0.1

Platform(s):
Android

Current behavior:
Gradle build fails because a constant is not recognized

Expected behavior:
It should build

Steps to reproduce:
Try to build the app

Related code:

WebSettingsCompat.setForceDarkStrategy(settings, WebSettingsCompat.WEB_THEME_DARKENING_ONLY);

        if (WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK_STRATEGY)) {
            WebSettingsCompat.setForceDarkStrategy(settings, WebSettingsCompat.WEB_THEME_DARKENING_ONLY);
        }

Other information:
Error log:

            WebSettingsCompat.setForceDarkStrategy(settings, WebSettingsCompat.WEB_THEME_DARKENING_ONLY);
                                                                              ^
  symbol:   variable WEB_THEME_DARKENING_ONLY
  location: class WebSettingsCompat

I think it might be replaced with

        if (WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK_STRATEGY)) {
            WebSettingsCompat.setForceDarkStrategy(settings, WebSettingsCompat.DARK_STRATEGY_WEB_THEME_DARKENING_ONLY);
        }

Capacitor doctor:

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 4.3.0
  @capacitor/core: 4.3.0
  @capacitor/android: 4.3.0
  @capacitor/ios: 4.3.0

Installed Dependencies:

  @capacitor/cli: 4.0.1
  @capacitor/android: 4.0.0
  @capacitor/core: 4.0.0
  @capacitor/ios: 4.0.1

[success] iOS looking great! 👌
[success] Android looking great! 👌
@yucehasan yucehasan changed the title bug: bug: variable WEB_THEME_DARKENING_ONLY is not recognized Oct 20, 2022
@spencerAEE
Copy link

This bug is still present however the solution noted in this issue did work

@piotr-cz
Copy link

piotr-cz commented May 5, 2023

@spencerAEE

See #10, #11, #12 and #13

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